LKML Archive on lore.kernel.org help / color / mirror / Atom feed
From: Matthew Wilcox <email@example.com> To: Marek Szyprowski <firstname.lastname@example.org> Cc: email@example.com, firstname.lastname@example.org, "Andrew Morton" <email@example.com>, 김성훈 <firstname.lastname@example.org>, "Song Liu" <email@example.com>, "Rik van Riel" <firstname.lastname@example.org>, "Kirill A . Shutemov" <email@example.com>, "Johannes Weiner" <firstname.lastname@example.org>, "Hillf Danton" <email@example.com>, "Hugh Dickins" <firstname.lastname@example.org>, "William Kucharski" <email@example.com>, "Oleg Nesterov" <firstname.lastname@example.org>, "Yang Shi" <email@example.com> Subject: Re: [PATCH] mm/thp: decrease nr_thps in file's mapping on THP split Date: Wed, 13 Oct 2021 13:01:40 +0100 [thread overview] Message-ID: <YWbKpH3vroAF7yw4@casper.infradead.org> (raw) In-Reply-To: <firstname.lastname@example.org> On Wed, Oct 13, 2021 at 12:47:03PM +0200, Marek Szyprowski wrote: > On 12.10.2021 14:43, Matthew Wilcox wrote: > > On Tue, Oct 12, 2021 at 02:02:37PM +0200, Marek Szyprowski wrote: > >> Decrease nr_thps counter in file's mapping to ensure that the page cache > >> won't be dropped excessively on file write access if page has been > >> already splitted. > >> > >> Signed-off-by: Marek Szyprowski <email@example.com> > >> Fixes: 09d91cda0e82 ("mm,thp: avoid writes to file with THP in pagecache") > >> Fixes: 06d3eff62d9d ("mm/thp: fix node page state in split_huge_page_to_list()") > >> --- > >> I've analyzed the code a few times but either I missed something or the > >> nr_thps counter is not decremented during the THP split on non-shmem file > >> pages. > > This looks OK to me, but have you tested it? If so, what workload did > > you use? The way you wrote this changelog makes it sound like you only > > read the code and there have been rather too many bugs introduced recently > > that way :-( > > Well, indeed I've found it while reading the code. However I've just > tried a test scenario, where one runs a big binary, kernel remaps it > with THPs, then one forces THP split with > /sys/kernel/debug/split_huge_pages. During any further open of that > binary with O_RDWR or O_WRITEONLY kernel drops page cache for it, > because of non-zero thps counter. ... and with this patch, it no longer happens? Good enough for me! Acked-by: Matthew Wilcox (Oracle) <firstname.lastname@example.org>
next prev parent reply other threads:[~2021-10-13 12:03 UTC|newest] Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top [not found] <CGME20211012120247eucas1p1f66926c6fc334216cdbdd39285601aa8@eucas1p1.samsung.com> 2021-10-12 12:02 ` [PATCH] mm/thp: decrease nr_thps in file's mapping on THP split Marek Szyprowski 2021-10-12 12:43 ` Matthew Wilcox 2021-10-13 10:47 ` Marek Szyprowski 2021-10-13 12:01 ` Matthew Wilcox [this message] 2021-10-13 21:44 ` Yang Shi
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=YWbKpH3vroAF7yw4@casper.infradead.org \ --email@example.com \ --firstname.lastname@example.org \ --email@example.com \ --firstname.lastname@example.org \ --email@example.com \ --firstname.lastname@example.org \ --email@example.com \ --firstname.lastname@example.org \ --email@example.com \ --firstname.lastname@example.org \ --email@example.com \ --firstname.lastname@example.org \ --email@example.com \ --firstname.lastname@example.org \ --email@example.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: linkBe 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).