From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qg0-f44.google.com (mail-qg0-f44.google.com [209.85.192.44]) by kanga.kvack.org (Postfix) with ESMTP id E80486B0036 for ; Fri, 23 May 2014 06:49:49 -0400 (EDT) Received: by mail-qg0-f44.google.com with SMTP id i50so7619264qgf.17 for ; Fri, 23 May 2014 03:49:49 -0700 (PDT) Received: from na01-bn1-obe.outbound.protection.outlook.com (mail-bn1lp0145.outbound.protection.outlook.com. [207.46.163.145]) by mx.google.com with ESMTPS id b62si3012733qgb.26.2014.05.23.03.49.49 for (version=TLSv1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 23 May 2014 03:49:49 -0700 (PDT) Date: Fri, 23 May 2014 18:49:14 +0800 From: Shawn Guo Subject: Re: [PATCH v2] mm, compaction: properly signal and act upon lock and need_sched() contention Message-ID: <20140523104911.GA7306@dragon> References: <1399904111-23520-1-git-send-email-vbabka@suse.cz> <1400233673-11477-1-git-send-email-vbabka@suse.cz> <537F082F.50501@suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <537F082F.50501@suse.cz> Sender: owner-linux-mm@kvack.org List-ID: To: Vlastimil Babka Cc: Kevin Hilman , Andrew Morton , Joonsoo Kim , David Rientjes , Hugh Dickins , Greg Thelen , LKML , linux-mm@kvack.org, Minchan Kim , Mel Gorman , Bartlomiej Zolnierkiewicz , Michal Nazarewicz , Christoph Lameter , Rik van Riel , Olof Johansson , Stephen Warren , linux-arm-kernel On Fri, May 23, 2014 at 10:34:55AM +0200, Vlastimil Babka wrote: > From: Vlastimil Babka > Date: Fri, 23 May 2014 10:18:56 +0200 > Subject: mm-compaction-properly-signal-and-act-upon-lock-and-need_sched-contention-fix2 > > Step 1: Change function name and comment between v1 and v2 so that the return > value signals the opposite thing. > Step 2: Change the call sites to reflect the opposite return value. > Step 3: ??? > Step 4: Make a complete fool of yourself. > > Signed-off-by: Vlastimil Babka Tested-by: Shawn Guo > --- > mm/compaction.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/mm/compaction.c b/mm/compaction.c > index a525cd4..5175019 100644 > --- a/mm/compaction.c > +++ b/mm/compaction.c > @@ -237,13 +237,13 @@ static inline bool compact_should_abort(struct compact_control *cc) > if (need_resched()) { > if (cc->mode == MIGRATE_ASYNC) { > cc->contended = true; > - return false; > + return true; > } > > cond_resched(); > } > > - return true; > + return false; > } > > /* Returns true if the page is within a block suitable for migration to */ > -- > 1.8.4.5 > > -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org