mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-22 06:41:39 +00:00
mm: count only reclaimable lru pages
global_lru_pages() / zone_lru_pages() can be used in two ways: - to estimate max reclaimable pages in determine_dirtyable_memory() - to calculate the slab scan ratio When swap is full or not present, the anon lru lists are not reclaimable and also won't be scanned. So the anon pages shall not be counted in both usage scenarios. Also rename to _reclaimable_pages: now they are counting the possibly reclaimable lru pages. It can greatly (and correctly) increase the slab scan rate under high memory pressure (when most file pages have been reclaimed and swap is full/absent), thus reduce false OOM kills. Acked-by: Peter Zijlstra <a.p.zijlstra@chello.nl> Reviewed-by: Rik van Riel <riel@redhat.com> Reviewed-by: Christoph Lameter <cl@linux-foundation.org> Reviewed-by: Minchan Kim <minchan.kim@gmail.com> Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com> Signed-off-by: Wu Fengguang <fengguang.wu@intel.com> Acked-by: Johannes Weiner <hannes@cmpxchg.org> Reviewed-by: Minchan Kim <minchan.kim@gmail.com> Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org> Cc: David Howells <dhowells@redhat.com> Cc: "Li, Ming Chun" <macli@brc.ubc.ca> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
55c37a840d
commit
adea02a1be
3 changed files with 44 additions and 22 deletions
|
@ -166,15 +166,8 @@ static inline unsigned long zone_page_state(struct zone *zone,
|
|||
return x;
|
||||
}
|
||||
|
||||
extern unsigned long global_lru_pages(void);
|
||||
|
||||
static inline unsigned long zone_lru_pages(struct zone *zone)
|
||||
{
|
||||
return (zone_page_state(zone, NR_ACTIVE_ANON)
|
||||
+ zone_page_state(zone, NR_ACTIVE_FILE)
|
||||
+ zone_page_state(zone, NR_INACTIVE_ANON)
|
||||
+ zone_page_state(zone, NR_INACTIVE_FILE));
|
||||
}
|
||||
extern unsigned long global_reclaimable_pages(void);
|
||||
extern unsigned long zone_reclaimable_pages(struct zone *zone);
|
||||
|
||||
#ifdef CONFIG_NUMA
|
||||
/*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue