From: "Vlastimil Babka (SUSE)" <vbabka@kernel.org>
To: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Cc: Shakeel Butt <shakeel.butt@linux.dev>,
Andrew Morton <akpm@linux-foundation.org>,
Johannes Weiner <hannes@cmpxchg.org>,
Michal Hocko <mhocko@kernel.org>,
Roman Gushchin <roman.gushchin@linux.dev>,
Muchun Song <muchun.song@linux.dev>,
linux-mm@kvack.org, linux-kernel@vger.kernel.org,
Thomas Gleixner <tglx@linutronix.de>
Subject: Re: [PATCH v2] memcg: simple cleanup of stats update functions
Date: Tue, 28 May 2024 14:17:44 +0200 [thread overview]
Message-ID: <800ceb7a-7c48-442b-912c-d55c6a1aaacb@kernel.org> (raw)
In-Reply-To: <20240528101906.ts4NjHvU@linutronix.de>
On 5/28/24 12:19 PM, Sebastian Andrzej Siewior wrote:
> On 2024-05-28 10:10:50 [+0200], Vlastimil Babka (SUSE) wrote:
>> > I don't mind sending a patch. I'm just not sure if the lock is the right
>> > thing to do. However it should ensure that interrupts are disabled on
>> > !RT for the sake of the counter update (if observed in IRQ context).
>>
>> Looks like some places there use VM_WARN_ON_IRQS_ENABLED() that's turned off
>> for PREEMPT_RT, so maybe that's what should replace the current
>> lockdep_assert, perhaps together with
>> lockdep_assert_held(this_cpu_ptr(&memcg_stock.stock_lock));
>>
>> But also __mod_memcg_lruvec_state() already has that VM_WARN_ON.
>
> This "VM_WARN_ON_IRQS_ENABLED" is the initial assert for "interrupts
> must be disabled while change the counter".
> You want to replace it with lockdep? Part of its requirement was that it
> yells with lockdep disabled.
No I meant the other way around, that we'de use VM_WARN_ON_IRQS_ENABLED
instead of the current lockdep_assert() that doesn't work on RT.
> Currently I am leaning towards removing the
> lockdep_assert_irqs_disabled() from __mod_objcg_mlstate(). Nothing but
> the counter need it and they have their own check. So?
Yeah that might be sufficient.
> Sebastian
prev parent reply other threads:[~2024-05-28 12:17 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-20 23:25 [PATCH v2] memcg: simple cleanup of stats update functions Shakeel Butt
2024-05-27 15:22 ` Sebastian Andrzej Siewior
2024-05-27 16:34 ` Vlastimil Babka (SUSE)
2024-05-28 5:16 ` Shakeel Butt
2024-05-28 7:56 ` Sebastian Andrzej Siewior
2024-05-28 8:10 ` Vlastimil Babka (SUSE)
2024-05-28 10:19 ` Sebastian Andrzej Siewior
2024-05-28 12:17 ` Vlastimil Babka (SUSE) [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=800ceb7a-7c48-442b-912c-d55c6a1aaacb@kernel.org \
--to=vbabka@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=bigeasy@linutronix.de \
--cc=hannes@cmpxchg.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mhocko@kernel.org \
--cc=muchun.song@linux.dev \
--cc=roman.gushchin@linux.dev \
--cc=shakeel.butt@linux.dev \
--cc=tglx@linutronix.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;
as well as URLs for NNTP newsgroup(s).