Skip to content

Commit

Permalink
sched/wait: Improve __var_waitqueue() code generation
Browse files Browse the repository at this point in the history
Since we fixed hash_64() to not suck there is no need to play games to
attempt to improve the hash value on 64-bit.

Also, since we don't use the bit value for the variables, use hash_ptr()
directly.

No change in functionality.

Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: George Spelvin <linux@sciencehorizons.net>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
  • Loading branch information
Peter Zijlstra authored and Ingo Molnar committed Mar 20, 2018
1 parent 9b8cce5 commit b3fc5c9
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions kernel/sched/wait_bit.c
Original file line number Diff line number Diff line change
Expand Up @@ -151,12 +151,7 @@ EXPORT_SYMBOL(wake_up_bit);

wait_queue_head_t *__var_waitqueue(void *p)
{
if (BITS_PER_LONG == 64) {
unsigned long q = (unsigned long)p;

return bit_waitqueue((void *)(q & ~1), q & 1);
}
return bit_waitqueue(p, 0);
return bit_wait_table + hash_ptr(p, WAIT_TABLE_BITS);
}
EXPORT_SYMBOL(__var_waitqueue);

Expand Down

0 comments on commit b3fc5c9

Please sign in to comment.