File tree 2 files changed +4
-25
lines changed 2 files changed +4
-25
lines changed Original file line number Diff line number Diff line change 4
4
#include <linux/huge_mm.h>
5
5
#include <linux/swap.h>
6
6
7
- #ifdef CONFIG_HIGHMEM
8
- extern atomic_t highmem_file_pages ;
9
-
10
- static inline void acct_highmem_file_pages (int zid , enum lru_list lru ,
11
- int nr_pages )
12
- {
13
- if (is_highmem_idx (zid ) && is_file_lru (lru ))
14
- atomic_add (nr_pages , & highmem_file_pages );
15
- }
16
- #else
17
- static inline void acct_highmem_file_pages (int zid , enum lru_list lru ,
18
- int nr_pages )
19
- {
20
- }
21
- #endif
22
-
23
7
/**
24
8
* page_is_file_cache - should the page be on a file LRU or anon LRU?
25
9
* @page: the page to test
@@ -47,7 +31,6 @@ static __always_inline void __update_lru_size(struct lruvec *lruvec,
47
31
__mod_node_page_state (pgdat , NR_LRU_BASE + lru , nr_pages );
48
32
__mod_zone_page_state (& pgdat -> node_zones [zid ],
49
33
NR_ZONE_LRU_BASE + lru , nr_pages );
50
- acct_highmem_file_pages (zid , lru , nr_pages );
51
34
}
52
35
53
36
static __always_inline void update_lru_size (struct lruvec * lruvec ,
Original file line number Diff line number Diff line change @@ -299,17 +299,13 @@ static unsigned long node_dirtyable_memory(struct pglist_data *pgdat)
299
299
300
300
return nr_pages ;
301
301
}
302
- #ifdef CONFIG_HIGHMEM
303
- atomic_t highmem_file_pages ;
304
- #endif
305
302
306
303
static unsigned long highmem_dirtyable_memory (unsigned long total )
307
304
{
308
305
#ifdef CONFIG_HIGHMEM
309
306
int node ;
310
- unsigned long x ;
307
+ unsigned long x = 0 ;
311
308
int i ;
312
- unsigned long dirtyable = 0 ;
313
309
314
310
for_each_node_state (node , N_HIGH_MEMORY ) {
315
311
for (i = ZONE_NORMAL + 1 ; i < MAX_NR_ZONES ; i ++ ) {
@@ -326,12 +322,12 @@ static unsigned long highmem_dirtyable_memory(unsigned long total)
326
322
nr_pages = zone_page_state (z , NR_FREE_PAGES );
327
323
/* watch for underflows */
328
324
nr_pages -= min (nr_pages , high_wmark_pages (z ));
329
- dirtyable += nr_pages ;
325
+ nr_pages += zone_page_state (z , NR_ZONE_INACTIVE_FILE );
326
+ nr_pages += zone_page_state (z , NR_ZONE_ACTIVE_FILE );
327
+ x += nr_pages ;
330
328
}
331
329
}
332
330
333
- x = dirtyable + atomic_read (& highmem_file_pages );
334
-
335
331
/*
336
332
* Unreclaimable memory (kernel memory or anonymous memory
337
333
* without swap) can bring down the dirtyable pages below
You can’t perform that action at this time.
0 commit comments