All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: mm-commits@vger.kernel.org, shy828301@gmail.com,
	zokeefe@google.com, akpm@linux-foundation.org
Subject: [folded-merged] mm-khugepaged-add-struct-collapse_control-fix-fix-fix.patch removed from -mm tree
Date: Sun, 11 Sep 2022 16:31:06 -0700	[thread overview]
Message-ID: <20220911233107.75FDDC433D7@smtp.kernel.org> (raw)


The quilt patch titled
     Subject: mm/khugepaged: fix struct collapse_control load_node definition
has been removed from the -mm tree.  Its filename was
     mm-khugepaged-add-struct-collapse_control-fix-fix-fix.patch

This patch was dropped because it was folded into mm-khugepaged-add-struct-collapse_control.patch

------------------------------------------------------
From: "Zach O'Keefe" <zokeefe@google.com>
Subject: mm/khugepaged: fix struct collapse_control load_node definition
Date: Fri, 2 Sep 2022 19:12:21 -0700

HPAGE_PMD_ORDER is used to determine a minimal amount of bits needed to
store per-node counters in struct collapse_control, defining the array to
be either a u16[HPAGE_PMD_ORDER] or u32[HPAGE_PMD_ORDER].

For some architectures/configs, HPAGE_PMD_ORDER isn't resolved at
preprocessor time (suitable for resolving preprocessor directives) but
rather expands into a compiler built-in that is resolved at compile-time. 
E.g.  for 32-bit MIPS (see link for full config):

---8<--
>> arch/mips/include/asm/pgtable.h:238:26: warning: "__builtin_ffs" is not defined, evaluates to 0 [-Wundef]
     238 | #define PTE_T_LOG2      (__builtin_ffs(sizeof(pte_t)) - 1)
         |                          ^~~~~~~~~~~~~
   arch/mips/include/asm/pgtable-32.h:65:43: note: in expansion of macro 'PTE_T_LOG2'
      65 | # define PGDIR_SHIFT    (2 * PAGE_SHIFT - PTE_T_LOG2 - 1)
         |                                           ^~~~~~~~~~
   include/asm-generic/pgtable-nop4d.h:11:33: note: in expansion of macro 'PGDIR_SHIFT'
      11 | #define P4D_SHIFT               PGDIR_SHIFT
         |                                 ^~~~~~~~~~~
   include/asm-generic/pgtable-nopud.h:18:25: note: in expansion of macro 'P4D_SHIFT'
      18 | #define PUD_SHIFT       P4D_SHIFT
         |                         ^~~~~~~~~
   include/asm-generic/pgtable-nopmd.h:20:25: note: in expansion of macro 'PUD_SHIFT'
      20 | #define PMD_SHIFT       PUD_SHIFT
         |                         ^~~~~~~~~
   include/linux/huge_mm.h:109:25: note: in expansion of macro 'PMD_SHIFT'
     109 | #define HPAGE_PMD_SHIFT PMD_SHIFT
         |                         ^~~~~~~~~
   include/linux/huge_mm.h:105:26: note: in expansion of macro 'HPAGE_PMD_SHIFT'
     105 | #define HPAGE_PMD_ORDER (HPAGE_PMD_SHIFT-PAGE_SHIFT)
         |                          ^~~~~~~~~~~~~~~
   mm/khugepaged.c:90:5: note: in expansion of macro 'HPAGE_PMD_ORDER'
      90 | #if HPAGE_PMD_ORDER < 16
         |     ^~~~~~~~~~~~~~~
>> arch/mips/include/asm/pgtable.h:238:39: error: missing binary operator before token "("
     238 | #define PTE_T_LOG2      (__builtin_ffs(sizeof(pte_t)) - 1)
         |                                       ^
   arch/mips/include/asm/pgtable-32.h:65:43: note: in expansion of macro 'PTE_T_LOG2'
      65 | # define PGDIR_SHIFT    (2 * PAGE_SHIFT - PTE_T_LOG2 - 1)
         |                                           ^~~~~~~~~~
   include/asm-generic/pgtable-nop4d.h:11:33: note: in expansion of macro 'PGDIR_SHIFT'
      11 | #define P4D_SHIFT               PGDIR_SHIFT
         |                                 ^~~~~~~~~~~
   include/asm-generic/pgtable-nopud.h:18:25: note: in expansion of macro 'P4D_SHIFT'
      18 | #define PUD_SHIFT       P4D_SHIFT
         |                         ^~~~~~~~~
   include/asm-generic/pgtable-nopmd.h:20:25: note: in expansion of macro 'PUD_SHIFT'
      20 | #define PMD_SHIFT       PUD_SHIFT
         |                         ^~~~~~~~~
   include/linux/huge_mm.h:109:25: note: in expansion of macro 'PMD_SHIFT'
     109 | #define HPAGE_PMD_SHIFT PMD_SHIFT
         |                         ^~~~~~~~~
   include/linux/huge_mm.h:105:26: note: in expansion of macro 'HPAGE_PMD_SHIFT'
     105 | #define HPAGE_PMD_ORDER (HPAGE_PMD_SHIFT-PAGE_SHIFT)
         |                          ^~~~~~~~~~~~~~~
   mm/khugepaged.c:90:5: note: in expansion of macro 'HPAGE_PMD_ORDER'
      90 | #if HPAGE_PMD_ORDER < 16
         |     ^~~~~~~~~~~~~~~
