Sign In
Sign Up
Search is temporarily disabled. See
ticket
for more info.
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2024
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
List overview
Download
kexec
June 2024
----- 2024 -----
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
kexec@lists.fedoraproject.org
3 participants
2 discussions
Start a n
N
ew thread
[PATCH v2] Release: 2.0.28-10
by Lianbo Jiang
21 Jun '24
21 Jun '24
Signed-off-by: Lianbo Jiang <lijiang(a)redhat.com> --- Scratch build:
https://koji.fedoraproject.org/koji/taskinfo?taskID=119232649
...e-of-hugetlb-pages-exclusion-on-Linu.patch | 107 ++++++++++++++ ...exclusion-of-Slab-pages-on-Linux-6.1.patch | 137 ++++++++++++++++++ kexec-tools.spec | 10 +- 3 files changed, 253 insertions(+), 1 deletion(-) create mode 100644 kexec-tools-2.0.28-makedumfpile-0001-PATCH-Fix-failure-of-hugetlb-pages-exclusion-on-Linu.patch create mode 100644 kexec-tools-2.0.28-makedumfpile-0002-PATCH-Fix-wrong-exclusion-of-Slab-pages-on-Linux-6.1.patch diff --git a/kexec-tools-2.0.28-makedumfpile-0001-PATCH-Fix-failure-of-hugetlb-pages-exclusion-on-Linu.patch b/kexec-tools-2.0.28-makedumfpile-0001-PATCH-Fix-failure-of-hugetlb-pages-exclusion-on-Linu.patch new file mode 100644 index 000000000000..5710f213f96d --- /dev/null +++ b/kexec-tools-2.0.28-makedumfpile-0001-PATCH-Fix-failure-of-hugetlb-pages-exclusion-on-Linu.patch @@ -0,0 +1,107 @@ +From 985e575253f1c2de8d6876cfe685c68a24ee06e1 Mon Sep 17 00:00:00 2001 +From: Kazuhito Hagio <k-hagio-ab(a)nec.com> +Date: Thu, 30 May 2024 16:59:02 +0900 +Subject: [PATCH 1/2] [PATCH] Fix failure of hugetlb pages exclusion on Linux + 6.9 and later + + commit 985e575253f1c2de8d6876cfe685c68a24ee06e1 + Author: Kazuhito Hagio <k-hagio-ab(a)nec.com> + Date: Thu May 30 16:59:02 2024 +0900 + + [PATCH] Fix failure of hugetlb pages exclusion on Linux 6.9 and later + + * Required for kernel 6.9 + + Kernel commit d99e3140a4d3 ("mm: turn folio_test_hugetlb into a + PageType") moved the PG_hugetlb flag from folio._flags_1 into + page._mapcount and introduced NUMBER(PAGE_HUGETLB_MAPCOUNT_VALUE) entry + into vmcoreinfo. + + Without the patch, "makedumpfile -d 8" cannot exclude hugetlb pages. + + Signed-off-by: Kazuhito Hagio <k-hagio-ab(a)nec.com> + +Signed-off-by: Lianbo Jiang <lijiang(a)redhat.com> +--- + makedumpfile.c | 22 ++++++++++++++++++++-- + makedumpfile.h | 3 +++ + 2 files changed, 23 insertions(+), 2 deletions(-) + +diff --git a/makedumpfile-1.7.5/makedumpfile.c b/makedumpfile-1.7.5/makedumpfile.c +index d7f1dd41d2ca..437ad916f816 100644 +--- a/makedumpfile-1.7.5/makedumpfile.c ++++ b/makedumpfile-1.7.5/makedumpfile.c +@@ -2975,6 +2975,7 @@ read_vmcoreinfo(void) + READ_SRCFILE("pud_t", pud_t); + + READ_NUMBER("PAGE_BUDDY_MAPCOUNT_VALUE", PAGE_BUDDY_MAPCOUNT_VALUE); ++ READ_NUMBER("PAGE_HUGETLB_MAPCOUNT_VALUE", PAGE_HUGETLB_MAPCOUNT_VALUE); + READ_NUMBER("PAGE_OFFLINE_MAPCOUNT_VALUE", PAGE_OFFLINE_MAPCOUNT_VALUE); + READ_NUMBER("phys_base", phys_base); + READ_NUMBER("KERNEL_IMAGE_SIZE", KERNEL_IMAGE_SIZE); +@@ -6510,6 +6511,9 @@ __exclude_unnecessary_pages(unsigned long mem_map, + _count = UINT(pcache + OFFSET(page._refcount)); + mapping = ULONG(pcache + OFFSET(page.mapping)); + ++ if (OFFSET(page._mapcount) != NOT_FOUND_STRUCTURE) ++ _mapcount = UINT(pcache + OFFSET(page._mapcount)); ++ + compound_order = 0; + compound_dtor = 0; + /* +@@ -6520,6 +6524,22 @@ __exclude_unnecessary_pages(unsigned long mem_map, + if ((index_pg < PGMM_CACHED - 1) && isCompoundHead(flags)) { + unsigned char *addr = pcache + SIZE(page); + ++ /* ++ * Linux 6.9 and later kernels use _mapcount value for hugetlb pages. ++ * See kernel commit d99e3140a4d3. ++ */ ++ if (NUMBER(PAGE_HUGETLB_MAPCOUNT_VALUE) != NOT_FOUND_NUMBER) { ++ unsigned long _flags_1 = ULONG(addr + OFFSET(page.flags)); ++ unsigned int PG_hugetlb = ~NUMBER(PAGE_HUGETLB_MAPCOUNT_VALUE); ++ ++ compound_order = _flags_1 & 0xff; ++ ++ if ((_mapcount & (PAGE_TYPE_BASE | PG_hugetlb)) == PAGE_TYPE_BASE) ++ compound_dtor = IS_HUGETLB; ++ ++ goto check_order; ++ } ++ + /* + * Linux 6.6 and later. Kernels that have PG_hugetlb should also + * have the compound order in the low byte of folio._flags_1. +@@ -6564,8 +6584,6 @@ check_order: + if (OFFSET(page.compound_head) != NOT_FOUND_STRUCTURE) + compound_head = ULONG(pcache + OFFSET(page.compound_head)); + +- if (OFFSET(page._mapcount) != NOT_FOUND_STRUCTURE) +- _mapcount = UINT(pcache + OFFSET(page._mapcount)); + if (OFFSET(page.private) != NOT_FOUND_STRUCTURE) + private = ULONG(pcache + OFFSET(page.private)); + +diff --git a/makedumpfile-1.7.5/makedumpfile.h b/makedumpfile-1.7.5/makedumpfile.h +index 75b66ceaba21..f08c49fc73be 100644 +--- a/makedumpfile-1.7.5/makedumpfile.h ++++ b/makedumpfile-1.7.5/makedumpfile.h +@@ -165,6 +165,8 @@ test_bit(int nr, unsigned long addr) + #define isAnon(mapping, flags) (((unsigned long)mapping & PAGE_MAPPING_ANON) != 0 \ + && !isSlab(flags)) + ++#define PAGE_TYPE_BASE (0xf0000000) ++ + #define PTOB(X) (((unsigned long long)(X)) << PAGESHIFT()) + #define BTOP(X) (((unsigned long long)(X)) >> PAGESHIFT()) + +@@ -2255,6 +2257,7 @@ struct number_table { + long PG_hugetlb; + + long PAGE_BUDDY_MAPCOUNT_VALUE; ++ long PAGE_HUGETLB_MAPCOUNT_VALUE; + long PAGE_OFFLINE_MAPCOUNT_VALUE; + long SECTION_SIZE_BITS; + long MAX_PHYSMEM_BITS; +-- +2.45.1 + diff --git a/kexec-tools-2.0.28-makedumfpile-0002-PATCH-Fix-wrong-exclusion-of-Slab-pages-on-Linux-6.1.patch b/kexec-tools-2.0.28-makedumfpile-0002-PATCH-Fix-wrong-exclusion-of-Slab-pages-on-Linux-6.1.patch new file mode 100644 index 000000000000..176ebb39f3dc --- /dev/null +++ b/kexec-tools-2.0.28-makedumfpile-0002-PATCH-Fix-wrong-exclusion-of-Slab-pages-on-Linux-6.1.patch @@ -0,0 +1,137 @@ +From bad2a7c4fa75d37a41578441468584963028bdda Mon Sep 17 00:00:00 2001 +From: Kazuhito Hagio <k-hagio-ab(a)nec.com> +Date: Fri, 7 Jun 2024 15:34:05 +0900 +Subject: [PATCH 2/2] [PATCH] Fix wrong exclusion of Slab pages on Linux + 6.10-rc1 and later + + commit bad2a7c4fa75d37a41578441468584963028bdda + Author: Kazuhito Hagio <k-hagio-ab(a)nec.com> + Date: Fri Jun 7 15:34:05 2024 +0900 + + [PATCH] Fix wrong exclusion of Slab pages on Linux 6.10-rc1 and later + + * Required for kernel 6.10 + + Kernel commit 46df8e73a4a3 ("mm: free up PG_slab") moved the PG_slab + flag from page.flags into page._mapcount (slab.__page_type), and + introduced NUMBER(PAGE_SLAB_MAPCOUNT_VALUE) entry into vmcoreinfo. + + Without the patch, "makedumpfile -d 8" option wrongly excludes Slab + pages and crash cannot open the dumpfile with an error like this: + + $ crash --kaslr auto vmlinux dumpfile + ... + please wait... (gathering task table data) + crash: page excluded: kernel virtual address: ffff909980440270 type: "xa_node.slots[off]" + + Signed-off-by: Kazuhito Hagio <k-hagio-ab(a)nec.com> + +Signed-off-by: Lianbo Jiang <lijiang(a)redhat.com> +--- + makedumpfile.c | 24 +++++++++++++++++++----- + makedumpfile.h | 6 +++--- + 2 files changed, 22 insertions(+), 8 deletions(-) + +diff --git a/makedumpfile-1.7.5/makedumpfile.c b/makedumpfile-1.7.5/makedumpfile.c +index 437ad916f816..5b347126db76 100644 +--- a/makedumpfile-1.7.5/makedumpfile.c ++++ b/makedumpfile-1.7.5/makedumpfile.c +@@ -275,13 +275,26 @@ isHugetlb(unsigned long dtor) + && (SYMBOL(free_huge_page) == dtor)); + } + ++static inline int ++isSlab(unsigned long flags, unsigned int _mapcount) ++{ ++ /* Linux 6.10 and later */ ++ if (NUMBER(PAGE_SLAB_MAPCOUNT_VALUE) != NOT_FOUND_NUMBER) { ++ unsigned int PG_slab = ~NUMBER(PAGE_SLAB_MAPCOUNT_VALUE); ++ if ((_mapcount & (PAGE_TYPE_BASE | PG_slab)) == PAGE_TYPE_BASE) ++ return TRUE; ++ } ++ ++ return flags & (1UL << NUMBER(PG_slab)); ++} ++ + static int + isOffline(unsigned long flags, unsigned int _mapcount) + { + if (NUMBER(PAGE_OFFLINE_MAPCOUNT_VALUE) == NOT_FOUND_NUMBER) + return FALSE; + +- if (flags & (1UL << NUMBER(PG_slab))) ++ if (isSlab(flags, _mapcount)) + return FALSE; + + if (_mapcount == (int)NUMBER(PAGE_OFFLINE_MAPCOUNT_VALUE)) +@@ -2977,6 +2990,7 @@ read_vmcoreinfo(void) + READ_NUMBER("PAGE_BUDDY_MAPCOUNT_VALUE", PAGE_BUDDY_MAPCOUNT_VALUE); + READ_NUMBER("PAGE_HUGETLB_MAPCOUNT_VALUE", PAGE_HUGETLB_MAPCOUNT_VALUE); + READ_NUMBER("PAGE_OFFLINE_MAPCOUNT_VALUE", PAGE_OFFLINE_MAPCOUNT_VALUE); ++ READ_NUMBER("PAGE_SLAB_MAPCOUNT_VALUE", PAGE_SLAB_MAPCOUNT_VALUE); + READ_NUMBER("phys_base", phys_base); + READ_NUMBER("KERNEL_IMAGE_SIZE", KERNEL_IMAGE_SIZE); + +@@ -6043,7 +6057,7 @@ static int + page_is_buddy_v3(unsigned long flags, unsigned int _mapcount, + unsigned long private, unsigned int _count) + { +- if (flags & (1UL << NUMBER(PG_slab))) ++ if (isSlab(flags, _mapcount)) + return FALSE; + + if (_mapcount == (int)NUMBER(PAGE_BUDDY_MAPCOUNT_VALUE)) +@@ -6618,7 +6632,7 @@ check_order: + */ + else if ((info->dump_level & DL_EXCLUDE_CACHE) + && is_cache_page(flags) +- && !isPrivate(flags) && !isAnon(mapping, flags)) { ++ && !isPrivate(flags) && !isAnon(mapping, flags, _mapcount)) { + pfn_counter = &pfn_cache; + } + /* +@@ -6626,7 +6640,7 @@ check_order: + */ + else if ((info->dump_level & DL_EXCLUDE_CACHE_PRI) + && is_cache_page(flags) +- && !isAnon(mapping, flags)) { ++ && !isAnon(mapping, flags, _mapcount)) { + if (isPrivate(flags)) + pfn_counter = &pfn_cache_private; + else +@@ -6638,7 +6652,7 @@ check_order: + * - hugetlbfs pages + */ + else if ((info->dump_level & DL_EXCLUDE_USER_DATA) +- && (isAnon(mapping, flags) || isHugetlb(compound_dtor))) { ++ && (isAnon(mapping, flags, _mapcount) || isHugetlb(compound_dtor))) { + pfn_counter = &pfn_user; + } + /* +diff --git a/makedumpfile-1.7.5/makedumpfile.h b/makedumpfile-1.7.5/makedumpfile.h +index f08c49fc73be..6b43a8b44f93 100644 +--- a/makedumpfile-1.7.5/makedumpfile.h ++++ b/makedumpfile-1.7.5/makedumpfile.h +@@ -161,9 +161,8 @@ test_bit(int nr, unsigned long addr) + #define isSwapBacked(flags) test_bit(NUMBER(PG_swapbacked), flags) + #define isHWPOISON(flags) (test_bit(NUMBER(PG_hwpoison), flags) \ + && (NUMBER(PG_hwpoison) != NOT_FOUND_NUMBER)) +-#define isSlab(flags) test_bit(NUMBER(PG_slab), flags) +-#define isAnon(mapping, flags) (((unsigned long)mapping & PAGE_MAPPING_ANON) != 0 \ +- && !isSlab(flags)) ++#define isAnon(mapping, flags, _mapcount) \ ++ (((unsigned long)mapping & PAGE_MAPPING_ANON) != 0 && !isSlab(flags, _mapcount)) + + #define PAGE_TYPE_BASE (0xf0000000) + +@@ -2259,6 +2258,7 @@ struct number_table { + long PAGE_BUDDY_MAPCOUNT_VALUE; + long PAGE_HUGETLB_MAPCOUNT_VALUE; + long PAGE_OFFLINE_MAPCOUNT_VALUE; ++ long PAGE_SLAB_MAPCOUNT_VALUE; + long SECTION_SIZE_BITS; + long MAX_PHYSMEM_BITS; + long HUGETLB_PAGE_DTOR; +-- +2.45.1 + diff --git a/kexec-tools.spec b/kexec-tools.spec index d5458bc1fb66..38044a5a634b 100644 --- a/kexec-tools.spec +++ b/kexec-tools.spec @@ -6,7 +6,7 @@ Name: kexec-tools Version: 2.0.28 -Release: 9%{?dist} +Release: 10%{?dist} URL:
https://kernel.org/pub/linux/utils/kernel/kexec
License: GPL-2.0-only Summary: The kexec/kdump userspace component @@ -53,6 +53,8 @@ Patch101: kexec-tools-2.0.28-Fix-building-on-x86_64-with-binutils-2.41.patch # kexec: don't use kexec_file_load on XEN # Author: Jiri Bohac <jbohac(a)suse.cz> Patch601: kexec-tools-2.0.28-kexec-don-t-use-kexec_file_load-on-XEN.patch +Patch602: kexec-tools-2.0.28-makedumfpile-0001-PATCH-Fix-failure-of-hugetlb-pages-exclusion-on-Linu.patch +Patch603: kexec-tools-2.0.28-makedumfpile-0002-PATCH-Fix-wrong-exclusion-of-Slab-pages-on-Linux-6.1.patch %description kexec-tools provides /sbin/kexec binary that facilitates a new @@ -137,6 +139,8 @@ tar -z -x -v -f %{SOURCE19} %patch 101 -p1 %patch 601 -p1 +%patch 602 -p1 +%patch 603 -p1 %ifarch ppc %define archdef ARCH=ppc @@ -292,6 +296,10 @@ fi %changelog +* Tue Jun 18 2024 Lianbo Jiang <lijiang(a)redhat.com> - 2.0.28-10 +- Fix failure of hugetlb pages exclusion on Linux 6.9 and later +- Fix wrong exclusion of Slab pages on Linux 6.10-rc1 and later + * Thu Apr 25 2024 Coiby Xu <coxu(a)redhat.com> - 2.0.28-9 - Update to makedumpfile-1.7.5 -- 2.45.1
3
2
0
0
[PATCH] Release: 2.0.28-10
by Lianbo Jiang
19 Jun '24
19 Jun '24
Resolves: RHEL-40200 Signed-off-by: Lianbo Jiang <lijiang(a)redhat.com> --- Scratch build:
https://koji.fedoraproject.org/koji/taskinfo?taskID=119232649
...e-of-hugetlb-pages-exclusion-on-Linu.patch | 110 ++++++++++++++ ...exclusion-of-Slab-pages-on-Linux-6.1.patch | 139 ++++++++++++++++++ kexec-tools.spec | 10 +- 3 files changed, 258 insertions(+), 1 deletion(-) create mode 100644 kexec-tools-2.0.28-makedumfpile-0001-PATCH-Fix-failure-of-hugetlb-pages-exclusion-on-Linu.patch create mode 100644 kexec-tools-2.0.28-makedumfpile-0002-PATCH-Fix-wrong-exclusion-of-Slab-pages-on-Linux-6.1.patch diff --git a/kexec-tools-2.0.28-makedumfpile-0001-PATCH-Fix-failure-of-hugetlb-pages-exclusion-on-Linu.patch b/kexec-tools-2.0.28-makedumfpile-0001-PATCH-Fix-failure-of-hugetlb-pages-exclusion-on-Linu.patch new file mode 100644 index 000000000000..bfed3cdbd26c --- /dev/null +++ b/kexec-tools-2.0.28-makedumfpile-0001-PATCH-Fix-failure-of-hugetlb-pages-exclusion-on-Linu.patch @@ -0,0 +1,110 @@ +From 985e575253f1c2de8d6876cfe685c68a24ee06e1 Mon Sep 17 00:00:00 2001 +From: Kazuhito Hagio <k-hagio-ab(a)nec.com> +Date: Thu, 30 May 2024 16:59:02 +0900 +Subject: [PATCH 1/2] [PATCH] Fix failure of hugetlb pages exclusion on Linux + 6.9 and later + +Resolves: RHEL-40200 + + commit 985e575253f1c2de8d6876cfe685c68a24ee06e1 + Author: Kazuhito Hagio <k-hagio-ab(a)nec.com> + Date: Thu May 30 16:59:02 2024 +0900 + + [PATCH] Fix failure of hugetlb pages exclusion on Linux 6.9 and later + + * Required for kernel 6.9 + + Kernel commit d99e3140a4d3 ("mm: turn folio_test_hugetlb into a + PageType") moved the PG_hugetlb flag from folio._flags_1 into + page._mapcount and introduced NUMBER(PAGE_HUGETLB_MAPCOUNT_VALUE) entry + into vmcoreinfo. + + Without the patch, "makedumpfile -d 8" cannot exclude hugetlb pages. + + Signed-off-by: Kazuhito Hagio <k-hagio-ab(a)nec.com> + + +Signed-off-by: Lianbo Jiang <lijiang(a)redhat.com> +--- + makedumpfile.c | 22 ++++++++++++++++++++-- + makedumpfile.h | 3 +++ + 2 files changed, 23 insertions(+), 2 deletions(-) + +diff --git a/makedumpfile-1.7.5/makedumpfile.c b/makedumpfile-1.7.5/makedumpfile.c +index d7f1dd41d2ca..437ad916f816 100644 +--- a/makedumpfile-1.7.5/makedumpfile.c ++++ b/makedumpfile-1.7.5/makedumpfile.c +@@ -2975,6 +2975,7 @@ read_vmcoreinfo(void) + READ_SRCFILE("pud_t", pud_t); + + READ_NUMBER("PAGE_BUDDY_MAPCOUNT_VALUE", PAGE_BUDDY_MAPCOUNT_VALUE); ++ READ_NUMBER("PAGE_HUGETLB_MAPCOUNT_VALUE", PAGE_HUGETLB_MAPCOUNT_VALUE); + READ_NUMBER("PAGE_OFFLINE_MAPCOUNT_VALUE", PAGE_OFFLINE_MAPCOUNT_VALUE); + READ_NUMBER("phys_base", phys_base); + READ_NUMBER("KERNEL_IMAGE_SIZE", KERNEL_IMAGE_SIZE); +@@ -6510,6 +6511,9 @@ __exclude_unnecessary_pages(unsigned long mem_map, + _count = UINT(pcache + OFFSET(page._refcount)); + mapping = ULONG(pcache + OFFSET(page.mapping)); + ++ if (OFFSET(page._mapcount) != NOT_FOUND_STRUCTURE) ++ _mapcount = UINT(pcache + OFFSET(page._mapcount)); ++ + compound_order = 0; + compound_dtor = 0; + /* +@@ -6520,6 +6524,22 @@ __exclude_unnecessary_pages(unsigned long mem_map, + if ((index_pg < PGMM_CACHED - 1) && isCompoundHead(flags)) { + unsigned char *addr = pcache + SIZE(page); + ++ /* ++ * Linux 6.9 and later kernels use _mapcount value for hugetlb pages. ++ * See kernel commit d99e3140a4d3. ++ */ ++ if (NUMBER(PAGE_HUGETLB_MAPCOUNT_VALUE) != NOT_FOUND_NUMBER) { ++ unsigned long _flags_1 = ULONG(addr + OFFSET(page.flags)); ++ unsigned int PG_hugetlb = ~NUMBER(PAGE_HUGETLB_MAPCOUNT_VALUE); ++ ++ compound_order = _flags_1 & 0xff; ++ ++ if ((_mapcount & (PAGE_TYPE_BASE | PG_hugetlb)) == PAGE_TYPE_BASE) ++ compound_dtor = IS_HUGETLB; ++ ++ goto check_order; ++ } ++ + /* + * Linux 6.6 and later. Kernels that have PG_hugetlb should also + * have the compound order in the low byte of folio._flags_1. +@@ -6564,8 +6584,6 @@ check_order: + if (OFFSET(page.compound_head) != NOT_FOUND_STRUCTURE) + compound_head = ULONG(pcache + OFFSET(page.compound_head)); + +- if (OFFSET(page._mapcount) != NOT_FOUND_STRUCTURE) +- _mapcount = UINT(pcache + OFFSET(page._mapcount)); + if (OFFSET(page.private) != NOT_FOUND_STRUCTURE) + private = ULONG(pcache + OFFSET(page.private)); + +diff --git a/makedumpfile-1.7.5/makedumpfile.h b/makedumpfile-1.7.5/makedumpfile.h +index 75b66ceaba21..f08c49fc73be 100644 +--- a/makedumpfile-1.7.5/makedumpfile.h ++++ b/makedumpfile-1.7.5/makedumpfile.h +@@ -165,6 +165,8 @@ test_bit(int nr, unsigned long addr) + #define isAnon(mapping, flags) (((unsigned long)mapping & PAGE_MAPPING_ANON) != 0 \ + && !isSlab(flags)) + ++#define PAGE_TYPE_BASE (0xf0000000) ++ + #define PTOB(X) (((unsigned long long)(X)) << PAGESHIFT()) + #define BTOP(X) (((unsigned long long)(X)) >> PAGESHIFT()) + +@@ -2255,6 +2257,7 @@ struct number_table { + long PG_hugetlb; + + long PAGE_BUDDY_MAPCOUNT_VALUE; ++ long PAGE_HUGETLB_MAPCOUNT_VALUE; + long PAGE_OFFLINE_MAPCOUNT_VALUE; + long SECTION_SIZE_BITS; + long MAX_PHYSMEM_BITS; +-- +2.45.1 + diff --git a/kexec-tools-2.0.28-makedumfpile-0002-PATCH-Fix-wrong-exclusion-of-Slab-pages-on-Linux-6.1.patch b/kexec-tools-2.0.28-makedumfpile-0002-PATCH-Fix-wrong-exclusion-of-Slab-pages-on-Linux-6.1.patch new file mode 100644 index 000000000000..66143104e952 --- /dev/null +++ b/kexec-tools-2.0.28-makedumfpile-0002-PATCH-Fix-wrong-exclusion-of-Slab-pages-on-Linux-6.1.patch @@ -0,0 +1,139 @@ +From bad2a7c4fa75d37a41578441468584963028bdda Mon Sep 17 00:00:00 2001 +From: Kazuhito Hagio <k-hagio-ab(a)nec.com> +Date: Fri, 7 Jun 2024 15:34:05 +0900 +Subject: [PATCH 2/2] [PATCH] Fix wrong exclusion of Slab pages on Linux + 6.10-rc1 and later + +Resolves: RHEL-40200 + + commit bad2a7c4fa75d37a41578441468584963028bdda + Author: Kazuhito Hagio <k-hagio-ab(a)nec.com> + Date: Fri Jun 7 15:34:05 2024 +0900 + + [PATCH] Fix wrong exclusion of Slab pages on Linux 6.10-rc1 and later + + * Required for kernel 6.10 + + Kernel commit 46df8e73a4a3 ("mm: free up PG_slab") moved the PG_slab + flag from page.flags into page._mapcount (slab.__page_type), and + introduced NUMBER(PAGE_SLAB_MAPCOUNT_VALUE) entry into vmcoreinfo. + + Without the patch, "makedumpfile -d 8" option wrongly excludes Slab + pages and crash cannot open the dumpfile with an error like this: + + $ crash --kaslr auto vmlinux dumpfile + ... + please wait... (gathering task table data) + crash: page excluded: kernel virtual address: ffff909980440270 type: "xa_node.slots[off]" + + Signed-off-by: Kazuhito Hagio <k-hagio-ab(a)nec.com> + +Signed-off-by: Lianbo Jiang <lijiang(a)redhat.com> +--- + makedumpfile.c | 24 +++++++++++++++++++----- + makedumpfile.h | 6 +++--- + 2 files changed, 22 insertions(+), 8 deletions(-) + +diff --git a/makedumpfile-1.7.5/makedumpfile.c b/makedumpfile-1.7.5/makedumpfile.c +index 437ad916f816..5b347126db76 100644 +--- a/makedumpfile-1.7.5/makedumpfile.c ++++ b/makedumpfile-1.7.5/makedumpfile.c +@@ -275,13 +275,26 @@ isHugetlb(unsigned long dtor) + && (SYMBOL(free_huge_page) == dtor)); + } + ++static inline int ++isSlab(unsigned long flags, unsigned int _mapcount) ++{ ++ /* Linux 6.10 and later */ ++ if (NUMBER(PAGE_SLAB_MAPCOUNT_VALUE) != NOT_FOUND_NUMBER) { ++ unsigned int PG_slab = ~NUMBER(PAGE_SLAB_MAPCOUNT_VALUE); ++ if ((_mapcount & (PAGE_TYPE_BASE | PG_slab)) == PAGE_TYPE_BASE) ++ return TRUE; ++ } ++ ++ return flags & (1UL << NUMBER(PG_slab)); ++} ++ + static int + isOffline(unsigned long flags, unsigned int _mapcount) + { + if (NUMBER(PAGE_OFFLINE_MAPCOUNT_VALUE) == NOT_FOUND_NUMBER) + return FALSE; + +- if (flags & (1UL << NUMBER(PG_slab))) ++ if (isSlab(flags, _mapcount)) + return FALSE; + + if (_mapcount == (int)NUMBER(PAGE_OFFLINE_MAPCOUNT_VALUE)) +@@ -2977,6 +2990,7 @@ read_vmcoreinfo(void) + READ_NUMBER("PAGE_BUDDY_MAPCOUNT_VALUE", PAGE_BUDDY_MAPCOUNT_VALUE); + READ_NUMBER("PAGE_HUGETLB_MAPCOUNT_VALUE", PAGE_HUGETLB_MAPCOUNT_VALUE); + READ_NUMBER("PAGE_OFFLINE_MAPCOUNT_VALUE", PAGE_OFFLINE_MAPCOUNT_VALUE); ++ READ_NUMBER("PAGE_SLAB_MAPCOUNT_VALUE", PAGE_SLAB_MAPCOUNT_VALUE); + READ_NUMBER("phys_base", phys_base); + READ_NUMBER("KERNEL_IMAGE_SIZE", KERNEL_IMAGE_SIZE); + +@@ -6043,7 +6057,7 @@ static int + page_is_buddy_v3(unsigned long flags, unsigned int _mapcount, + unsigned long private, unsigned int _count) + { +- if (flags & (1UL << NUMBER(PG_slab))) ++ if (isSlab(flags, _mapcount)) + return FALSE; + + if (_mapcount == (int)NUMBER(PAGE_BUDDY_MAPCOUNT_VALUE)) +@@ -6618,7 +6632,7 @@ check_order: + */ + else if ((info->dump_level & DL_EXCLUDE_CACHE) + && is_cache_page(flags) +- && !isPrivate(flags) && !isAnon(mapping, flags)) { ++ && !isPrivate(flags) && !isAnon(mapping, flags, _mapcount)) { + pfn_counter = &pfn_cache; + } + /* +@@ -6626,7 +6640,7 @@ check_order: + */ + else if ((info->dump_level & DL_EXCLUDE_CACHE_PRI) + && is_cache_page(flags) +- && !isAnon(mapping, flags)) { ++ && !isAnon(mapping, flags, _mapcount)) { + if (isPrivate(flags)) + pfn_counter = &pfn_cache_private; + else +@@ -6638,7 +6652,7 @@ check_order: + * - hugetlbfs pages + */ + else if ((info->dump_level & DL_EXCLUDE_USER_DATA) +- && (isAnon(mapping, flags) || isHugetlb(compound_dtor))) { ++ && (isAnon(mapping, flags, _mapcount) || isHugetlb(compound_dtor))) { + pfn_counter = &pfn_user; + } + /* +diff --git a/makedumpfile-1.7.5/makedumpfile.h b/makedumpfile-1.7.5/makedumpfile.h +index f08c49fc73be..6b43a8b44f93 100644 +--- a/makedumpfile-1.7.5/makedumpfile.h ++++ b/makedumpfile-1.7.5/makedumpfile.h +@@ -161,9 +161,8 @@ test_bit(int nr, unsigned long addr) + #define isSwapBacked(flags) test_bit(NUMBER(PG_swapbacked), flags) + #define isHWPOISON(flags) (test_bit(NUMBER(PG_hwpoison), flags) \ + && (NUMBER(PG_hwpoison) != NOT_FOUND_NUMBER)) +-#define isSlab(flags) test_bit(NUMBER(PG_slab), flags) +-#define isAnon(mapping, flags) (((unsigned long)mapping & PAGE_MAPPING_ANON) != 0 \ +- && !isSlab(flags)) ++#define isAnon(mapping, flags, _mapcount) \ ++ (((unsigned long)mapping & PAGE_MAPPING_ANON) != 0 && !isSlab(flags, _mapcount)) + + #define PAGE_TYPE_BASE (0xf0000000) + +@@ -2259,6 +2258,7 @@ struct number_table { + long PAGE_BUDDY_MAPCOUNT_VALUE; + long PAGE_HUGETLB_MAPCOUNT_VALUE; + long PAGE_OFFLINE_MAPCOUNT_VALUE; ++ long PAGE_SLAB_MAPCOUNT_VALUE; + long SECTION_SIZE_BITS; + long MAX_PHYSMEM_BITS; + long HUGETLB_PAGE_DTOR; +-- +2.45.1 + diff --git a/kexec-tools.spec b/kexec-tools.spec index d5458bc1fb66..38044a5a634b 100644 --- a/kexec-tools.spec +++ b/kexec-tools.spec @@ -6,7 +6,7 @@ Name: kexec-tools Version: 2.0.28 -Release: 9%{?dist} +Release: 10%{?dist} URL:
https://kernel.org/pub/linux/utils/kernel/kexec
License: GPL-2.0-only Summary: The kexec/kdump userspace component @@ -53,6 +53,8 @@ Patch101: kexec-tools-2.0.28-Fix-building-on-x86_64-with-binutils-2.41.patch # kexec: don't use kexec_file_load on XEN # Author: Jiri Bohac <jbohac(a)suse.cz> Patch601: kexec-tools-2.0.28-kexec-don-t-use-kexec_file_load-on-XEN.patch +Patch602: kexec-tools-2.0.28-makedumfpile-0001-PATCH-Fix-failure-of-hugetlb-pages-exclusion-on-Linu.patch +Patch603: kexec-tools-2.0.28-makedumfpile-0002-PATCH-Fix-wrong-exclusion-of-Slab-pages-on-Linux-6.1.patch %description kexec-tools provides /sbin/kexec binary that facilitates a new @@ -137,6 +139,8 @@ tar -z -x -v -f %{SOURCE19} %patch 101 -p1 %patch 601 -p1 +%patch 602 -p1 +%patch 603 -p1 %ifarch ppc %define archdef ARCH=ppc @@ -292,6 +296,10 @@ fi %changelog +* Tue Jun 18 2024 Lianbo Jiang <lijiang(a)redhat.com> - 2.0.28-10 +- Fix failure of hugetlb pages exclusion on Linux 6.9 and later +- Fix wrong exclusion of Slab pages on Linux 6.10-rc1 and later + * Thu Apr 25 2024 Coiby Xu <coxu(a)redhat.com> - 2.0.28-9 - Update to makedumpfile-1.7.5 -- 2.45.1
2
1
0
0
Results per page:
10
25
50
100
200