OpenVZ Forum


Home » Mailing lists » Devel » [RFC PATCH v2] posix timers: allocate timer id per task
Re: [RFC PATCH v2] posix timers: allocate timer id per task [message #48429 is a reply to message #48427] Wed, 17 October 2012 14:19 Go to previous messageGo to previous message
Stanislav Kinsbursky is currently offline  Stanislav Kinsbursky
Messages: 683
Registered: October 2011
Senior Member
17.10.2012 17:44, Eric Dumazet пишет:
> 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);
>
>

I'm not familiar with hashing costs, so sure, I'll update.

--
Best regards,
Stanislav Kinsbursky
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: [PATCH v4 00/14] kmem controller for memcg.
Next Topic: [PATCH v5 02/14] memcg: Reclaim when more than one page needed.
Goto Forum:
  


Current Time: Tue Oct 15 03:45:33 GMT 2024

Total time taken to generate the page: 0.05016 seconds