]> git.karo-electronics.de Git - karo-tx-linux.git/commit
mm: page_alloc: calculate classzone_idx once from the zonelist ref
authorMel Gorman <mgorman@suse.de>
Thu, 22 May 2014 00:43:23 +0000 (10:43 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Thu, 22 May 2014 00:43:23 +0000 (10:43 +1000)
commit9db32096edfa3f8f487d24fb48c784f403936033
treedaee24d9db49f338b9a5dae2d689fc41410b367f
parent61a5e6de21e18643f01c4668fc8471d8a2cf70ea
mm: page_alloc: calculate classzone_idx once from the zonelist ref

Dan Carpenter reported the following bug

The patch a486e00b8283: "mm: page_alloc: calculate classzone_idx
once from the zonelist ref" from May 17, 2014, leads to the
following static checker warning:

        mm/page_alloc.c:2543 __alloc_pages_slowpath()
        warn: we tested 'nodemask' before and it was 'false'

mm/page_alloc.c
  2537           * Find the true preferred zone if the allocation is unconstrained by
  2538           * cpusets.
  2539           */
  2540          if (!(alloc_flags & ALLOC_CPUSET) && !nodemask) {
                                                     ^^^^^^^^^
Patch introduces this test.

  2541                  struct zoneref *preferred_zoneref;
  2542                  preferred_zoneref = first_zones_zonelist(zonelist, high_zoneidx,
  2543                                  nodemask ? : &cpuset_current_mems_allowed,
                                        ^^^^^^^^
Patch introduces this test as well.

  2544                                  &preferred_zone);
  2545                  classzone_idx = zonelist_zone_idx(preferred_zoneref);
  2546          }

This patch should resolve it and is a fix to the mmotm patch
mm-page_alloc-calculate-classzone_idx-once-from-the-zonelist-ref

Signed-off-by: Mel Gorman <mgorman@suse.de>
Cc: Rik van Riel <riel@redhat.com>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/page_alloc.c