mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
To: Hugh Dickins <hughd@google.com>
Cc: Shakeel Butt <shakeel.butt@linux.dev>,
	syzbot <syzbot+cd2073ee6d958a8d0fcd@syzkaller.appspotmail.com>,
	linux-kernel@vger.kernel.org, linux-mm@kvack.org,
	syzkaller-bugs@googlegroups.com
Subject: Re: [syzbot] [mm?] WARNING in __mod_zone_page_state
Date: Mon, 31 Aug 2026 12:28:55 +0200	[thread overview]
Message-ID: <20260831102855.TOx0U8Vi@linutronix.de> (raw)
In-Reply-To: <4793259a-00da-ea31-8cbd-a6cb5bf48692@google.com>

On 2026-08-30 10:29:46 [-0700], Hugh Dickins wrote:
> Oh for the good old days when we were allowed to say preempt_disable()!

I'm sorry for taking this away from you.

> > --- a/mm/mlock.c
> > +++ b/mm/mlock.c
> > @@ -141,11 +141,16 @@ static struct lruvec *__munlock_folio(struct folio *folio, struct lruvec *lruvec
> >  
> >  munlock:
> >  	if (folio_test_clear_mlocked(folio)) {
> > -		__zone_stat_mod_folio(folio, NR_MLOCK, -nr_pages);
> > +		/*
> > +		 * This runs both with and without the lruvec lock held, and
> > +		 * mlock_drain_remote() reaches it fully preemptible, so use
> > +		 * the accessors that serialize themselves.
> 
> I'm very far from being a good advisor on PREEMPT_RT,
> but I think that comment about lruvec lock would be wrong there.

This change would eliminate the warning on !PREEMPT_RT and not cause any
further trouble for PREEMPT_RT.

Given that this it might mandate for

    WARN_ON_ONCE(IS_ENABLED(CONFIG_DEBUG_VM) &&
		!IS_ENABLED(CONFIG_PREEMPT_RT) &&
		!!irqs_disabled());

in __mod_zone_page_state() and other places where
preempt_disable_nested() was added. The counters do rely on disabled
interrupts not preemption.

> Hugh

Sebastian

  reply	other threads:[~2026-08-31 10:28 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-29 17:52 syzbot
2026-08-29 23:03 ` Shakeel Butt
2026-08-30  1:08   ` Shakeel Butt
2026-08-30  3:26     ` Hugh Dickins
2026-08-30  5:15       ` Shakeel Butt
2026-08-30 17:29         ` Hugh Dickins
2026-08-31 10:28           ` Sebastian Andrzej Siewior [this message]
2026-08-31 20:11           ` Shakeel Butt
2026-08-31 10:04       ` Sebastian Andrzej Siewior

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=20260831102855.TOx0U8Vi@linutronix.de \
    --to=bigeasy@linutronix.de \
    --cc=hughd@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=shakeel.butt@linux.dev \
    --cc=syzbot+cd2073ee6d958a8d0fcd@syzkaller.appspotmail.com \
    --cc=syzkaller-bugs@googlegroups.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®