---8<--

load_node is already special-cased for CONFIG_PPC64 in
"mm-khugepaged-add-struct-collapse_control-fix-fix", and we could continue
down that path by #define'ing away edge cases, but I think at this point
it easier to just let load_node be an array of u32s.  If it's ever an
issue, we can revisit.

This essentially rolls back both:

"mm/khugepaged: use minimal bits to store num page < HPAGE_PMD_NR"
"mm-khugepaged-add-struct-collapse_control-fix-fix"

(though we'll leave it as a u32 vs an int).

Link: https://lore.kernel.org/linux-mm/202209021349.F73i5d6X-lkp@intel.com/
Link: https://lkml.kernel.org/r/20220903021221.1130021-1-zokeefe@google.com
Fixes: 5f7bb00bd9cd ("mm/khugepaged: use minimal bits to store num page < HPAGE_PMD_NR")
Fixes: 03053c821af2 ("mm-khugepaged-add-struct-collapse_control-fix-fix")
Signed-off-by: Zach O'Keefe <zokeefe@google.com>
Reviewed-by: Yang Shi <shy828301@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 mm/khugepaged.c |    7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

--- a/mm/khugepaged.c~mm-khugepaged-add-struct-collapse_control-fix-fix-fix
+++ a/mm/khugepaged.c
@@ -87,13 +87,8 @@ static struct kmem_cache *mm_slot_cache
 
 struct collapse_control {
 	/* Num pages scanned per node */
-#if defined(CONFIG_PPC64)
 	u32 node_load[MAX_NUMNODES];
-#elif HPAGE_PMD_ORDER < 16
-	u16 node_load[MAX_NUMNODES];
-#else
-	u32 node_load[MAX_NUMNODES];
-#endif
+
 	/* Last target selected in khugepaged_find_target_node() */
 	int last_target_node;
 };
_

Patches currently in -mm which might be from zokeefe@google.com are

mm-khugepaged-add-struct-collapse_control.patch
mm-khugepaged-dedup-and-simplify-hugepage-alloc-and-charging.patch
mm-khugepaged-pipe-enum-scan_result-codes-back-to-callers.patch
mm-khugepaged-add-flag-to-predicate-khugepaged-only-behavior.patch
mm-thp-add-flag-to-enforce-sysfs-thp-in-hugepage_vma_check.patch
mm-khugepaged-add-flag-to-predicate-khugepaged-only-behavior-fix.patch
mm-khugepaged-record-scan_pmd_mapped-when-scan_pmd-finds-hugepage.patch
mm-madvise-introduce-madv_collapse-sync-hugepage-collapse.patch
mm-madvise-introduce-madv_collapse-sync-hugepage-collapse-fix-2.patch
mm-madvise-introduce-madv_collapse-sync-hugepage-collapse-fix-3.patch
mm-khugepaged-rename-prefix-of-shared-collapse-functions.patch
mm-madvise-add-madv_collapse-to-process_madvise.patch
mm-madvise-add-madv_collapse-to-process_madvise-fix.patch
selftests-vm-modularize-collapse-selftests.patch
selftests-vm-dedup-hugepage-allocation-logic.patch
selftests-vm-add-madv_collapse-collapse-context-to-selftests.patch
selftests-vm-add-selftest-to-verify-recollapse-of-thps.patch
selftests-vm-add-selftest-to-verify-multi-thp-collapse.patch
mm-shmem-add-flag-to-enforce-shmem-thp-in-hugepage_vma_check.patch
mm-khugepaged-attempt-to-map-file-shmem-backed-pte-mapped-thps-by-pmds.patch
mm-madvise-add-file-and-shmem-support-to-madv_collapse.patch
mm-khugepaged-add-tracepoint-to-hpage_collapse_scan_file.patch
selftests-vm-dedup-thp-helpers.patch
selftests-vm-modularize-thp-collapse-memory-operations.patch
selftests-vm-add-thp-collapse-file-and-tmpfs-testing.patch
selftests-vm-add-thp-collapse-shmem-testing.patch
selftests-vm-add-file-shmem-madv_collapse-selftest-for-cleared-pmd.patch
selftests-vm-add-selftest-for-madv_collapse-of-uffd-minor-memory.patch


                 reply	other threads:[~2022-09-11 23:31 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220911233107.75FDDC433D7@smtp.kernel.org \
    --to=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mm-commits@vger.kernel.org \
    --cc=shy828301@gmail.com \
    --cc=zokeefe@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.