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

Li Zefan
2009-02-23T09:15:22Z

> +#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)) {