From: Peter Zijlstra Subject: Re: [PATCH 1/2] sched/wait: add round robin wakeup mode Date: Tue, 10 Feb 2015 17:11:54 +0100 Message-ID: <20150210161154.GY21418@twins.programming.kicks-ass.net> References: <20150209215045.GU21418@twins.programming.kicks-ass.net> <54D983B9.800@akamai.com> <20150210090336.GV21418@twins.programming.kicks-ass.net> <54DA2AC5.6020508@akamai.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: mingo@redhat.com, viro@zeniv.linux.org.uk, akpm@linux-foundation.org, normalperson@yhbt.net, davidel@xmailserver.org, mtk.manpages@gmail.com, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org To: Jason Baron Return-path: Content-Disposition: inline In-Reply-To: <54DA2AC5.6020508@akamai.com> Sender: linux-kernel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org On Tue, Feb 10, 2015 at 10:59:01AM -0500, Jason Baron wrote: > hmmm...but don't we need the head/tail of the list to add it back too? Ah, good point that ;-) > Further, we can't just append to tail while walking the list b/c > otherwise it can result in multiple wakeups to the same item. So I could > add to a local list, for example, in __wake_up_common(). And then just > add that to the tail once the list_for_each() finishes. True; you can do horrible things, but I think that is the safest option indeed. > In terms of the flag, maybe another option would be to have the > wait_queue_func_t return a 'ROTATE_ME' value instead > of 1, since I think we currently only make use of 0 and 1? Lets stick with the flag then.