linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
To: Andy Whitcroft <apw@shadowen.org>
Cc: kosaki.motohiro@jp.fujitsu.com, linux-mm@kvack.org,
	linux-kernel@vger.kernel.org, Mel Gorman <mel@csn.ul.ie>
Subject: Re: [PATCH 2/4] pull out zone cpuset and watermark checks for reuse
Date: Wed, 02 Jul 2008 17:06:25 +0900	[thread overview]
Message-ID: <20080702165941.3817.KOSAKI.MOTOHIRO@jp.fujitsu.com> (raw)
In-Reply-To: <1214935122-20828-3-git-send-email-apw@shadowen.org>

Hi Andy,

this is nit.


> +/*
> + * Return 1 if this zone is an acceptable source given the cpuset
> + * constraints.
> + */
> +static inline int zone_cpuset_ok(struct zone *zone,
> +					int alloc_flags, gfp_t gfp_mask)
> +{
> +	if ((alloc_flags & ALLOC_CPUSET) &&
> +	    !cpuset_zone_allowed_softwall(zone, gfp_mask))
> +		return 0;
> +	return 1;
> +}

zone_cpuset_ok() seems cpuset sanity check.
but it is "allocatable?" check.

in addition, "ok" is slightly vague name, IMHO.


> +/*
> + * Return 1 if this zone is within the watermarks specified by the
> + * allocation flags.
> + */
> +static inline int zone_alloc_ok(struct zone *zone, int order,
> +			int classzone_idx, int alloc_flags, gfp_t gfp_mask)
> +{
> +	if (!(alloc_flags & ALLOC_NO_WATERMARKS)) {
> +		unsigned long mark;
> +		if (alloc_flags & ALLOC_WMARK_MIN)
> +			mark = zone->pages_min;
> +		else if (alloc_flags & ALLOC_WMARK_LOW)
> +			mark = zone->pages_low;
> +		else
> +			mark = zone->pages_high;
> +		if (!zone_watermark_ok(zone, order, mark,
> +			    classzone_idx, alloc_flags)) {
> +			if (!zone_reclaim_mode ||
> +					!zone_reclaim(zone, gfp_mask, order))
> +				return 0;
> +		}
> +	}
> +	return 1;
> +}

zone_alloc_ok() seems check "allocatable? or not".
So, I like zone_reclaim() go away from its function.



--
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: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  reply	other threads:[~2008-07-02  8:06 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-01 17:58 [RFC PATCH 0/4] Reclaim page capture v1 Andy Whitcroft
2008-07-01 17:58 ` [PATCH 1/4] pull out the page pre-release and sanity check logic for reuse Andy Whitcroft
2008-07-01 17:58 ` [PATCH 2/4] pull out zone cpuset and watermark checks " Andy Whitcroft
2008-07-02  8:06   ` KOSAKI Motohiro [this message]
2008-07-01 17:58 ` [PATCH 3/4] buddy: explicitly identify buddy field use in struct page Andy Whitcroft
2008-07-01 17:58 ` [PATCH 4/4] capture pages freed during direct reclaim for allocation by the reclaimer Andy Whitcroft
2008-07-02 12:01   ` KOSAKI Motohiro
2008-07-02 14:44     ` Andy Whitcroft
2008-09-03 18:44 [RFC PATCH 0/4] Reclaim page capture v2 Andy Whitcroft
2008-09-03 18:44 ` [PATCH 2/4] pull out zone cpuset and watermark checks for reuse Andy Whitcroft
2008-09-04  1:24   ` Rik van Riel
2008-09-05  1:52   ` KOSAKI Motohiro
2008-09-05 10:19 [PATCH 0/4] Reclaim page capture v3 Andy Whitcroft
2008-09-05 10:20 ` [PATCH 2/4] pull out zone cpuset and watermark checks for reuse Andy Whitcroft
2008-10-01 12:30 [PATCH 0/4] Reclaim page capture v4 Andy Whitcroft
2008-10-01 12:30 ` [PATCH 2/4] pull out zone cpuset and watermark checks for reuse Andy Whitcroft
2008-10-02  7:05   ` KAMEZAWA Hiroyuki

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080702165941.3817.KOSAKI.MOTOHIRO@jp.fujitsu.com \
    --to=kosaki.motohiro@jp.fujitsu.com \
    --cc=apw@shadowen.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mel@csn.ul.ie \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox