Re: [PATCH 07/20] Simplify the check on whether cpusets are a factoror not

From: Li Zefan
Date: Mon Feb 23 2009 - 04:15:22 EST


> +#ifdef CONFIG_CPUSETS
> + /* Determine in advance if the cpuset checks will be needed */
> + if ((alloc_flags & ALLOC_CPUSET) && unlikely(number_of_cpusets > 1))
> + alloc_cpuset = 1;
> +#endif
> +
> zonelist_scan:
> /*
> * Scan zonelist, looking for a zone with enough free.
> @@ -1420,8 +1427,8 @@ zonelist_scan:
> if (NUMA_BUILD && zlc_active &&
> !zlc_zone_worth_trying(zonelist, z, allowednodes))
> continue;
> - if ((alloc_flags & ALLOC_CPUSET) &&
> - !cpuset_zone_allowed_softwall(zone, gfp_mask))
> + if (alloc_cpuset)
> + if (!cpuset_zone_allowed_softwall(zone, gfp_mask))

I think you can call __cpuset_zone_allowed_softwall() which won't
check number_of_cpusets, and note you should also define an empty
noop __xxx() for !CONFIG_CPUSETS.

> goto try_next_zone;
>
> if (!(alloc_flags & ALLOC_NO_WATERMARKS)) {
--
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/