* Re: [PATCH v4 3/6] mm: selftest to verify zero-filled pages are mapped to zeropage
@ 2024-08-21 7:09 kernel test robot
0 siblings, 0 replies; 4+ messages in thread
From: kernel test robot @ 2024-08-21 7:09 UTC (permalink / raw)
To: oe-kbuild; +Cc: lkp
::::::
:::::: Manual check reason: "low confidence bisect report"
::::::
BCC: lkp@intel.com
CC: oe-kbuild-all@lists.linux.dev
In-Reply-To: <20240819023145.2415299-4-usamaarif642@gmail.com>
References: <20240819023145.2415299-4-usamaarif642@gmail.com>
TO: Usama Arif <usamaarif642@gmail.com>
Hi Usama,
kernel test robot noticed the following build errors:
[auto build test ERROR on akpm-mm/mm-everything]
url: https://github.com/intel-lab-lkp/linux/commits/Usama-Arif/mm-free-zapped-tail-pages-when-splitting-isolated-thp/20240819-103336
base: https://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm.git mm-everything
patch link: https://lore.kernel.org/r/20240819023145.2415299-4-usamaarif642%40gmail.com
patch subject: [PATCH v4 3/6] mm: selftest to verify zero-filled pages are mapped to zeropage
:::::: branch date: 2 days ago
:::::: commit date: 2 days ago
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240821/202408211408.L2BFUig9-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/r/202408211408.L2BFUig9-lkp@intel.com/
All errors (new ones prefixed by >>):
>> vm_util.c:175:15: error: conflicting types for 'rss_anon'; have 'long unsigned int(void)'
175 | unsigned long rss_anon(void)
| ^~~~~~~~
In file included from vm_util.c:11:
vm_util.h:42:10: note: previous declaration of 'rss_anon' with type 'uint64_t(void)' {aka 'long long unsigned int(void)'}
42 | uint64_t rss_anon(void);
| ^~~~~~~~
vim +175 tools/testing/selftests/mm/vm_util.c
642bc52aed9c99e tools/testing/selftests/vm/vm_util.c Muhammad Usama Anjum 2022-04-28 174
10bf5ecc7e9d437 tools/testing/selftests/mm/vm_util.c Alexander Zhu 2024-08-19 @175 unsigned long rss_anon(void)
10bf5ecc7e9d437 tools/testing/selftests/mm/vm_util.c Alexander Zhu 2024-08-19 176 {
10bf5ecc7e9d437 tools/testing/selftests/mm/vm_util.c Alexander Zhu 2024-08-19 177 unsigned long rss_anon = 0;
10bf5ecc7e9d437 tools/testing/selftests/mm/vm_util.c Alexander Zhu 2024-08-19 178 FILE *fp;
10bf5ecc7e9d437 tools/testing/selftests/mm/vm_util.c Alexander Zhu 2024-08-19 179 char buffer[MAX_LINE_LENGTH];
10bf5ecc7e9d437 tools/testing/selftests/mm/vm_util.c Alexander Zhu 2024-08-19 180
10bf5ecc7e9d437 tools/testing/selftests/mm/vm_util.c Alexander Zhu 2024-08-19 181 fp = fopen(STATUS_FILE_PATH, "r");
10bf5ecc7e9d437 tools/testing/selftests/mm/vm_util.c Alexander Zhu 2024-08-19 182 if (!fp)
10bf5ecc7e9d437 tools/testing/selftests/mm/vm_util.c Alexander Zhu 2024-08-19 183 ksft_exit_fail_msg("%s: Failed to open file %s\n", __func__, STATUS_FILE_PATH);
10bf5ecc7e9d437 tools/testing/selftests/mm/vm_util.c Alexander Zhu 2024-08-19 184
10bf5ecc7e9d437 tools/testing/selftests/mm/vm_util.c Alexander Zhu 2024-08-19 185 if (!check_for_pattern(fp, "RssAnon:", buffer, sizeof(buffer)))
10bf5ecc7e9d437 tools/testing/selftests/mm/vm_util.c Alexander Zhu 2024-08-19 186 goto err_out;
10bf5ecc7e9d437 tools/testing/selftests/mm/vm_util.c Alexander Zhu 2024-08-19 187
10bf5ecc7e9d437 tools/testing/selftests/mm/vm_util.c Alexander Zhu 2024-08-19 188 if (sscanf(buffer, "RssAnon:%10lu kB", &rss_anon) != 1)
10bf5ecc7e9d437 tools/testing/selftests/mm/vm_util.c Alexander Zhu 2024-08-19 189 ksft_exit_fail_msg("Reading status error\n");
10bf5ecc7e9d437 tools/testing/selftests/mm/vm_util.c Alexander Zhu 2024-08-19 190
10bf5ecc7e9d437 tools/testing/selftests/mm/vm_util.c Alexander Zhu 2024-08-19 191 err_out:
10bf5ecc7e9d437 tools/testing/selftests/mm/vm_util.c Alexander Zhu 2024-08-19 192 fclose(fp);
10bf5ecc7e9d437 tools/testing/selftests/mm/vm_util.c Alexander Zhu 2024-08-19 193 return rss_anon;
10bf5ecc7e9d437 tools/testing/selftests/mm/vm_util.c Alexander Zhu 2024-08-19 194 }
10bf5ecc7e9d437 tools/testing/selftests/mm/vm_util.c Alexander Zhu 2024-08-19 195
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] 4+ messages in thread* [PATCH v4 0/6] mm: split underused THPs
@ 2024-08-19 2:30 Usama Arif
2024-08-19 2:30 ` [PATCH v4 3/6] mm: selftest to verify zero-filled pages are mapped to zeropage Usama Arif
0 siblings, 1 reply; 4+ messages in thread
From: Usama Arif @ 2024-08-19 2:30 UTC (permalink / raw)
To: akpm, linux-mm
Cc: hannes, riel, shakeel.butt, roman.gushchin, yuzhao, david, baohua,
ryan.roberts, rppt, willy, cerasuolodomenico, ryncsn, corbet,
linux-kernel, linux-doc, kernel-team, Usama Arif
The current upstream default policy for THP is always. However, Meta
uses madvise in production as the current THP=always policy vastly
overprovisions THPs in sparsely accessed memory areas, resulting in
excessive memory pressure and premature OOM killing.
Using madvise + relying on khugepaged has certain drawbacks over
THP=always. Using madvise hints mean THPs aren't "transparent" and
require userspace changes. Waiting for khugepaged to scan memory and
collapse pages into THP can be slow and unpredictable in terms of performance
(i.e. you dont know when the collapse will happen), while production
environments require predictable performance. If there is enough memory
available, its better for both performance and predictability to have
a THP from fault time, i.e. THP=always rather than wait for khugepaged
to collapse it, and deal with sparsely populated THPs when the system is
running out of memory.
This patch-series is an attempt to mitigate the issue of running out of
memory when THP is always enabled. During runtime whenever a THP is being
faulted in or collapsed by khugepaged, the THP is added to a list.
Whenever memory reclaim happens, the kernel runs the deferred_split
shrinker which goes through the list and checks if the THP was underused,
i.e. how many of the base 4K pages of the entire THP were zero-filled.
If this number goes above a certain threshold, the shrinker will attempt
to split that THP. Then at remap time, the pages that were zero-filled are
mapped to the shared zeropage, hence saving memory. This method avoids the
downside of wasting memory in areas where THP is sparsely filled when THP
is always enabled, while still providing the upside THPs like reduced TLB
misses without having to use madvise.
Meta production workloads that were CPU bound (>99% CPU utilzation) were
tested with THP shrinker. The results after 2 hours are as follows:
| THP=madvise | THP=always | THP=always
| | | + shrinker series
| | | + max_ptes_none=409
-----------------------------------------------------------------------------
Performance improvement | - | +1.8% | +1.7%
(over THP=madvise) | | |
-----------------------------------------------------------------------------
Memory usage | 54.6G | 58.8G (+7.7%) | 55.9G (+2.4%)
-----------------------------------------------------------------------------
max_ptes_none=409 means that any THP that has more than 409 out of 512
(80%) zero filled filled pages will be split.
To test out the patches, the below commands without the shrinker will
invoke OOM killer immediately and kill stress, but will not fail with
the shrinker:
echo 450 > /sys/kernel/mm/transparent_hugepage/khugepaged/max_ptes_none
mkdir /sys/fs/cgroup/test
echo $$ > /sys/fs/cgroup/test/cgroup.procs
echo 20M > /sys/fs/cgroup/test/memory.max
echo 0 > /sys/fs/cgroup/test/memory.swap.max
# allocate twice memory.max for each stress worker and touch 40/512 of
# each THP, i.e. vm-stride 50K.
# With the shrinker, max_ptes_none of 470 and below won't invoke OOM
# killer.
# Without the shrinker, OOM killer is invoked immediately irrespective
# of max_ptes_none value and kills stress.
stress --vm 1 --vm-bytes 40M --vm-stride 50K
v3 -> v4:
- do not clear partially_mapped flag on hugeTLB folios (Yu Zhao).
- fix condition for calling deferred_folio_split in partially mapped case
and count for partially mapped vm events (Barry Song).
- use non-atomic versions of set/clear partially_mapped flags
(David Hildenbrand)
- use PG_partially_mapped = PG_reclaim (Matthew Wilcox)
- delete folio from lru list and folio_batch_add "new_folio" instead
of folio in __split_huge_page. (Kairui Song)
- fix deadlock in deferred_split_scan by not doing folio_put while
holding split_queue_lock (Hugh Dickins)
- underutilized to underused and thp_low_util_shrinker to shrink_underused
(Hugh Dickins)
v2 -> v3:
- Use my_zero_pfn instead of page_to_pfn(ZERO_PAGE(..)) (Johannes)
- Use flags argument instead of bools in remove_migration_ptes (Johannes)
- Use a new flag in folio->_flags_1 instead of folio->_partially_mapped
(David Hildenbrand).
- Split out the last patch of v2 into 3, one for introducing the flag,
one for splitting underutilized THPs on _deferred_list and one for adding
sysfs entry to disable splitting (David Hildenbrand).
v1 -> v2:
- Turn page checks and operations to folio versions in __split_huge_page.
This means patches 1 and 2 from v1 are no longer needed.
(David Hildenbrand)
- Map to shared zeropage in all cases if the base page is zero-filled.
The uffd selftest was removed.
(David Hildenbrand).
- rename 'dirty' to 'contains_data' in try_to_map_unused_to_zeropage
(Rik van Riel).
- Use unsigned long instead of uint64_t (kernel test robot).
Alexander Zhu (1):
mm: selftest to verify zero-filled pages are mapped to zeropage
Usama Arif (3):
mm: Introduce a pageflag for partially mapped folios
mm: split underused THPs
mm: add sysfs entry to disable splitting underused THPs
Yu Zhao (2):
mm: free zapped tail pages when splitting isolated thp
mm: remap unused subpages to shared zeropage when splitting isolated
thp
Documentation/admin-guide/mm/transhuge.rst | 16 ++
include/linux/huge_mm.h | 4 +-
include/linux/khugepaged.h | 1 +
include/linux/page-flags.h | 11 ++
include/linux/rmap.h | 7 +-
include/linux/vm_event_item.h | 1 +
mm/huge_memory.c | 145 ++++++++++++++++--
mm/internal.h | 4 +-
mm/khugepaged.c | 3 +-
mm/memcontrol.c | 3 +-
mm/migrate.c | 75 +++++++--
mm/migrate_device.c | 4 +-
mm/page_alloc.c | 5 +-
mm/rmap.c | 5 +-
mm/vmscan.c | 3 +-
mm/vmstat.c | 1 +
.../selftests/mm/split_huge_page_test.c | 71 +++++++++
tools/testing/selftests/mm/vm_util.c | 22 +++
tools/testing/selftests/mm/vm_util.h | 1 +
19 files changed, 346 insertions(+), 36 deletions(-)
--
2.43.5
^ permalink raw reply [flat|nested] 4+ messages in thread* [PATCH v4 3/6] mm: selftest to verify zero-filled pages are mapped to zeropage 2024-08-19 2:30 [PATCH v4 0/6] mm: split underused THPs Usama Arif @ 2024-08-19 2:30 ` Usama Arif 2024-08-21 19:09 ` Usama Arif 2024-08-23 4:01 ` kernel test robot 0 siblings, 2 replies; 4+ messages in thread From: Usama Arif @ 2024-08-19 2:30 UTC (permalink / raw) To: akpm, linux-mm Cc: hannes, riel, shakeel.butt, roman.gushchin, yuzhao, david, baohua, ryan.roberts, rppt, willy, cerasuolodomenico, ryncsn, corbet, linux-kernel, linux-doc, kernel-team, Alexander Zhu, Usama Arif From: Alexander Zhu <alexlzhu@fb.com> When a THP is split, any subpage that is zero-filled will be mapped to the shared zeropage, hence saving memory. Add selftest to verify this by allocating zero-filled THP and comparing RssAnon before and after split. Signed-off-by: Alexander Zhu <alexlzhu@fb.com> Acked-by: Rik van Riel <riel@surriel.com> Signed-off-by: Usama Arif <usamaarif642@gmail.com> --- .../selftests/mm/split_huge_page_test.c | 71 +++++++++++++++++++ tools/testing/selftests/mm/vm_util.c | 22 ++++++ tools/testing/selftests/mm/vm_util.h | 1 + 3 files changed, 94 insertions(+) diff --git a/tools/testing/selftests/mm/split_huge_page_test.c b/tools/testing/selftests/mm/split_huge_page_test.c index e5e8dafc9d94..eb6d1b9fc362 100644 --- a/tools/testing/selftests/mm/split_huge_page_test.c +++ b/tools/testing/selftests/mm/split_huge_page_test.c @@ -84,6 +84,76 @@ static void write_debugfs(const char *fmt, ...) write_file(SPLIT_DEBUGFS, input, ret + 1); } +static char *allocate_zero_filled_hugepage(size_t len) +{ + char *result; + size_t i; + + result = memalign(pmd_pagesize, len); + if (!result) { + printf("Fail to allocate memory\n"); + exit(EXIT_FAILURE); + } + + madvise(result, len, MADV_HUGEPAGE); + + for (i = 0; i < len; i++) + result[i] = (char)0; + + return result; +} + +static void verify_rss_anon_split_huge_page_all_zeroes(char *one_page, int nr_hpages, size_t len) +{ + unsigned long rss_anon_before, rss_anon_after; + size_t i; + + if (!check_huge_anon(one_page, 4, pmd_pagesize)) { + printf("No THP is allocated\n"); + exit(EXIT_FAILURE); + } + + rss_anon_before = rss_anon(); + if (!rss_anon_before) { + printf("No RssAnon is allocated before split\n"); + exit(EXIT_FAILURE); + } + + /* split all THPs */ + write_debugfs(PID_FMT, getpid(), (uint64_t)one_page, + (uint64_t)one_page + len, 0); + + for (i = 0; i < len; i++) + if (one_page[i] != (char)0) { + printf("%ld byte corrupted\n", i); + exit(EXIT_FAILURE); + } + + if (!check_huge_anon(one_page, 0, pmd_pagesize)) { + printf("Still AnonHugePages not split\n"); + exit(EXIT_FAILURE); + } + + rss_anon_after = rss_anon(); + if (rss_anon_after >= rss_anon_before) { + printf("Incorrect RssAnon value. Before: %ld After: %ld\n", + rss_anon_before, rss_anon_after); + exit(EXIT_FAILURE); + } +} + +void split_pmd_zero_pages(void) +{ + char *one_page; + int nr_hpages = 4; + size_t len = nr_hpages * pmd_pagesize; + + one_page = allocate_zero_filled_hugepage(len); + verify_rss_anon_split_huge_page_all_zeroes(one_page, nr_hpages, len); + printf("Split zero filled huge pages successful\n"); + free(one_page); +} + void split_pmd_thp(void) { char *one_page; @@ -431,6 +501,7 @@ int main(int argc, char **argv) fd_size = 2 * pmd_pagesize; + split_pmd_zero_pages(); split_pmd_thp(); split_pte_mapped_thp(); split_file_backed_thp(); diff --git a/tools/testing/selftests/mm/vm_util.c b/tools/testing/selftests/mm/vm_util.c index 5a62530da3b5..d8d0cf04bb57 100644 --- a/tools/testing/selftests/mm/vm_util.c +++ b/tools/testing/selftests/mm/vm_util.c @@ -12,6 +12,7 @@ #define PMD_SIZE_FILE_PATH "/sys/kernel/mm/transparent_hugepage/hpage_pmd_size" #define SMAP_FILE_PATH "/proc/self/smaps" +#define STATUS_FILE_PATH "/proc/self/status" #define MAX_LINE_LENGTH 500 unsigned int __page_size; @@ -171,6 +172,27 @@ uint64_t read_pmd_pagesize(void) return strtoul(buf, NULL, 10); } +unsigned long rss_anon(void) +{ + unsigned long rss_anon = 0; + FILE *fp; + char buffer[MAX_LINE_LENGTH]; + + fp = fopen(STATUS_FILE_PATH, "r"); + if (!fp) + ksft_exit_fail_msg("%s: Failed to open file %s\n", __func__, STATUS_FILE_PATH); + + if (!check_for_pattern(fp, "RssAnon:", buffer, sizeof(buffer))) + goto err_out; + + if (sscanf(buffer, "RssAnon:%10lu kB", &rss_anon) != 1) + ksft_exit_fail_msg("Reading status error\n"); + +err_out: + fclose(fp); + return rss_anon; +} + bool __check_huge(void *addr, char *pattern, int nr_hpages, uint64_t hpage_size) { diff --git a/tools/testing/selftests/mm/vm_util.h b/tools/testing/selftests/mm/vm_util.h index 9007c420d52c..71b75429f4a5 100644 --- a/tools/testing/selftests/mm/vm_util.h +++ b/tools/testing/selftests/mm/vm_util.h @@ -39,6 +39,7 @@ unsigned long pagemap_get_pfn(int fd, char *start); void clear_softdirty(void); bool check_for_pattern(FILE *fp, const char *pattern, char *buf, size_t len); uint64_t read_pmd_pagesize(void); +uint64_t rss_anon(void); bool check_huge_anon(void *addr, int nr_hpages, uint64_t hpage_size); bool check_huge_file(void *addr, int nr_hpages, uint64_t hpage_size); bool check_huge_shmem(void *addr, int nr_hpages, uint64_t hpage_size); -- 2.43.5 ^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH v4 3/6] mm: selftest to verify zero-filled pages are mapped to zeropage 2024-08-19 2:30 ` [PATCH v4 3/6] mm: selftest to verify zero-filled pages are mapped to zeropage Usama Arif @ 2024-08-21 19:09 ` Usama Arif 2024-08-23 4:01 ` kernel test robot 1 sibling, 0 replies; 4+ messages in thread From: Usama Arif @ 2024-08-21 19:09 UTC (permalink / raw) To: akpm, linux-mm Cc: hannes, riel, shakeel.butt, roman.gushchin, yuzhao, david, baohua, ryan.roberts, rppt, willy, cerasuolodomenico, ryncsn, corbet, linux-kernel, linux-doc, kernel-team, Alexander Zhu On 18/08/2024 22:30, Usama Arif wrote: > From: Alexander Zhu <alexlzhu@fb.com> > > When a THP is split, any subpage that is zero-filled will be mapped > to the shared zeropage, hence saving memory. Add selftest to verify > this by allocating zero-filled THP and comparing RssAnon before and > after split. > > Signed-off-by: Alexander Zhu <alexlzhu@fb.com> > Acked-by: Rik van Riel <riel@surriel.com> > Signed-off-by: Usama Arif <usamaarif642@gmail.com> > --- > .../selftests/mm/split_huge_page_test.c | 71 +++++++++++++++++++ > tools/testing/selftests/mm/vm_util.c | 22 ++++++ > tools/testing/selftests/mm/vm_util.h | 1 + > 3 files changed, 94 insertions(+) > > diff --git a/tools/testing/selftests/mm/split_huge_page_test.c b/tools/testing/selftests/mm/split_huge_page_test.c > index e5e8dafc9d94..eb6d1b9fc362 100644 > --- a/tools/testing/selftests/mm/split_huge_page_test.c > +++ b/tools/testing/selftests/mm/split_huge_page_test.c > @@ -84,6 +84,76 @@ static void write_debugfs(const char *fmt, ...) > write_file(SPLIT_DEBUGFS, input, ret + 1); > } > > +static char *allocate_zero_filled_hugepage(size_t len) > +{ > + char *result; > + size_t i; > + > + result = memalign(pmd_pagesize, len); > + if (!result) { > + printf("Fail to allocate memory\n"); > + exit(EXIT_FAILURE); > + } > + > + madvise(result, len, MADV_HUGEPAGE); > + > + for (i = 0; i < len; i++) > + result[i] = (char)0; > + > + return result; > +} > + > +static void verify_rss_anon_split_huge_page_all_zeroes(char *one_page, int nr_hpages, size_t len) > +{ > + unsigned long rss_anon_before, rss_anon_after; > + size_t i; > + > + if (!check_huge_anon(one_page, 4, pmd_pagesize)) { > + printf("No THP is allocated\n"); > + exit(EXIT_FAILURE); > + } > + > + rss_anon_before = rss_anon(); > + if (!rss_anon_before) { > + printf("No RssAnon is allocated before split\n"); > + exit(EXIT_FAILURE); > + } > + > + /* split all THPs */ > + write_debugfs(PID_FMT, getpid(), (uint64_t)one_page, > + (uint64_t)one_page + len, 0); > + > + for (i = 0; i < len; i++) > + if (one_page[i] != (char)0) { > + printf("%ld byte corrupted\n", i); > + exit(EXIT_FAILURE); > + } > + > + if (!check_huge_anon(one_page, 0, pmd_pagesize)) { > + printf("Still AnonHugePages not split\n"); > + exit(EXIT_FAILURE); > + } > + > + rss_anon_after = rss_anon(); > + if (rss_anon_after >= rss_anon_before) { > + printf("Incorrect RssAnon value. Before: %ld After: %ld\n", > + rss_anon_before, rss_anon_after); > + exit(EXIT_FAILURE); > + } > +} > + > +void split_pmd_zero_pages(void) > +{ > + char *one_page; > + int nr_hpages = 4; > + size_t len = nr_hpages * pmd_pagesize; > + > + one_page = allocate_zero_filled_hugepage(len); > + verify_rss_anon_split_huge_page_all_zeroes(one_page, nr_hpages, len); > + printf("Split zero filled huge pages successful\n"); > + free(one_page); > +} > + > void split_pmd_thp(void) > { > char *one_page; > @@ -431,6 +501,7 @@ int main(int argc, char **argv) > > fd_size = 2 * pmd_pagesize; > > + split_pmd_zero_pages(); > split_pmd_thp(); > split_pte_mapped_thp(); > split_file_backed_thp(); > diff --git a/tools/testing/selftests/mm/vm_util.c b/tools/testing/selftests/mm/vm_util.c > index 5a62530da3b5..d8d0cf04bb57 100644 > --- a/tools/testing/selftests/mm/vm_util.c > +++ b/tools/testing/selftests/mm/vm_util.c > @@ -12,6 +12,7 @@ > > #define PMD_SIZE_FILE_PATH "/sys/kernel/mm/transparent_hugepage/hpage_pmd_size" > #define SMAP_FILE_PATH "/proc/self/smaps" > +#define STATUS_FILE_PATH "/proc/self/status" > #define MAX_LINE_LENGTH 500 > > unsigned int __page_size; > @@ -171,6 +172,27 @@ uint64_t read_pmd_pagesize(void) > return strtoul(buf, NULL, 10); > } > > +unsigned long rss_anon(void) > +{ > + unsigned long rss_anon = 0; > + FILE *fp; > + char buffer[MAX_LINE_LENGTH]; > + > + fp = fopen(STATUS_FILE_PATH, "r"); > + if (!fp) > + ksft_exit_fail_msg("%s: Failed to open file %s\n", __func__, STATUS_FILE_PATH); > + > + if (!check_for_pattern(fp, "RssAnon:", buffer, sizeof(buffer))) > + goto err_out; > + > + if (sscanf(buffer, "RssAnon:%10lu kB", &rss_anon) != 1) > + ksft_exit_fail_msg("Reading status error\n"); > + > +err_out: > + fclose(fp); > + return rss_anon; > +} > + > bool __check_huge(void *addr, char *pattern, int nr_hpages, > uint64_t hpage_size) > { > diff --git a/tools/testing/selftests/mm/vm_util.h b/tools/testing/selftests/mm/vm_util.h > index 9007c420d52c..71b75429f4a5 100644 > --- a/tools/testing/selftests/mm/vm_util.h > +++ b/tools/testing/selftests/mm/vm_util.h > @@ -39,6 +39,7 @@ unsigned long pagemap_get_pfn(int fd, char *start); > void clear_softdirty(void); > bool check_for_pattern(FILE *fp, const char *pattern, char *buf, size_t len); > uint64_t read_pmd_pagesize(void); > +uint64_t rss_anon(void); > bool check_huge_anon(void *addr, int nr_hpages, uint64_t hpage_size); > bool check_huge_file(void *addr, int nr_hpages, uint64_t hpage_size); > bool check_huge_shmem(void *addr, int nr_hpages, uint64_t hpage_size); Need below fixlet as well From 2476b7a46908c801ab446f41566f4af52b939ac7 Mon Sep 17 00:00:00 2001 From: Usama Arif <usamaarif642@gmail.com> Date: Wed, 21 Aug 2024 20:06:53 +0100 Subject: [PATCH] mm: selftest to verify zero-filled pages are mapped to zeropage fix change uint64_t to unsigned long for rss_anon Signed-off-by: Usama Arif <usamaarif642@gmail.com> --- tools/testing/selftests/mm/vm_util.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/testing/selftests/mm/vm_util.h b/tools/testing/selftests/mm/vm_util.h index 71b75429f4a5..2eaed8209925 100644 --- a/tools/testing/selftests/mm/vm_util.h +++ b/tools/testing/selftests/mm/vm_util.h @@ -39,7 +39,7 @@ unsigned long pagemap_get_pfn(int fd, char *start); void clear_softdirty(void); bool check_for_pattern(FILE *fp, const char *pattern, char *buf, size_t len); uint64_t read_pmd_pagesize(void); -uint64_t rss_anon(void); +unsigned long rss_anon(void); bool check_huge_anon(void *addr, int nr_hpages, uint64_t hpage_size); bool check_huge_file(void *addr, int nr_hpages, uint64_t hpage_size); bool check_huge_shmem(void *addr, int nr_hpages, uint64_t hpage_size); -- 2.43.5 ^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH v4 3/6] mm: selftest to verify zero-filled pages are mapped to zeropage 2024-08-19 2:30 ` [PATCH v4 3/6] mm: selftest to verify zero-filled pages are mapped to zeropage Usama Arif 2024-08-21 19:09 ` Usama Arif @ 2024-08-23 4:01 ` kernel test robot 1 sibling, 0 replies; 4+ messages in thread From: kernel test robot @ 2024-08-23 4:01 UTC (permalink / raw) To: Usama Arif; +Cc: oe-kbuild-all Hi Usama, kernel test robot noticed the following build errors: [auto build test ERROR on akpm-mm/mm-everything] url: https://github.com/intel-lab-lkp/linux/commits/Usama-Arif/mm-free-zapped-tail-pages-when-splitting-isolated-thp/20240819-103336 base: https://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm.git mm-everything patch link: https://lore.kernel.org/r/20240819023145.2415299-4-usamaarif642%40gmail.com patch subject: [PATCH v4 3/6] mm: selftest to verify zero-filled pages are mapped to zeropage :::::: branch date: 2 days ago :::::: commit date: 2 days ago compiler: gcc-12 (Debian 12.2.0-14) 12.2.0 reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240821/202408211408.L2BFUig9-lkp@intel.com/reproduce) If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags | Reported-by: kernel test robot <lkp@intel.com> | Closes: https://lore.kernel.org/r/202408211408.L2BFUig9-lkp@intel.com/ All errors (new ones prefixed by >>): >> vm_util.c:175:15: error: conflicting types for 'rss_anon'; have 'long unsigned int(void)' 175 | unsigned long rss_anon(void) | ^~~~~~~~ In file included from vm_util.c:11: vm_util.h:42:10: note: previous declaration of 'rss_anon' with type 'uint64_t(void)' {aka 'long long unsigned int(void)'} 42 | uint64_t rss_anon(void); | ^~~~~~~~ vim +175 tools/testing/selftests/mm/vm_util.c 642bc52aed9c99e tools/testing/selftests/vm/vm_util.c Muhammad Usama Anjum 2022-04-28 174 10bf5ecc7e9d437 tools/testing/selftests/mm/vm_util.c Alexander Zhu 2024-08-19 @175 unsigned long rss_anon(void) 10bf5ecc7e9d437 tools/testing/selftests/mm/vm_util.c Alexander Zhu 2024-08-19 176 { 10bf5ecc7e9d437 tools/testing/selftests/mm/vm_util.c Alexander Zhu 2024-08-19 177 unsigned long rss_anon = 0; 10bf5ecc7e9d437 tools/testing/selftests/mm/vm_util.c Alexander Zhu 2024-08-19 178 FILE *fp; 10bf5ecc7e9d437 tools/testing/selftests/mm/vm_util.c Alexander Zhu 2024-08-19 179 char buffer[MAX_LINE_LENGTH]; 10bf5ecc7e9d437 tools/testing/selftests/mm/vm_util.c Alexander Zhu 2024-08-19 180 10bf5ecc7e9d437 tools/testing/selftests/mm/vm_util.c Alexander Zhu 2024-08-19 181 fp = fopen(STATUS_FILE_PATH, "r"); 10bf5ecc7e9d437 tools/testing/selftests/mm/vm_util.c Alexander Zhu 2024-08-19 182 if (!fp) 10bf5ecc7e9d437 tools/testing/selftests/mm/vm_util.c Alexander Zhu 2024-08-19 183 ksft_exit_fail_msg("%s: Failed to open file %s\n", __func__, STATUS_FILE_PATH); 10bf5ecc7e9d437 tools/testing/selftests/mm/vm_util.c Alexander Zhu 2024-08-19 184 10bf5ecc7e9d437 tools/testing/selftests/mm/vm_util.c Alexander Zhu 2024-08-19 185 if (!check_for_pattern(fp, "RssAnon:", buffer, sizeof(buffer))) 10bf5ecc7e9d437 tools/testing/selftests/mm/vm_util.c Alexander Zhu 2024-08-19 186 goto err_out; 10bf5ecc7e9d437 tools/testing/selftests/mm/vm_util.c Alexander Zhu 2024-08-19 187 10bf5ecc7e9d437 tools/testing/selftests/mm/vm_util.c Alexander Zhu 2024-08-19 188 if (sscanf(buffer, "RssAnon:%10lu kB", &rss_anon) != 1) 10bf5ecc7e9d437 tools/testing/selftests/mm/vm_util.c Alexander Zhu 2024-08-19 189 ksft_exit_fail_msg("Reading status error\n"); 10bf5ecc7e9d437 tools/testing/selftests/mm/vm_util.c Alexander Zhu 2024-08-19 190 10bf5ecc7e9d437 tools/testing/selftests/mm/vm_util.c Alexander Zhu 2024-08-19 191 err_out: 10bf5ecc7e9d437 tools/testing/selftests/mm/vm_util.c Alexander Zhu 2024-08-19 192 fclose(fp); 10bf5ecc7e9d437 tools/testing/selftests/mm/vm_util.c Alexander Zhu 2024-08-19 193 return rss_anon; 10bf5ecc7e9d437 tools/testing/selftests/mm/vm_util.c Alexander Zhu 2024-08-19 194 } 10bf5ecc7e9d437 tools/testing/selftests/mm/vm_util.c Alexander Zhu 2024-08-19 195 -- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2024-08-23 4:03 UTC | newest] Thread overview: 4+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2024-08-21 7:09 [PATCH v4 3/6] mm: selftest to verify zero-filled pages are mapped to zeropage kernel test robot -- strict thread matches above, loose matches on Subject: below -- 2024-08-19 2:30 [PATCH v4 0/6] mm: split underused THPs Usama Arif 2024-08-19 2:30 ` [PATCH v4 3/6] mm: selftest to verify zero-filled pages are mapped to zeropage Usama Arif 2024-08-21 19:09 ` Usama Arif 2024-08-23 4:01 ` kernel test robot
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.