Skip to content

Commit 6837765

Browse files
kosakitorvalds
authored andcommitted
mm: remove CONFIG_UNEVICTABLE_LRU config option
Currently, nobody wants to turn UNEVICTABLE_LRU off. Thus this configurability is unnecessary. Signed-off-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com> Cc: Johannes Weiner <hannes@cmpxchg.org> Cc: Andi Kleen <andi@firstfloor.org> Acked-by: Minchan Kim <minchan.kim@gmail.com> Cc: David Woodhouse <dwmw2@infradead.org> Cc: Matt Mackall <mpm@selenic.com> Cc: Rik van Riel <riel@redhat.com> Cc: Lee Schermerhorn <lee.schermerhorn@hp.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent bce7394 commit 6837765

17 files changed

Lines changed: 3 additions & 153 deletions

File tree

‎drivers/base/node.c‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,10 +72,8 @@ static ssize_t node_read_meminfo(struct sys_device * dev,
7272
"Node %d Inactive(anon): %8lu kB\n"
7373
"Node %d Active(file): %8lu kB\n"
7474
"Node %d Inactive(file): %8lu kB\n"
75-
#ifdef CONFIG_UNEVICTABLE_LRU
7675
"Node %d Unevictable: %8lu kB\n"
7776
"Node %d Mlocked: %8lu kB\n"
78-
#endif
7977
#ifdef CONFIG_HIGHMEM
8078
"Node %d HighTotal: %8lu kB\n"
8179
"Node %d HighFree: %8lu kB\n"
@@ -105,10 +103,8 @@ static ssize_t node_read_meminfo(struct sys_device * dev,
105103
nid, K(node_page_state(nid, NR_INACTIVE_ANON)),
106104
nid, K(node_page_state(nid, NR_ACTIVE_FILE)),
107105
nid, K(node_page_state(nid, NR_INACTIVE_FILE)),
108-
#ifdef CONFIG_UNEVICTABLE_LRU
109106
nid, K(node_page_state(nid, NR_UNEVICTABLE)),
110107
nid, K(node_page_state(nid, NR_MLOCK)),
111-
#endif
112108
#ifdef CONFIG_HIGHMEM
113109
nid, K(i.totalhigh),
114110
nid, K(i.freehigh),

‎fs/proc/meminfo.c‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,8 @@ static int meminfo_proc_show(struct seq_file *m, void *v)
6464
"Inactive(anon): %8lu kB\n"
6565
"Active(file): %8lu kB\n"
6666
"Inactive(file): %8lu kB\n"
67-
#ifdef CONFIG_UNEVICTABLE_LRU
6867
"Unevictable: %8lu kB\n"
6968
"Mlocked: %8lu kB\n"
70-
#endif
7169
#ifdef CONFIG_HIGHMEM
7270
"HighTotal: %8lu kB\n"
7371
"HighFree: %8lu kB\n"
@@ -109,10 +107,8 @@ static int meminfo_proc_show(struct seq_file *m, void *v)
109107
K(pages[LRU_INACTIVE_ANON]),
110108
K(pages[LRU_ACTIVE_FILE]),
111109
K(pages[LRU_INACTIVE_FILE]),
112-
#ifdef CONFIG_UNEVICTABLE_LRU
113110
K(pages[LRU_UNEVICTABLE]),
114111
K(global_page_state(NR_MLOCK)),
115-
#endif
116112
#ifdef CONFIG_HIGHMEM
117113
K(i.totalhigh),
118114
K(i.freehigh),

‎fs/proc/page.c‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,10 +172,8 @@ static u64 get_uflags(struct page *page)
172172
u |= kpf_copy_bit(k, KPF_SWAPCACHE, PG_swapcache);
173173
u |= kpf_copy_bit(k, KPF_SWAPBACKED, PG_swapbacked);
174174

175-
#ifdef CONFIG_UNEVICTABLE_LRU
176175
u |= kpf_copy_bit(k, KPF_UNEVICTABLE, PG_unevictable);
177176
u |= kpf_copy_bit(k, KPF_MLOCKED, PG_mlocked);
178-
#endif
179177

180178
#ifdef CONFIG_IA64_UNCACHED_ALLOCATOR
181179
u |= kpf_copy_bit(k, KPF_UNCACHED, PG_uncached);

‎include/linux/mmzone.h‎

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -83,13 +83,8 @@ enum zone_stat_item {
8383
NR_ACTIVE_ANON, /* " " " " " */
8484
NR_INACTIVE_FILE, /* " " " " " */
8585
NR_ACTIVE_FILE, /* " " " " " */
86-
#ifdef CONFIG_UNEVICTABLE_LRU
8786
NR_UNEVICTABLE, /* " " " " " */
8887
NR_MLOCK, /* mlock()ed pages found and moved off LRU */
89-
#else
90-
NR_UNEVICTABLE = NR_ACTIVE_FILE, /* avoid compiler errors in dead code */
91-
NR_MLOCK = NR_ACTIVE_FILE,
92-
#endif
9388
NR_ANON_PAGES, /* Mapped anonymous pages */
9489
NR_FILE_MAPPED, /* pagecache pages mapped into pagetables.
9590
only modified from process context */
@@ -132,11 +127,7 @@ enum lru_list {
132127
LRU_ACTIVE_ANON = LRU_BASE + LRU_ACTIVE,
133128
LRU_INACTIVE_FILE = LRU_BASE + LRU_FILE,
134129
LRU_ACTIVE_FILE = LRU_BASE + LRU_FILE + LRU_ACTIVE,
135-
#ifdef CONFIG_UNEVICTABLE_LRU
136130
LRU_UNEVICTABLE,
137-
#else
138-
LRU_UNEVICTABLE = LRU_ACTIVE_FILE, /* avoid compiler errors in dead code */
139-
#endif
140131
NR_LRU_LISTS
141132
};
142133

@@ -156,11 +147,7 @@ static inline int is_active_lru(enum lru_list l)
156147

157148
static inline int is_unevictable_lru(enum lru_list l)
158149
{
159-
#ifdef CONFIG_UNEVICTABLE_LRU
160150
return (l == LRU_UNEVICTABLE);
161-
#else
162-
return 0;
163-
#endif
164151
}
165152

166153
enum zone_watermarks {

‎include/linux/page-flags.h‎

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -95,9 +95,7 @@ enum pageflags {
9595
PG_reclaim, /* To be reclaimed asap */
9696
PG_buddy, /* Page is free, on buddy lists */
9797
PG_swapbacked, /* Page is backed by RAM/swap */
98-
#ifdef CONFIG_UNEVICTABLE_LRU
9998
PG_unevictable, /* Page is "unevictable" */
100-
#endif
10199
#ifdef CONFIG_HAVE_MLOCKED_PAGE_BIT
102100
PG_mlocked, /* Page is vma mlocked */
103101
#endif
@@ -248,14 +246,8 @@ PAGEFLAG_FALSE(SwapCache)
248246
SETPAGEFLAG_NOOP(SwapCache) CLEARPAGEFLAG_NOOP(SwapCache)
249247
#endif
250248

251-
#ifdef CONFIG_UNEVICTABLE_LRU
252249
PAGEFLAG(Unevictable, unevictable) __CLEARPAGEFLAG(Unevictable, unevictable)
253250
TESTCLEARFLAG(Unevictable, unevictable)
254-
#else
255-
PAGEFLAG_FALSE(Unevictable) TESTCLEARFLAG_FALSE(Unevictable)
256-
SETPAGEFLAG_NOOP(Unevictable) CLEARPAGEFLAG_NOOP(Unevictable)
257-
__CLEARPAGEFLAG_NOOP(Unevictable)
258-
#endif
259251

260252
#ifdef CONFIG_HAVE_MLOCKED_PAGE_BIT
261253
#define MLOCK_PAGES 1
@@ -382,12 +374,6 @@ static inline void __ClearPageTail(struct page *page)
382374

383375
#endif /* !PAGEFLAGS_EXTENDED */
384376

385-
#ifdef CONFIG_UNEVICTABLE_LRU
386-
#define __PG_UNEVICTABLE (1 << PG_unevictable)
387-
#else
388-
#define __PG_UNEVICTABLE 0
389-
#endif
390-
391377
#ifdef CONFIG_HAVE_MLOCKED_PAGE_BIT
392378
#define __PG_MLOCKED (1 << PG_mlocked)
393379
#else
@@ -403,7 +389,7 @@ static inline void __ClearPageTail(struct page *page)
403389
1 << PG_private | 1 << PG_private_2 | \
404390
1 << PG_buddy | 1 << PG_writeback | 1 << PG_reserved | \
405391
1 << PG_slab | 1 << PG_swapcache | 1 << PG_active | \
406-
__PG_UNEVICTABLE | __PG_MLOCKED)
392+
1 << PG_unevictable | __PG_MLOCKED)
407393

408394
/*
409395
* Flags checked when a page is prepped for return by the page allocator.

‎include/linux/pagemap.h‎

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,7 @@ enum mapping_flags {
2222
AS_EIO = __GFP_BITS_SHIFT + 0, /* IO error on async write */
2323
AS_ENOSPC = __GFP_BITS_SHIFT + 1, /* ENOSPC on async write */
2424
AS_MM_ALL_LOCKS = __GFP_BITS_SHIFT + 2, /* under mm_take_all_locks() */
25-
#ifdef CONFIG_UNEVICTABLE_LRU
2625
AS_UNEVICTABLE = __GFP_BITS_SHIFT + 3, /* e.g., ramdisk, SHM_LOCK */
27-
#endif
2826
};
2927

3028
static inline void mapping_set_error(struct address_space *mapping, int error)
@@ -37,8 +35,6 @@ static inline void mapping_set_error(struct address_space *mapping, int error)
3735
}
3836
}
3937

