Skip to contentSkip to conversation

+ mm-x86-pgtable-drop-unneeded-preprocessor-ifdef.patch added to -mm tree

PATCH [email protected] 1 participant 1 message May 2, 2014 x86

lore
Share & tools
lore
#0 lore raw

Subject: + mm-x86-pgtable-drop-unneeded-preprocessor-ifdef.patch added to -mm tree
To: [email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected]
From: [email protected]
Date: Fri, 02 May 2014 14:12:10 -0700

The patch titled
Subject: mm: x86 pgtable: drop unneeded preprocessor ifdef
has been added to the -mm tree. Its filename is
mm-x86-pgtable-drop-unneeded-preprocessor-ifdef.patch

This patch should soon appear at
http://ozlabs.org/~akpm/mmots/broken-out/mm-x86-pgtable-drop-unneeded-preprocessor-ifdef.patch
and later at
http://ozlabs.org/~akpm/mmotm/broken-out/mm-x86-pgtable-drop-unneeded-preprocessor-ifdef.patch

Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/SubmitChecklist when testing your code ***

The -mm tree is included into linux-next and is updated there every 3-4 working days

------------------------------------------------------
From: Cyrill Gorcunov <[email protected]>
Subject: mm: x86 pgtable: drop unneeded preprocessor ifdef

_PAGE_BIT_FILE (bit 6) is always less than _PAGE_BIT_PROTNONE (bit 8), so drop redundant #ifdef.

Cc Linus Torvalds <[email protected]>
Cc Mel Gorman <[email protected]>
Cc Peter Anvin <[email protected]>
Cc Ingo Molnar <[email protected]>
Cc Steven Noonan <[email protected]>
Cc Rik van Riel <[email protected]>
Cc David Vrabel <[email protected]>
Cc Peter Zijlstra <[email protected]>
Cc Pavel Emelyanov <[email protected]>

---

 arch/x86/include/asm/pgtable-2level.h |   10 ----------
 arch/x86/include/asm/pgtable_64.h     |    8 --------
 2 files changed, 18 deletions(-)
arch/x86/include/asm/pgtable-2level.h renamed from arch/x86/include/asm/pgtable-2level.h~mm-x86-pgtable-drop-unneeded-preprocessor-ifdef +0 -10
diff -puN arch/x86/include/asm/pgtable-2level.h~mm-x86-pgtable-drop-unneeded-preprocessor-ifdef arch/x86/include/asm/pgtable-2level.h
@@ -115,13 +115,8 @@ static __always_inline pte_t pgoff_to_pt
  */
 #define PTE_FILE_MAX_BITS	29
 #define PTE_FILE_SHIFT1		(_PAGE_BIT_PRESENT + 1)
-#if _PAGE_BIT_FILE < _PAGE_BIT_PROTNONE
 #define PTE_FILE_SHIFT2		(_PAGE_BIT_FILE + 1)
 #define PTE_FILE_SHIFT3		(_PAGE_BIT_PROTNONE + 1)
-#else
-#define PTE_FILE_SHIFT2		(_PAGE_BIT_PROTNONE + 1)
-#define PTE_FILE_SHIFT3		(_PAGE_BIT_FILE + 1)
-#endif
 #define PTE_FILE_BITS1		(PTE_FILE_SHIFT2 - PTE_FILE_SHIFT1 - 1)
 #define PTE_FILE_BITS2		(PTE_FILE_SHIFT3 - PTE_FILE_SHIFT2 - 1)
 
@@ -153,13 +148,8 @@ static __always_inline pte_t pgoff_to_pt
 #endif /* CONFIG_MEM_SOFT_DIRTY */
 
 /* Encode and de-code a swap entry */
-#if _PAGE_BIT_FILE < _PAGE_BIT_PROTNONE
 #define SWP_TYPE_BITS (_PAGE_BIT_FILE - _PAGE_BIT_PRESENT - 1)
 #define SWP_OFFSET_SHIFT (_PAGE_BIT_PROTNONE + 1)
-#else
-#define SWP_TYPE_BITS (_PAGE_BIT_PROTNONE - _PAGE_BIT_PRESENT - 1)
-#define SWP_OFFSET_SHIFT (_PAGE_BIT_FILE + 1)
-#endif
 
 #define MAX_SWAPFILES_CHECK() BUILD_BUG_ON(MAX_SWAPFILES_SHIFT > SWP_TYPE_BITS)
 
arch/x86/include/asm/pgtable_64.h renamed from arch/x86/include/asm/pgtable_64.h~mm-x86-pgtable-drop-unneeded-preprocessor-ifdef +0 -8
diff -puN arch/x86/include/asm/pgtable_64.h~mm-x86-pgtable-drop-unneeded-preprocessor-ifdef arch/x86/include/asm/pgtable_64.h
@@ -143,7 +143,6 @@ static inline int pgd_large(pgd_t pgd) {
 #define pte_unmap(pte) ((void)(pte))/* NOP */
 
 /* Encode and de-code a swap entry */
-#if _PAGE_BIT_FILE < _PAGE_BIT_PROTNONE
 #define SWP_TYPE_BITS (_PAGE_BIT_FILE - _PAGE_BIT_PRESENT - 1)
 #ifdef CONFIG_NUMA_BALANCING
 /* Automatic NUMA balancing needs to be distinguishable from swap entries */
@@ -151,13 +150,6 @@ static inline int pgd_large(pgd_t pgd) {
 #else
 #define SWP_OFFSET_SHIFT (_PAGE_BIT_PROTNONE + 1)
 #endif
-#else
-#ifdef CONFIG_NUMA_BALANCING
-#error Incompatible format for automatic NUMA balancing
-#endif
-#define SWP_TYPE_BITS (_PAGE_BIT_PROTNONE - _PAGE_BIT_PRESENT - 1)
-#define SWP_OFFSET_SHIFT (_PAGE_BIT_FILE + 1)
-#endif
 
 #define MAX_SWAPFILES_CHECK() BUILD_BUG_ON(MAX_SWAPFILES_SHIFT > SWP_TYPE_BITS)
 

_

Patches currently in -mm which might be from [email protected] are

mm-softdirty-make-freshly-remapped-file-pages-being-softdirty-unconditionally.patch mm-softdirty-dont-forget-to-save-file-map-softdiry-bit-on-unmap.patch mm-softdirty-clear-vm_softdirty-flag-inside-clear_refs_write-instead-of-clear_soft_dirty.patch mm-x86-pgtable-drop-unneeded-preprocessor-ifdef.patch mm-x86-pgtable-require-x86_64-for-soft-dirty-tracker.patch