From: Andrew Morton <akpm@linux-foundation.org>
To: Dmitry Ilvokhin <d@ilvokhin.com>
Cc: Shakeel Butt <shakeel.butt@linux.dev>,
Kemeng Shi <shikemeng@huaweicloud.com>,
Kairui Song <kasong@tencent.com>, Nhat Pham <nphamcs@gmail.com>,
Baoquan He <bhe@redhat.com>, Barry Song <baohua@kernel.org>,
Chris Li <chrisl@kernel.org>,
Axel Rasmussen <axelrasmussen@google.com>,
Yuanchu Xie <yuanchu@google.com>, Wei Xu <weixugc@google.com>,
Kiryl Shutsemau <kas@kernel.org>,
Usama Arif <usamaarif642@gmail.com>,
linux-mm@kvack.org, linux-kernel@vger.kernel.org,
kernel-team@meta.com, hughd@google.com, yangge1116@126.com,
david@redhat.com
Subject: Re: [PATCH v2] mm: skip folio_activate() for mlocked folios
Date: Wed, 15 Oct 2025 12:59:11 -0700 [thread overview]
Message-ID: <20251015125911.0f0ebf87b278324667c4dfc5@linux-foundation.org> (raw)
In-Reply-To: <aOaoD0HQk7YPeLkE@shell.ilvokhin.com>
On Wed, 8 Oct 2025 18:06:07 +0000 Dmitry Ilvokhin <d@ilvokhin.com> wrote:
> > > + * They might be still in mlock_fbatch waiting to be processed
> > > + * and activating it here might interfere with
> > > + * mlock_folio_batch(). __mlock_folio() will fail
> > > + * folio_test_clear_lru() check and give up. It happens because
> > > + * __folio_batch_add_and_move() clears LRU flag, when adding
> > > + * folio to activate batch.
> > > + */
> >
> > This makes sense as activating an mlocked folio should be a noop but I
> > am wondering why we are seeing this now. By this, I mean mlock()ed
> > memory being delayed to get to unevictable LRU. Also I remember Hugh
> > recently [1] removed the difference betwen mlock percpu cache and other
> > percpu caches of clearing LRU bit on entry. Does you repro work even
> > with Hugh's changes or without it?
> >
>
> Thanks Shakeel for mentioning Hugh's patch, I was not aware of it.
> Indeed, I could not reproduce problem on top of Hugh's patch anymore,
> which totally make sense, because folio_test_clear_lru() is gone from
> __folio_batch_add_and_move().
>
> Now I wonder does folio_test_mlocked() check still make sense in the
> current codebase?
>
> > [1] https://lore.kernel.org/all/05905d7b-ed14-68b1-79d8-bdec30367eba@google.com/
So I take it that this patch ("mm: skip folio_activate() for mlocked
folios") is no longer needed?
next prev parent reply other threads:[~2025-10-15 19:59 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-06 13:25 Dmitry Ilvokhin
2025-10-07 16:26 ` Nhat Pham
2025-10-07 19:53 ` SeongJae Park
2025-10-08 10:33 ` Kiryl Shutsemau
2025-10-08 16:29 ` SeongJae Park
2025-10-08 16:17 ` Shakeel Butt
2025-10-08 18:06 ` Dmitry Ilvokhin
2025-10-15 19:59 ` Andrew Morton [this message]
2025-10-15 20:09 ` Dmitry Ilvokhin
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=20251015125911.0f0ebf87b278324667c4dfc5@linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=axelrasmussen@google.com \
--cc=baohua@kernel.org \
--cc=bhe@redhat.com \
--cc=chrisl@kernel.org \
--cc=d@ilvokhin.com \
--cc=david@redhat.com \
--cc=hughd@google.com \
--cc=kas@kernel.org \
--cc=kasong@tencent.com \
--cc=kernel-team@meta.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=nphamcs@gmail.com \
--cc=shakeel.butt@linux.dev \
--cc=shikemeng@huaweicloud.com \
--cc=usamaarif642@gmail.com \
--cc=weixugc@google.com \
--cc=yangge1116@126.com \
--cc=yuanchu@google.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