40-
#ifdef CONFIG_UNEVICTABLE_LRU
41-
4238
static inline void mapping_set_unevictable(struct address_space *mapping)
4339
{
4440
set_bit(AS_UNEVICTABLE, &mapping->flags);
@@ -55,14 +51,6 @@ static inline int mapping_unevictable(struct address_space *mapping)
5551
return test_bit(AS_UNEVICTABLE, &mapping->flags);
5652
return !!mapping;
5753
}
58-
#else
59-
static inline void mapping_set_unevictable(struct address_space *mapping) { }
60-
static inline void mapping_clear_unevictable(struct address_space *mapping) { }
61-
static inline int mapping_unevictable(struct address_space *mapping)
62-
{
63-
return 0;
64-
}
65-
#endif
6654

6755
static inline gfp_t mapping_gfp_mask(struct address_space * mapping)
6856
{

‎include/linux/rmap.h‎

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -105,18 +105,11 @@ unsigned long page_address_in_vma(struct page *, struct vm_area_struct *);
105105
*/
106106
int page_mkclean(struct page *);
107107

108-
#ifdef CONFIG_UNEVICTABLE_LRU
109108
/*
110109
* called in munlock()/munmap() path to check for other vmas holding
111110
* the page mlocked.
112111
*/
113112
int try_to_munlock(struct page *);
114-
#else
115-
static inline int try_to_munlock(struct page *page)
116-
{
117-
return 0; /* a.k.a. SWAP_SUCCESS */
118-
}
119-
#endif
120113

121114
#else /* !CONFIG_MMU */
122115

‎include/linux/swap.h‎

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,6 @@ static inline int zone_reclaim(struct zone *z, gfp_t mask, unsigned int order)
235235
}
236236
#endif
237237

