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: Tue, 13 Feb 2024 17:19:37 -0500
From: Zi Yan <ziy@...dia.com>
To: Luis Chamberlain <mcgrof@...nel.org>
Cc: "\"Pankaj Raghav (Samsung)\"" <kernel@...kajraghav.com>,
 linux-mm@...ck.org, "\"Matthew Wilcox (Oracle)\"" <willy@...radead.org>,
 David Hildenbrand <david@...hat.com>, Yang Shi <shy828301@...il.com>,
 Yu Zhao <yuzhao@...gle.com>,
 "\"Kirill A . Shutemov\"" <kirill.shutemov@...ux.intel.com>,
 Ryan Roberts <ryan.roberts@....com>,
 "Michal Koutný" <mkoutny@...e.com>,
 Roman Gushchin <roman.gushchin@...ux.dev>,
 "\"Zach O'Keefe\"" <zokeefe@...gle.com>, Hugh Dickins <hughd@...gle.com>,
 Andrew Morton <akpm@...ux-foundation.org>, linux-kernel@...r.kernel.org,
 cgroups@...r.kernel.org, linux-fsdevel@...r.kernel.org,
 linux-kselftest@...r.kernel.org
Subject: Re: [PATCH v4 5/7] mm: thp: split huge page to any lower order pages
 (except order-1).

On 13 Feb 2024, at 17:15, Zi Yan wrote:

> On 13 Feb 2024, at 17:05, Luis Chamberlain wrote:
>
>> On Tue, Feb 13, 2024 at 04:55:18PM -0500, Zi Yan wrote:
>>> From: Zi Yan <ziy@...dia.com>
>>> Order-1 folio is not supported because _deferred_list, which is used by
>>> partially mapped folios, is stored in subpage 2 and an order-1 folio only
>>> has subpage 0 and 1.
>>
>> The LBS patches has the patch from Matthew which enables and allowed us
>> to successfully test order 1. So this restriction could be dropped if
>> that gets merged.
>
> OK. But it only applies to file-backed folios IIUC. Anonymous folios still
> cannot be split to order-1.

Something like this would lift the restriction:

diff --git a/mm/huge_memory.c b/mm/huge_memory.c
index 0564b007cbd1..7ee7f1906617 100644
--- a/mm/huge_memory.c
+++ b/mm/huge_memory.c
@@ -3045,9 +3045,9 @@ int split_huge_page_to_list_to_order(struct page *page, struct list_head *list,
        VM_BUG_ON_FOLIO(!folio_test_locked(folio), folio);
        VM_BUG_ON_FOLIO(!folio_test_large(folio), folio);

-       /* Cannot split THP to order-1 (no order-1 THPs) */
-       if (new_order == 1) {
-               VM_WARN_ONCE(1, "Cannot split to order-1 folio");
+       /* Cannot split anonymous folios to order-1 (no order-1 anon folios) */
+       if (new_order == 1 && folio_test_anon(folio)) {
+               VM_WARN_ONCE(1, "Cannot split to order-1 anonymous folio");
                return -EINVAL;
        }

--
Best Regards,
Yan, Zi

Download attachment "signature.asc" of type "application/pgp-signature" (855 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