From: Johannes Weiner <hannes@cmpxchg.org>
To: Andi Kleen <andi@firstfloor.org>
Cc: akpm@linux-foundation.org, linux-mm@kvack.org,
Andi Kleen <ak@linux.intel.com>
Subject: Re: [PATCH] mm: Simplify and batch working set shadow pages LRU isolation locking
Date: Fri, 27 Oct 2017 13:01:56 -0400 [thread overview]
Message-ID: <20171027170156.GA1743@cmpxchg.org> (raw)
In-Reply-To: <20171026234854.25764-1-andi@firstfloor.org>
On Thu, Oct 26, 2017 at 04:48:54PM -0700, Andi Kleen wrote:
> static unsigned long scan_shadow_nodes(struct shrinker *shrinker,
> struct shrink_control *sc)
> {
> + struct list_head *tmp, *pos;
> unsigned long ret;
> + LIST_HEAD(nodes);
> + spinlock_t *lock = NULL;
>
> - /* list_lru lock nests inside IRQ-safe mapping->tree_lock */
> + ret = list_lru_shrink_walk(&shadow_nodes, sc, shadow_lru_isolate, &nodes);
> local_irq_disable();
> - ret = list_lru_shrink_walk(&shadow_nodes, sc, shadow_lru_isolate, NULL);
> + list_for_each_safe (pos, tmp, &nodes)
> + free_shadow_node(pos, &lock);
The nlru->lock in list_lru_shrink_walk() is the only thing that keeps
truncation blocked on workingset_update_node() -> list_lru_del() and
so ultimately keeping it from freeing the radix tree node.
It's not safe to access the nodes on the private list after that.
Batching mapping->tree_lock is possible, but you have to keep the
lock-handoff scheme. Pass a &mapping to list_lru_shrink_walk() and
only unlock and spin_trylock(&mapping->tree_lock) if it changes?
--
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>
next prev parent reply other threads:[~2017-10-27 17:02 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-26 23:48 [PATCH] mm: Simplify and batch working set shadow pages LRU isolation locking Andi Kleen
2017-10-27 17:01 ` Johannes Weiner [this message]
2017-10-27 17:22 ` Andi Kleen
2017-10-27 20:59 ` Daniel Jordan
2017-10-27 20:51 ` Daniel Jordan
2017-11-08 1:56 ` [lkp-robot] [mm] 47bd678bc7: WARNING:at_mm/workingset.c:#scan_shadow_nodes kernel test robot
2017-11-09 0:03 ` Andi Kleen
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=20171027170156.GA1743@cmpxchg.org \
--to=hannes@cmpxchg.org \
--cc=ak@linux.intel.com \
--cc=akpm@linux-foundation.org \
--cc=andi@firstfloor.org \
--cc=linux-mm@kvack.org \
/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;
as well as URLs for NNTP newsgroup(s).