Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754780AbYCaD1f (ORCPT ); Sun, 30 Mar 2008 23:27:35 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751135AbYCaD1Z (ORCPT ); Sun, 30 Mar 2008 23:27:25 -0400 Received: from mx1.redhat.com ([66.187.233.31]:54124 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751199AbYCaD1Z (ORCPT ); Sun, 30 Mar 2008 23:27:25 -0400 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit From: Roland McGrath To: Linus Torvalds X-Fcc: ~/Mail/linus Cc: Andrew Morton , Oleg Nesterov , linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/2] do_wait reorganization In-Reply-To: Linus Torvalds's message of Saturday, 29 March 2008 09:16:02 -0700 X-Fcc: ~/Mail/linus References: <20080329033412.120EE26FA1D@magilla.localdomain> X-Zippy-Says: Here I am in the POSTERIOR OLFACTORY LOBULE but I don't see CARL SAGAN anywhere!! Message-Id: <20080331032717.A269626F8E9@magilla.localdomain> Date: Sun, 30 Mar 2008 20:27:17 -0700 (PDT) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1268 Lines: 36 > I also wonder if you really need both "int *retval" and the return value. > Isn't "retval" always going to be zero or a negative errno? No. > And the return value is going to be either true of false? Yes. > Why not just fold them into one single thing: > > - negative: all done, with error > - zero: this didn't trigger, continue with the next one in caller > - positive: this thread triggered, all done, return 0 in the caller. > > which is (I think) close to what we already do in eligible_child() (so > this would not be a new calling convention for this particular code). You listed the three possibilities for eligible_child(). For wait_consider_task(), there are four possibilities: - all done, with error - this thread was not eligible, look for another; return -ECHILD if none ready - this thread was eligible but is not ready; return 0 or block if none ready - all done, this thread is ready; return its pid I'll post another version that I think you'll like a little better. Thanks, Roland -- 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/