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] [day] [month] [year] [list]
Message-ID: <1E11B9DD-3A87-4C9C-8FB4-E1324FB6A21A@nvidia.com>
Date: Thu, 13 Mar 2025 10:08:11 -0400
From: Zi Yan <ziy@...dia.com>
To: Andrew Morton <akpm@...ux-foundation.org>
Cc: Hugh Dickins <hughd@...gle.com>,
 "Matthew Wilcox (Oracle)" <willy@...radead.org>, linux-mm@...ck.org,
 Ryan Roberts <ryan.roberts@....com>,
 "Kirill A . Shutemov" <kirill.shutemov@...ux.intel.com>,
 David Hildenbrand <david@...hat.com>, Yang Shi <yang@...amperecomputing.com>,
 Miaohe Lin <linmiaohe@...wei.com>, Kefeng Wang <wangkefeng.wang@...wei.com>,
 Yu Zhao <yuzhao@...gle.com>, John Hubbard <jhubbard@...dia.com>,
 Baolin Wang <baolin.wang@...ux.alibaba.com>, linux-kselftest@...r.kernel.org,
 linux-kernel@...r.kernel.org, Zi Yan <ziy@...dia.com>,
 Kairui Song <kasong@...cent.com>
Subject: Re: [PATCH v10 2/8] mm/huge_memory: add two new (not yet used)
 functions for folio_split()

On 10 Mar 2025, at 13:32, Zi Yan wrote:

> On 10 Mar 2025, at 12:14, Zi Yan wrote:
>
>> On 7 Mar 2025, at 12:39, Zi Yan wrote:
>>
>>> This is a preparation patch, both added functions are not used yet.
>>>
>>> The added __split_unmapped_folio() is able to split a folio with its
>>> mapping removed in two manners: 1) uniform split (the existing way), and
>>> 2) buddy allocator like (or non-uniform) split.
>>>
>>> The added __split_folio_to_order() can split a folio into any lower order.
>>> For uniform split, __split_unmapped_folio() calls it once to split the
>>> given folio to the new order. For buddy allocator like (non-uniform)
>>> split, __split_unmapped_folio() calls it (folio_order - new_order) times
>>> and each time splits the folio containing the given page to one lower
>>> order.
>>>
>>> Signed-off-by: Zi Yan <ziy@...dia.com>
>>> Cc: Baolin Wang <baolin.wang@...ux.alibaba.com>
>>> Cc: David Hildenbrand <david@...hat.com>
>>> Cc: Hugh Dickins <hughd@...gle.com>
>>> Cc: John Hubbard <jhubbard@...dia.com>
>>> Cc: Kefeng Wang <wangkefeng.wang@...wei.com>
>>> Cc: Kirill A. Shuemov <kirill.shutemov@...ux.intel.com>
>>> Cc: Matthew Wilcox <willy@...radead.org>
>>> Cc: Miaohe Lin <linmiaohe@...wei.com>
>>> Cc: Ryan Roberts <ryan.roberts@....com>
>>> Cc: Yang Shi <yang@...amperecomputing.com>
>>> Cc: Yu Zhao <yuzhao@...gle.com>
>>> Cc: Kairui Song <kasong@...cent.com>
>>> ---
>>>  mm/huge_memory.c | 348 ++++++++++++++++++++++++++++++++++++++++++++++-
>>>  1 file changed, 347 insertions(+), 1 deletion(-)
>>
>> Hi Andrew,
>>
>> The patch below should fix the issues discovered by Hugh. Please fold
>> it into this patch. Thank you for all the help.
>>
>
> Hi Andrew,
>
> This is the updated version including:
> 1. Hugh’s fix on unfreezing head folio correctly,
> 2. Hugh’s fix on drop the right number of refs on tail folio,
> 3. Matthew’s suggestion on using new_folio instead of new_head and
> using i instead of index.
>

Hi Andrew,

The fixup below should get rid of the sparse warning.

>From 83472fe89330a262facba427051426e8cd13e218 Mon Sep 17 00:00:00 2001
From: Zi Yan <ziy@...dia.com>
Date: Thu, 13 Mar 2025 10:04:20 -0400
Subject: [PATCH] mm/huge_memory: use NULL instead of 0 for folio->private
 assignment.

It makes sparse happy.

Reported-by: kernel test robot <lkp@...el.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202503131109.s7iuWfGq-lkp@intel.com/
Signed-off-by: Zi Yan <ziy@...dia.com>
---
 mm/huge_memory.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/huge_memory.c b/mm/huge_memory.c
index 14b1963898a7..e3ed8e9523f5 100644
--- a/mm/huge_memory.c
+++ b/mm/huge_memory.c
@@ -3369,7 +3369,7 @@ static void __split_folio_to_order(struct folio *folio, int old_order,
 		 */
 		if (unlikely(new_folio->private)) {
 			VM_WARN_ON_ONCE_PAGE(true, new_head);
-			new_folio->private = 0;
+			new_folio->private = NULL;
 		}

 		if (folio_test_swapcache(folio))
-- 
2.47.2



Best Regards,
Yan, Zi

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