Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 83792
b: refs/heads/master
c: 91a4547
h: refs/heads/master
v: v3
  • Loading branch information
KAMEZAWA Hiroyuki authored and Linus Torvalds committed Feb 7, 2008
1 parent 13092bd commit b55ad63
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: df878fb04dea044378274d40d063279a9cb787fb
refs/heads/master: 91a45470f7ddc322073752e711a2e8dcbc339e6f
17 changes: 12 additions & 5 deletions trunk/mm/vmscan.c
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,12 @@ long vm_total_pages; /* The total number of pages which the VM controls */
static LIST_HEAD(shrinker_list);
static DECLARE_RWSEM(shrinker_rwsem);

#ifdef CONFIG_CGROUP_MEM_CONT
#define scan_global_lru(sc) (!(sc)->mem_cgroup)
#else
#define scan_global_lru(sc) (1)
#endif

/*
* Add a shrinker callback to be called from the vm
*/
Expand Down Expand Up @@ -1280,11 +1286,12 @@ static unsigned long do_try_to_free_pages(struct zone **zones, gfp_t gfp_mask,
* Don't shrink slabs when reclaiming memory from
* over limit cgroups
*/
if (sc->mem_cgroup == NULL)
if (scan_global_lru(sc)) {
shrink_slab(sc->nr_scanned, gfp_mask, lru_pages);
if (reclaim_state) {
nr_reclaimed += reclaim_state->reclaimed_slab;
reclaim_state->reclaimed_slab = 0;
if (reclaim_state) {
nr_reclaimed += reclaim_state->reclaimed_slab;
reclaim_state->reclaimed_slab = 0;
}
}
total_scanned += sc->nr_scanned;
if (nr_reclaimed >= sc->swap_cluster_max) {
Expand All @@ -1311,7 +1318,7 @@ static unsigned long do_try_to_free_pages(struct zone **zones, gfp_t gfp_mask,
congestion_wait(WRITE, HZ/10);
}
/* top priority shrink_caches still had more to do? don't OOM, then */
if (!sc->all_unreclaimable && sc->mem_cgroup == NULL)
if (!sc->all_unreclaimable && scan_global_lru(sc))
ret = 1;
out:
/*
Expand Down

0 comments on commit b55ad63

Please sign in to comment.