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]
Message-Id: <20240411014636.14023-1-21cnbao@gmail.com>
Date: Thu, 11 Apr 2024 13:46:36 +1200
From: Barry Song <21cnbao@...il.com>
To: sj@...nel.org
Cc: 21cnbao@...il.com,
	akpm@...ux-foundation.org,
	baolin.wang@...ux.alibaba.com,
	chrisl@...nel.org,
	david@...hat.com,
	hanchuanhua@...o.com,
	hannes@...xchg.org,
	hughd@...gle.com,
	kasong@...cent.com,
	linux-kernel@...r.kernel.org,
	linux-mm@...ck.org,
	ryan.roberts@....com,
	surenb@...gle.com,
	v-songbaohua@...o.com,
	willy@...radead.org,
	xiang@...nel.org,
	ying.huang@...el.com,
	yosryahmed@...gle.com,
	yuzhao@...gle.com,
	ziy@...dia.com
Subject: Re: [PATCH v2 5/5] mm: add per-order mTHP swpin_refault counter

>> +		count_mthp_stat(folio_order(folio), MTHP_STAT_ANON_SWPIN_REFAULT);
>>  	}
>> 
> From the latest mm-unstable tree, I get below kunit build failure and
> 'git bisect' points this patch.
> 
>     $ ./tools/testing/kunit/kunit.py run --build_dir ../kunit.out/
>     [16:07:40] Configuring KUnit Kernel ...
>     [16:07:40] Building KUnit Kernel ...
>     Populating config with:
>     $ make ARCH=um O=../kunit.out/ olddefconfig
>     Building with:
>     $ make ARCH=um O=../kunit.out/ --jobs=36
>     ERROR:root:.../mm/memory.c: In function ‘do_swap_page’:
>     .../mm/memory.c:4169:17: error: implicit declaration of function ‘count_mthp_stat’ [-Werror=implicit-function-declaration]
>      4169 |                 count_mthp_stat(folio_order(folio), MTHP_STAT_ANON_SWPIN_REFAULT);
>           |                 ^~~~~~~~~~~~~~~
>     .../mm/memory.c:4169:53: error: ‘MTHP_STAT_ANON_SWPIN_REFAULT’ undeclared (first use in this function)
>      4169 |                 count_mthp_stat(folio_order(folio), MTHP_STAT_ANON_SWPIN_REFAULT);
>           |                                                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
>     .../mm/memory.c:4169:53: note: each undeclared identifier is reported only once for each function it appears in
>     cc1: some warnings being treated as errors
> 
> My kunit build config doesn't have CONFIG_TRANSPARE_HUGEPAGE.  Maybe that's the
> reason and this patch, or the patch that introduced the function and the enum
> need to take care of the case?

Hi SeongJae,
Thanks very much, can you check if the below fix the build? If yes, I will
include this fix while sending v3.

Subject: [PATCH] mm: fix build errors on CONFIG_TRANSPARENT_HUGEPAGE=N

Signed-off-by: Barry Song <v-songbaohua@...o.com>
---
 mm/memory.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/mm/memory.c b/mm/memory.c
index acc023795a4d..1d587d1eb432 100644
--- a/mm/memory.c
+++ b/mm/memory.c
@@ -4142,6 +4142,7 @@ vm_fault_t do_swap_page(struct vm_fault *vmf)
 	vmf->pte = pte_offset_map_lock(vma->vm_mm, vmf->pmd, vmf->address,
 			&vmf->ptl);
 
+#ifdef CONFIG_TRANSPARENT_HUGEPAGE
 	/* We hit large folios in swapcache */
 	if (start_pte && folio_test_large(folio) && folio_test_swapcache(folio)) {
 		int nr = folio_nr_pages(folio);
@@ -4171,6 +4172,7 @@ vm_fault_t do_swap_page(struct vm_fault *vmf)
 	}
 
 check_pte:
+#endif
 	if (unlikely(!vmf->pte || !pte_same(ptep_get(vmf->pte), vmf->orig_pte)))
 		goto out_nomap;
 
-- 
2.34.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