From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752050AbbBJQME (ORCPT ); Tue, 10 Feb 2015 11:12:04 -0500 Received: from bombadil.infradead.org ([198.137.202.9]:42641 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750729AbbBJQMC (ORCPT ); Tue, 10 Feb 2015 11:12:02 -0500 Date: Tue, 10 Feb 2015 17:11:54 +0100 From: Peter Zijlstra To: Jason Baron 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 Subject: Re: [PATCH 1/2] sched/wait: add round robin wakeup mode 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 Content-Disposition: inline In-Reply-To: <54DA2AC5.6020508@akamai.com> User-Agent: Mutt/1.5.21 (2012-12-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@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.