lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 13 Oct 2021 12:47:03 +0200
From:   Marek Szyprowski <m.szyprowski@...sung.com>
To:     Matthew Wilcox <willy@...radead.org>
Cc:     linux-mm@...ck.org, linux-kernel@...r.kernel.org,
        Andrew Morton <akpm@...ux-foundation.org>,
        김성훈 <sfoon.kim@...sung.com>,
        Song Liu <songliubraving@...com>,
        Rik van Riel <riel@...riel.com>,
        "Kirill A . Shutemov" <kirill.shutemov@...ux.intel.com>,
        Johannes Weiner <hannes@...xchg.org>,
        Hillf Danton <hdanton@...a.com>,
        Hugh Dickins <hughd@...gle.com>,
        William Kucharski <william.kucharski@...cle.com>,
        Oleg Nesterov <oleg@...hat.com>,
        Yang Shi <yang.shi@...ux.alibaba.com>
Subject: Re: [PATCH] mm/thp: decrease nr_thps in file's mapping on THP split

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 <m.szyprowski@...sung.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.

Best regards
-- 
Marek Szyprowski, PhD
Samsung R&D Institute Poland

Powered by blists - more mailing lists