Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932625Ab3CGRWU (ORCPT ); Thu, 7 Mar 2013 12:22:20 -0500 Received: from merlin.infradead.org ([205.233.59.134]:59345 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754358Ab3CGRWT (ORCPT ); Thu, 7 Mar 2013 12:22:19 -0500 Message-ID: <1362676917.10972.23.camel@laptop> Subject: Re: [PATCH] sched: wakeup buddy From: Peter Zijlstra To: Michael Wang Cc: LKML , Ingo Molnar , Mike Galbraith , Namhyung Kim , Alex Shi , Paul Turner , Andrew Morton , "Nikunj A. Dadhania" , Ram Pai Date: Thu, 07 Mar 2013 18:21:57 +0100 In-Reply-To: <5136EB06.2050905@linux.vnet.ibm.com> References: <5136EB06.2050905@linux.vnet.ibm.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.6.2-0ubuntu0.1 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 857 Lines: 28 On Wed, 2013-03-06 at 15:06 +0800, Michael Wang wrote: > +static inline int wakeup_related(struct task_struct *p) > +{ > + if (wakeup_buddy(p, current)) { > + /* > + * Now check whether current still focus on his buddy. > + */ > + if (wakeup_buddy(current, p)) > + return 1; > + } > + > + return 0; > +} Not commenting on the thing in general, but: static inline bool wakeup_related(struct task_struct *p) { return wakeup_buddy(p, current) && wakeup_buddy(current, p); } is far shorter and easier to read :-) -- 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/