linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Vlastimil Babka <vbabka@suse.cz>
Cc: "Matthew Wilcox (Oracle)" <willy@infradead.org>,
	linux-mm@kvack.org, Alexander Duyck <alexander.duyck@gmail.com>,
	Alex Shi <alex.shi@linux.alibaba.com>,
	Hugh Dickins <hughd@google.com>,
	Johannes Weiner <hannes@cmpxchg.org>,
	Thomas Gleixner <tglx@linutronix.de>
Subject: Re: [PATCH] memcg: Optimise relock_page_lruvec functions
Date: Mon, 25 Oct 2021 13:16:46 +0200	[thread overview]
Message-ID: <YXaSHlqcBqLPnJ/0@hirez.programming.kicks-ass.net> (raw)
In-Reply-To: <c0335508-7174-ae03-ad90-82a65d35b6d6@suse.cz>

On Mon, Oct 25, 2021 at 12:44:05PM +0200, Vlastimil Babka wrote:
> On 10/19/21 14:50, Matthew Wilcox (Oracle) wrote:
> > Leave interrupts disabled when we change which lru lock is held.
> > 
> > Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
> 
> Acked-by: Vlastimil Babka <vbabka@suse.cz>
> 
> Assuming lockdep is fine with e.g.:
> 
> spin_lock_irqsave(A);
> spin_unlock(A);
> spin_lock(B);
> spin_unlock_irqrestore(B);
> 
> (with A and B of same class).

It's unconditionally okay with that pattern. As far as lockdep
is concerned there really is no differences vs:

	local_irq_save()
	spin_lock(a)
	spin_unlock(a)
	spin_lock(b)
	spin_unlock(b)
	local_irq_restore()

It's the RT locking primitives that care about the difference :-)


      reply	other threads:[~2021-10-25 11:16 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-19 12:50 [PATCH] memcg: Optimise relock_page_lruvec functions Matthew Wilcox (Oracle)
2021-10-25 10:44 ` Vlastimil Babka
2021-10-25 11:16   ` Peter Zijlstra [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=YXaSHlqcBqLPnJ/0@hirez.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=alex.shi@linux.alibaba.com \
    --cc=alexander.duyck@gmail.com \
    --cc=hannes@cmpxchg.org \
    --cc=hughd@google.com \
    --cc=linux-mm@kvack.org \
    --cc=tglx@linutronix.de \
    --cc=vbabka@suse.cz \
    --cc=willy@infradead.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).