Re: [PATCH 2/4] pull out zone cpuset and watermark checks for reuse

From: KOSAKI Motohiro
Date: Wed Jul 02 2008 - 04:07:47 EST


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 from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/