238-
#ifdef CONFIG_UNEVICTABLE_LRU
239238
extern int page_evictable(struct page *page, struct vm_area_struct *vma);
240239
extern void scan_mapping_unevictable_pages(struct address_space *);
241240

@@ -244,24 +243,6 @@ extern int scan_unevictable_handler(struct ctl_table *, int, struct file *,
244243
void __user *, size_t *, loff_t *);
245244
extern int scan_unevictable_register_node(struct node *node);
246245
extern void scan_unevictable_unregister_node(struct node *node);
247-
#else
248-
static inline int page_evictable(struct page *page,
249-
struct vm_area_struct *vma)
250-
{
251-
return 1;
252-
}
253-
254-
static inline void scan_mapping_unevictable_pages(struct address_space *mapping)
255-
{
256-
}
257-
258-
static inline int scan_unevictable_register_node(struct node *node)
259-
{
260-
return 0;
261-
}
262-
263-
static inline void scan_unevictable_unregister_node(struct node *node) { }
264-
#endif
265246

266247
extern int kswapd_run(int nid);
267248

‎include/linux/vmstat.h‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ enum vm_event_item { PGPGIN, PGPGOUT, PSWPIN, PSWPOUT,
4141
#ifdef CONFIG_HUGETLB_PAGE
4242
HTLB_BUDDY_PGALLOC, HTLB_BUDDY_PGALLOC_FAIL,
4343
#endif
44-
#ifdef CONFIG_UNEVICTABLE_LRU
4544
UNEVICTABLE_PGCULLED, /* culled to noreclaim list */
4645
UNEVICTABLE_PGSCANNED, /* scanned for reclaimability */
4746
UNEVICTABLE_PGRESCUED, /* rescued from noreclaim list */
@@ -50,7 +49,6 @@ enum vm_event_item { PGPGIN, PGPGOUT, PSWPIN, PSWPOUT,
5049
UNEVICTABLE_PGCLEARED, /* on COW, page truncate */
5150
UNEVICTABLE_PGSTRANDED, /* unable to isolate on unlock */
5251
UNEVICTABLE_MLOCKFREED,
53-
#endif
5452
NR_VM_EVENT_ITEMS
5553
};
5654

‎kernel/sysctl.c‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1325,7 +1325,6 @@ static struct ctl_table vm_table[] = {
13251325
.extra2 = &one,
13261326
},
13271327
#endif
1328-
#ifdef CONFIG_UNEVICTABLE_LRU
13291328
{
13301329
.ctl_name = CTL_UNNUMBERED,
13311330
.procname = "scan_unevictable_pages",
@@ -1334,7 +1333,6 @@ static struct ctl_table vm_table[] = {
13341333
.mode = 0644,
13351334
.proc_handler = &scan_unevictable_handler,
13361335
},
1337-
#endif
13381336
/*
13391337
* NOTE: do not add new entries to this table unless you have read
13401338
* Documentation/sysctl/ctl_unnumbered.txt

0 commit comments

Comments
 (0)