linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: David Rientjes <rientjes@google.com>
To: Mel Gorman <mgorman@suse.de>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	linux-mm@kvack.org, Dan Carpenter <dan.carpenter@oracle.com>
Subject: Re: [PATCH] mm: page_alloc: Calculate classzone_idx once from the zonelist ref
Date: Tue, 20 May 2014 17:06:56 -0700 (PDT)	[thread overview]
Message-ID: <alpine.DEB.2.02.1405201705200.24551@chino.kir.corp.google.com> (raw)
In-Reply-To: <20140520124302.GN23991@suse.de>

On Tue, 20 May 2014, Mel Gorman wrote:

> 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>
> ---
>  mm/page_alloc.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/mm/page_alloc.c b/mm/page_alloc.c
> index 0959b09..ebb947d 100644
> --- a/mm/page_alloc.c
> +++ b/mm/page_alloc.c
> @@ -2590,8 +2590,7 @@ restart:
>  	if (!(alloc_flags & ALLOC_CPUSET) && !nodemask) {
>  		struct zoneref *preferred_zoneref;
>  		preferred_zoneref = first_zones_zonelist(zonelist, high_zoneidx,
> -				nodemask ? : &cpuset_current_mems_allowed,
> -				&preferred_zone);
> +				NULL, &preferred_zone);
>  		classzone_idx = zonelist_zone_idx(preferred_zoneref);
>  	}
>  

The switch from "nodemask : &cpuset_current_mems_allowed" to NULL isn't 
described in the changelog but makes sense as well because of
!(alloc_flags & ALLOC_CPUSET).

Acked-by: David Rientjes <rientjes@google.com>

--
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:[~2014-05-21  0:06 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-20 11:17 mm: page_alloc: calculate " Dan Carpenter
2014-05-20 12:43 ` [PATCH] mm: page_alloc: Calculate " Mel Gorman
2014-05-21  0:06   ` David Rientjes [this message]

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=alpine.DEB.2.02.1405201705200.24551@chino.kir.corp.google.com \
    --to=rientjes@google.com \
    --cc=akpm@linux-foundation.org \
    --cc=dan.carpenter@oracle.com \
    --cc=linux-mm@kvack.org \
    --cc=mgorman@suse.de \
    /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