From: Andrew Morton <akpm@linux-foundation.org>
To: Johannes Weiner <hannes@cmpxchg.org>
Cc: Hugh Dickins <hughd@google.com>,
linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: mmotm 2014-02-05 list_lru_add lockdep splat
Date: Fri, 7 Feb 2014 12:52:33 -0800 [thread overview]
Message-ID: <20140207125233.4b84482453da6a656ff427dd@linux-foundation.org> (raw)
In-Reply-To: <20140206164136.GC6963@cmpxchg.org>
On Thu, 6 Feb 2014 11:41:36 -0500 Johannes Weiner <hannes@cmpxchg.org> wrote:
>
> Make the shadow lru->node[i].lock IRQ-safe to remove the order
> dictated by interruption. This slightly increases the IRQ-disabled
> section in the shadow shrinker, but it still drops all locks and
> enables IRQ after every reclaimed shadow radix tree node.
>
> ...
>
> --- a/mm/workingset.c
> +++ b/mm/workingset.c
> @@ -273,7 +273,10 @@ static unsigned long count_shadow_nodes(struct shrinker *shrinker,
> unsigned long max_nodes;
> unsigned long pages;
>
> + local_irq_disable();
> shadow_nodes = list_lru_count_node(&workingset_shadow_nodes, sc->nid);
> + local_irq_enable();
This is a bit ugly-looking.
A reader will look at that and wonder why the heck we're disabling
interrupts here. Against what? Is there some way in which we can
clarify this?
Perhaps adding list_lru_count_node_irq[save] and
list_lru_walk_node_irq[save] would be better - is it reasonable to
assume this is the only caller of the list_lru code which will ever
want irq-safe treatment?
This is all somewhat a side-effect of list_lru implementing its own
locking rather than requiring caller-provided locking. It's always a
mistake.
--
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:[~2014-02-07 20:52 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-06 3:50 Hugh Dickins
2014-02-06 16:41 ` Johannes Weiner
2014-02-06 22:18 ` Hugh Dickins
2014-02-07 17:44 ` Johannes Weiner
2014-02-07 20:52 ` Andrew Morton [this message]
2014-02-09 18:29 ` Johannes Weiner
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=20140207125233.4b84482453da6a656ff427dd@linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=hannes@cmpxchg.org \
--cc=hughd@google.com \
--cc=linux-kernel@vger.kernel.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