From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753901AbbJZM2j (ORCPT ); Mon, 26 Oct 2015 08:28:39 -0400 Received: from casper.infradead.org ([85.118.1.10]:46482 "EHLO casper.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753517AbbJZM2h (ORCPT ); Mon, 26 Oct 2015 08:28:37 -0400 Date: Mon, 26 Oct 2015 13:28:25 +0100 From: Peter Zijlstra To: Boqun Feng Cc: Daniel Wagner , linux-kernel@vger.kernel.org, linux-rt-users@vger.kernel.org, Paul Gortmaker , Marcelo Tosatti , Paolo Bonzini , "Paul E. McKenney" , Thomas Gleixner Subject: Re: [PATCH v3 1/4] wait.[ch]: Introduce the simple waitqueue (swait) implementation Message-ID: <20151026122825.GS2508@worktop.programming.kicks-ass.net> References: <1445326090-1698-1-git-send-email-daniel.wagner@bmw-carit.de> <1445326090-1698-2-git-send-email-daniel.wagner@bmw-carit.de> <20151026120426.GA1497@fixme-laptop.cn.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20151026120426.GA1497@fixme-laptop.cn.ibm.com> User-Agent: Mutt/1.5.22.1 (2013-10-16) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Oct 26, 2015 at 08:04:26PM +0800, Boqun Feng wrote: > Hi Daniel, > > On Tue, Oct 20, 2015 at 09:28:07AM +0200, Daniel Wagner wrote: > > + > > +/* > > + * The thing about the wake_up_state() return value; I think we can ignore it. > > + * > > + * If for some reason it would return 0, that means the previously waiting > > + * task is already running, so it will observe condition true (or has already). > > + */ > > +void swake_up_locked(struct swait_queue_head *q) > > +{ > > + struct swait_queue *curr; > > + > > + list_for_each_entry(curr, &q->task_list, task_list) { > > + wake_up_process(curr->task); > > + list_del_init(&curr->task_list); > > + break; > > Just be curious, what's this break for? Or what's this loop(?) for? Lazy way of writing: if (!empty) { curr = first-entry;