Skip to content

Commit c7e0b3d

Browse files
committed
mm/compaction: Get rid of RT ifdeffery
Move the RT dependency for the initial value of sysctl_compact_unevictable_allowed into Kconfig. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org> Link: https://lore.kernel.org/r/20220825164131.402717-7-bigeasy@linutronix.de
1 parent e575d40 commit c7e0b3d

2 files changed

Lines changed: 7 additions & 5 deletions

File tree

mm/Kconfig

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -579,6 +579,12 @@ config COMPACTION
579579
it and then we would be really interested to hear about that at
580580
linux-mm@kvack.org.
581581

582+
config COMPACT_UNEVICTABLE_DEFAULT
583+
int
584+
depends on COMPACTION
585+
default 0 if PREEMPT_RT
586+
default 1
587+
582588
#
583589
# support for free page reporting
584590
config PAGE_REPORTING

mm/compaction.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1727,11 +1727,7 @@ typedef enum {
17271727
* Allow userspace to control policy on scanning the unevictable LRU for
17281728
* compactable pages.
17291729
*/
1730-
#ifdef CONFIG_PREEMPT_RT
1731-
int sysctl_compact_unevictable_allowed __read_mostly = 0;
1732-
#else
1733-
int sysctl_compact_unevictable_allowed __read_mostly = 1;
1734-
#endif
1730+
int sysctl_compact_unevictable_allowed __read_mostly = CONFIG_COMPACT_UNEVICTABLE_DEFAULT;
17351731

17361732
static inline void
17371733
update_fast_start_pfn(struct compact_control *cc, unsigned long pfn)

0 commit comments

Comments
 (0)