Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753027AbbBSJ4o (ORCPT ); Thu, 19 Feb 2015 04:56:44 -0500 Received: from mail-we0-f173.google.com ([74.125.82.173]:42617 "EHLO mail-we0-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752841AbbBSJ4m (ORCPT ); Thu, 19 Feb 2015 04:56:42 -0500 Date: Thu, 19 Feb 2015 10:56:37 +0100 From: Ingo Molnar To: Davidlohr Bueso Cc: tglx@linutronix.de, peterz@infradead.org, dvhart@linux.intel.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH] futex: Robustify wake_futex() Message-ID: <20150219095637.GA344@gmail.com> References: <1424148397.2046.101.camel@stgolabs.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1424148397.2046.101.camel@stgolabs.net> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1335 Lines: 46 * Davidlohr Bueso wrote: > @@ -1674,13 +1689,19 @@ retry_private: > } > > /* > - * Wake nr_wake waiters. For requeue_pi, if we acquired the > - * lock, we already woke the top_waiter. If not, it will be > - * woken by futex_unlock_pi(). > + * For requeue_pi, if we acquired the lock, we already woke > + * the top_waiter. If not, it will be woken by futex_unlock_pi. > + * > + * The regular (non-pi) case is much simpler: Wake the top > + * waiter (next in line) and repeat. > */ > - if (++task_count <= nr_wake && !requeue_pi) { > - wake_futex(this); > - continue; > + if (!requeue_pi) { > + if (!wake_futex(this)) { > + ret = -EINVAL; > + break; > + } > + if (++task_count <= nr_wake) > + continue; > } > Hm, so at a first glance this change appears to go beyond the scope of adding a return value to wake_futex()? For example before the change in the !requeue_pi case we'd only call wake_futex() if ++task_count <= nr_wake, after the change we always call it. What's the intention here? Thanks, Ingo -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/