From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752344AbeCOOpY (ORCPT ); Thu, 15 Mar 2018 10:45:24 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:49766 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752006AbeCOOpX (ORCPT ); Thu, 15 Mar 2018 10:45:23 -0400 Organization: Red Hat UK Ltd. Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 3798903 From: David Howells In-Reply-To: <20180315115146.GX4064@hirez.programming.kicks-ass.net> References: <20180315115146.GX4064@hirez.programming.kicks-ass.net> <20180313102056.GJ4043@hirez.programming.kicks-ass.net> <152066488891.40260.14605734226832760468.stgit@dwillia2-desk3.amr.corp.intel.com> <152066493247.40260.10849841915366086021.stgit@dwillia2-desk3.amr.corp.intel.com> <20180311112725.GC4043@hirez.programming.kicks-ass.net> <3396.1521107922@warthog.procyon.org.uk> To: Peter Zijlstra Cc: dhowells@redhat.com, Dan Williams , linux-nvdimm , Ingo Molnar , Christoph Hellwig , david , linux-xfs , linux-fsdevel , Jan Kara , Ross Zwisler , Linux Kernel Mailing List , Ralf Baechle Subject: Re: [RFC][PATCH] sched/wait_bit: Introduce wait_var_event()/wake_up_var() MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <18970.1521125120.1@warthog.procyon.org.uk> Date: Thu, 15 Mar 2018 14:45:20 +0000 Message-ID: <18971.1521125120@warthog.procyon.org.uk> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Peter Zijlstra wrote: > Does the below address things sufficiently clear? Yep. > +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); > +} You might be better off not using bit_waitqueue() but rather do the calculation directly since you don't actually have a bit number. David