From: Peter Zijlstra <a.p.zijlstra@chello.nl>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Mel Gorman <mgorman@suse.de>, Miao Xie <miaox@cn.fujitsu.com>,
David Rientjes <rientjes@google.com>,
Christoph Lameter <cl@linux.com>,
linux-mm@kvack.org, linux-kernel@vger.kernel.org,
Pekka Enberg <penberg@cs.helsinki.fi>
Subject: Re: [PATCH] mm: Optimize put_mems_allowed() usage
Date: Thu, 17 May 2012 22:23:24 +0200 [thread overview]
Message-ID: <1337286204.4281.87.camel@twins> (raw)
In-Reply-To: <20120517131610.d1b09fd8.akpm@linux-foundation.org>
On Thu, 2012-05-17 at 13:16 -0700, Andrew Morton wrote:
> I do think it was a bad idea to remove that comment. As it stands, the
> reader will be wondering why we did the read_mems_allowed_begin() at
> all, and whether failing to check for a change is a bug.
>
> --- a/mm/slub.c~mm-optimize-put_mems_allowed-usage-fix
> +++ a/mm/slub.c
> @@ -1624,8 +1624,16 @@ static struct page *get_any_partial(stru
> if (n && cpuset_zone_allowed_hardwall(zone, flags) &&
> n->nr_partial > s->min_partial) {
> object = get_partial_node(s, n, c);
> - if (object)
> + if (object) {
> + /*
> + * Don't check read_mems_allowed_retry()
> + * here - if mems_allowed was updated in
> + * parallel, that was a harmless race
> + * between allocation and the cpuset
> + * update
> + */
> return object;
> + }
> }
> }
> } while (read_mems_allowed_retry(cpuset_mems_cookie));
OK, it seemed weird to have that comment in this one place whilst it is
the general pattern of this construct.
The whole read_mems_allowed_retry() should only ever be attempted in
case the allocation failed.
But sure..
--
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/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
WARNING: multiple messages have this Message-ID (diff)
From: Peter Zijlstra <a.p.zijlstra@chello.nl>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Mel Gorman <mgorman@suse.de>, Miao Xie <miaox@cn.fujitsu.com>,
David Rientjes <rientjes@google.com>,
Christoph Lameter <cl@linux.com>,
linux-mm@kvack.org, linux-kernel@vger.kernel.org,
Pekka Enberg <penberg@cs.helsinki.fi>
Subject: Re: [PATCH] mm: Optimize put_mems_allowed() usage
Date: Thu, 17 May 2012 22:23:24 +0200 [thread overview]
Message-ID: <1337286204.4281.87.camel@twins> (raw)
In-Reply-To: <20120517131610.d1b09fd8.akpm@linux-foundation.org>
On Thu, 2012-05-17 at 13:16 -0700, Andrew Morton wrote:
> I do think it was a bad idea to remove that comment. As it stands, the
> reader will be wondering why we did the read_mems_allowed_begin() at
> all, and whether failing to check for a change is a bug.
>
> --- a/mm/slub.c~mm-optimize-put_mems_allowed-usage-fix
> +++ a/mm/slub.c
> @@ -1624,8 +1624,16 @@ static struct page *get_any_partial(stru
> if (n && cpuset_zone_allowed_hardwall(zone, flags) &&
> n->nr_partial > s->min_partial) {
> object = get_partial_node(s, n, c);
> - if (object)
> + if (object) {
> + /*
> + * Don't check read_mems_allowed_retry()
> + * here - if mems_allowed was updated in
> + * parallel, that was a harmless race
> + * between allocation and the cpuset
> + * update
> + */
> return object;
> + }
> }
> }
> } while (read_mems_allowed_retry(cpuset_mems_cookie));
OK, it seemed weird to have that comment in this one place whilst it is
the general pattern of this construct.
The whole read_mems_allowed_retry() should only ever be attempted in
case the allocation failed.
But sure..
next prev parent reply other threads:[~2012-05-17 20:23 UTC|newest]
Thread overview: 39+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-07 18:08 [PATCH] cpuset: mm: Reduce large amounts of memory barrier related damage v3 Mel Gorman
2012-03-07 18:08 ` Mel Gorman
2012-03-26 10:56 ` Peter Zijlstra
2012-03-26 10:56 ` Peter Zijlstra
2012-03-26 11:07 ` Peter Zijlstra
2012-03-26 11:07 ` Peter Zijlstra
2012-03-26 15:50 ` Mel Gorman
2012-03-26 15:50 ` Mel Gorman
2012-03-26 16:20 ` Peter Zijlstra
2012-03-26 16:20 ` Peter Zijlstra
2012-03-27 12:47 ` Mel Gorman
2012-03-27 12:47 ` Mel Gorman
2012-03-27 13:14 ` [PATCH] mm: Optimize put_mems_allowed() usage Peter Zijlstra
2012-03-27 13:14 ` Peter Zijlstra
2012-05-17 10:33 ` Peter Zijlstra
2012-05-17 10:33 ` Peter Zijlstra
2012-05-17 20:16 ` Andrew Morton
2012-05-17 20:16 ` Andrew Morton
2012-05-17 20:23 ` Peter Zijlstra [this message]
2012-05-17 20:23 ` Peter Zijlstra
2012-05-18 10:20 ` [tip:sched/numa] " tip-bot for Peter Zijlstra
2013-08-23 13:03 ` [PATCH] cpuset: mm: Reduce large amounts of memory barrier related damage v3 Peter Zijlstra
2013-08-23 13:03 ` Peter Zijlstra
2013-08-23 18:15 ` Peter Zijlstra
2013-08-23 18:15 ` Peter Zijlstra
2013-08-26 5:32 ` Rik van Riel
2013-08-26 5:32 ` Rik van Riel
2013-08-29 9:28 ` Mel Gorman
2013-08-29 9:28 ` Mel Gorman
2013-08-29 9:43 ` Peter Zijlstra
2013-08-29 9:43 ` Peter Zijlstra
2013-08-29 9:45 ` Peter Zijlstra
2013-08-29 9:45 ` Peter Zijlstra
2013-08-29 10:56 ` Mel Gorman
2013-08-29 10:56 ` Mel Gorman
2013-08-29 11:14 ` Peter Zijlstra
2013-08-29 11:14 ` Peter Zijlstra
2013-08-29 12:10 ` Mel Gorman
2013-08-29 12:10 ` Mel Gorman
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=1337286204.4281.87.camel@twins \
--to=a.p.zijlstra@chello.nl \
--cc=akpm@linux-foundation.org \
--cc=cl@linux.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mgorman@suse.de \
--cc=miaox@cn.fujitsu.com \
--cc=penberg@cs.helsinki.fi \
--cc=rientjes@google.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.