Re: [RFC PATCH v2] posix timers: allocate timer id per task

From: Eric Dumazet
Date: Wed Oct 17 2012 - 09:44:25 EST


On Wed, 2012-10-17 at 17:18 +0400, Stanislav Kinsbursky wrote:

> +static int hash(struct signal_struct *sig, unsigned int nr)
> +{
> + int hash = hash_ptr(sig, POSIX_TIMERS_HASH_BITS);
> + return hash ^ hash_32(nr, POSIX_TIMERS_HASH_BITS);
> +}
> +

This is quite expensive on 64 bit arches. I suggest instead :

return hash_32(hash32_ptr(sig) ^ nr, POSIX_TIMERS_HASH_BITS);


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/