From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751667AbeCOMfj (ORCPT ); Thu, 15 Mar 2018 08:35:39 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:34100 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750726AbeCOMfi (ORCPT ); Thu, 15 Mar 2018 08:35:38 -0400 Message-Id: <20180315123202.893686246@infradead.org> User-Agent: quilt/0.63-1 Date: Thu, 15 Mar 2018 13:19:13 +0100 From: Peter Zijlstra To: Ingo Molnar , linux-kernel@vger.kernel.org Cc: Dan Williams , David Howells , Daniel Vetter , David Airlie , Stanimir Varbanov , Chris Mason , Anna Schumaker , Joel Becker , James Hogan , Ralf Baechle , Linus Torvalds , George Spelvin , "Peter Zijlstra (Intel)" Subject: [PATCH 11/11] sched/wait: Improve __var_waitqueue() References: <20180315121902.942902000@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline; filename=peterz-wait_var-11.patch Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Since we fixed hash_64 to not suck, there is no need to play games to attempt to improve the hash value on 64bit. Also, since we don't use the bit value for the variables, use hash_ptr() directly. Cc: Linus Torvalds Cc: George Spelvin Signed-off-by: Peter Zijlstra (Intel) --- kernel/sched/wait_bit.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) --- a/kernel/sched/wait_bit.c +++ b/kernel/sched/wait_bit.c @@ -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);