From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755479AbaELU2T (ORCPT ); Mon, 12 May 2014 16:28:19 -0400 Received: from mail-pb0-f41.google.com ([209.85.160.41]:48842 "EHLO mail-pb0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751288AbaELU2R (ORCPT ); Mon, 12 May 2014 16:28:17 -0400 Date: Mon, 12 May 2014 13:28:15 -0700 (PDT) From: David Rientjes X-X-Sender: rientjes@chino.kir.corp.google.com To: Vlastimil Babka cc: Joonsoo Kim , Andrew Morton , Hugh Dickins , Greg Thelen , linux-kernel@vger.kernel.org, linux-mm@kvack.org, Minchan Kim , Mel Gorman , Bartlomiej Zolnierkiewicz , Michal Nazarewicz , Naoya Horiguchi , Christoph Lameter , Rik van Riel Subject: Re: [PATCH] mm, compaction: properly signal and act upon lock and need_sched() contention In-Reply-To: <1399904111-23520-1-git-send-email-vbabka@suse.cz> Message-ID: References: <20140508051747.GA9161@js1304-P5Q-DELUXE> <1399904111-23520-1-git-send-email-vbabka@suse.cz> User-Agent: Alpine 2.02 (DEB 1266 2009-07-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 12 May 2014, Vlastimil Babka wrote: > diff --git a/mm/compaction.c b/mm/compaction.c > index 83ca6f9..b34ab7c 100644 > --- a/mm/compaction.c > +++ b/mm/compaction.c > @@ -222,6 +222,27 @@ static bool compact_checklock_irqsave(spinlock_t *lock, unsigned long *flags, > return true; > } > > +/* > + * Similar to compact_checklock_irqsave() (see its comment) for places where > + * a zone lock is not concerned. > + * > + * Returns false when compaction should abort. > + */ I think we should have some sufficient commentary in the code that describes why we do this. > +static inline bool compact_check_resched(struct compact_control *cc) > +{ I'm not sure that compact_check_resched() is the appropriate name. Sure, it specifies what the current implementation is, but what it's really actually doing is determining when compaction should abort prematurely. Something like compact_should_abort()? From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pa0-f46.google.com (mail-pa0-f46.google.com [209.85.220.46]) by kanga.kvack.org (Postfix) with ESMTP id 4DC1A6B0035 for ; Mon, 12 May 2014 16:28:18 -0400 (EDT) Received: by mail-pa0-f46.google.com with SMTP id kq14so5095197pab.5 for ; Mon, 12 May 2014 13:28:17 -0700 (PDT) Received: from mail-pa0-x230.google.com (mail-pa0-x230.google.com [2607:f8b0:400e:c03::230]) by mx.google.com with ESMTPS id gd2si6877733pbd.33.2014.05.12.13.28.17 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 12 May 2014 13:28:17 -0700 (PDT) Received: by mail-pa0-f48.google.com with SMTP id rd3so9282206pab.7 for ; Mon, 12 May 2014 13:28:17 -0700 (PDT) Date: Mon, 12 May 2014 13:28:15 -0700 (PDT) From: David Rientjes Subject: Re: [PATCH] mm, compaction: properly signal and act upon lock and need_sched() contention In-Reply-To: <1399904111-23520-1-git-send-email-vbabka@suse.cz> Message-ID: References: <20140508051747.GA9161@js1304-P5Q-DELUXE> <1399904111-23520-1-git-send-email-vbabka@suse.cz> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-linux-mm@kvack.org List-ID: To: Vlastimil Babka Cc: Joonsoo Kim , Andrew Morton , Hugh Dickins , Greg Thelen , linux-kernel@vger.kernel.org, linux-mm@kvack.org, Minchan Kim , Mel Gorman , Bartlomiej Zolnierkiewicz , Michal Nazarewicz , Naoya Horiguchi , Christoph Lameter , Rik van Riel On Mon, 12 May 2014, Vlastimil Babka wrote: > diff --git a/mm/compaction.c b/mm/compaction.c > index 83ca6f9..b34ab7c 100644 > --- a/mm/compaction.c > +++ b/mm/compaction.c > @@ -222,6 +222,27 @@ static bool compact_checklock_irqsave(spinlock_t *lock, unsigned long *flags, > return true; > } > > +/* > + * Similar to compact_checklock_irqsave() (see its comment) for places where > + * a zone lock is not concerned. > + * > + * Returns false when compaction should abort. > + */ I think we should have some sufficient commentary in the code that describes why we do this. > +static inline bool compact_check_resched(struct compact_control *cc) > +{ I'm not sure that compact_check_resched() is the appropriate name. Sure, it specifies what the current implementation is, but what it's really actually doing is determining when compaction should abort prematurely. Something like compact_should_abort()? -- 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