From: Sasha Levin <sashal@kernel.org>
To: stable@vger.kernel.org
Cc: Sasha Levin <sashal@kernel.org>,
syzbot+16bf7cd0ebeb1de93aa5@syzkaller.appspotmail.com,
Lance Yang <lance.yang@linux.dev>,
Pedro Falcato <pfalcato@suse.de>,
"David Hildenbrand (Arm)" <david@kernel.org>,
Zi Yan <ziy@nvidia.com>,
Baolin Wang <baolin.wang@linux.alibaba.com>
Subject: Re: [PATCH 6.1.y v2] khugepaged: fix readahead lock inversion in collapse_file()
Date: Sun, 29 Nov 2026 13:59:53 -0500 [thread overview]
Message-ID: <2026-11-28-1-daily-reply-0026@kernel.org> (raw)
In-Reply-To: <20261127081556.31348-1-lance.yang@linux.dev>
> We need to release those folio locks before starting readahead. On a page
> cache miss, roll back first, populate the collapse range, and retry once.
Both the 6.1 and the 5.15 backport retry with the same huge page
("goto retry") after collapse_file() has already inserted it into the
page cache. These trees lack a2e17cc2efc7 ("mm/khugepaged: maintain
page cache uptodate flag"), which keeps the new page out of the page
cache until the collapse succeeds. So a racing lookup can hold a
reference to the locked, not-uptodate page and wait on its lock; the
rollback unlock_page() can hand it the lock, and the retry then
re-locks the page with __SetPageLocked() and sets ->mapping again. Two
tasks then hold PG_locked, or a waiter treats the not-uptodate THP as a
normal page cache page. This is from reading the code, not reproduced.
Could you respin: either free the huge page and allocate a fresh one
before retrying, or do the readahead after the rollback and return
SCAN_FAIL without a retry?
--
Thanks,
Sasha
prev parent reply other threads:[~2026-11-29 19:00 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-10 1:18 FAILED: patch "[PATCH] khugepaged: fix readahead lock inversion in collapse_file()" failed to apply to 6.1-stable tree Sasha Levin
2026-11-11 13:25 ` [PATCH 6.1.y] khugepaged: fix readahead lock inversion in collapse_file() Lance Yang
2026-11-26 14:18 ` Greg KH
2026-11-27 8:20 ` Lance Yang
2026-11-27 8:15 ` [PATCH 6.1.y v2] " Lance Yang
2026-11-29 18:59 ` Sasha Levin [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=2026-11-28-1-daily-reply-0026@kernel.org \
--to=sashal@kernel.org \
--cc=baolin.wang@linux.alibaba.com \
--cc=david@kernel.org \
--cc=lance.yang@linux.dev \
--cc=pfalcato@suse.de \
--cc=stable@vger.kernel.org \
--cc=syzbot+16bf7cd0ebeb1de93aa5@syzkaller.appspotmail.com \
--cc=ziy@nvidia.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