Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 19375
b: refs/heads/master
c: 2a16e3f
h: refs/heads/master
i:
  19373: 4a57274
  19371: 56ba5ce
  19367: e7cab23
  19359: c627961
v: v3
  • Loading branch information
Christoph Lameter authored and Linus Torvalds committed Feb 1, 2006
1 parent 0eba9d4 commit 83f0e33
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 1b2ffb7896ad46067f5b9ebf7de1891d74a4cdef
refs/heads/master: 2a16e3f4b0c408b9e50297d2ec27e295d490267a
6 changes: 6 additions & 0 deletions trunk/Documentation/sysctl/vm.txt
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ This is value ORed together of
1 = Zone reclaim on
2 = Zone reclaim writes dirty pages out
4 = Zone reclaim swaps pages
8 = Also do a global slab reclaim pass

zone_reclaim_mode is set during bootup to 1 if it is determined that pages
from remote zones will cause a measurable performance reduction. The
Expand All @@ -160,6 +161,11 @@ Allowing regular swap effectively restricts allocations to the local
node unless explicitly overridden by memory policies or cpuset
configurations.

It may be advisable to allow slab reclaim if the system makes heavy
use of files and builds up large slab caches. However, the slab
shrink operation is global, may take a long time and free slabs
in all nodes of the system.

================================================================

zone_reclaim_interval:
Expand Down
14 changes: 14 additions & 0 deletions trunk/mm/vmscan.c
Original file line number Diff line number Diff line change
Expand Up @@ -1596,6 +1596,7 @@ int zone_reclaim_mode __read_mostly;
#define RECLAIM_ZONE (1<<0) /* Run shrink_cache on the zone */
#define RECLAIM_WRITE (1<<1) /* Writeout pages during reclaim */
#define RECLAIM_SWAP (1<<2) /* Swap pages out during reclaim */
#define RECLAIM_SLAB (1<<3) /* Do a global slab shrink if the zone is out of memory */

/*
* Mininum time between zone reclaim scans
Expand Down Expand Up @@ -1666,6 +1667,19 @@ int zone_reclaim(struct zone *zone, gfp_t gfp_mask, unsigned int order)

} while (sc.nr_reclaimed < nr_pages && sc.priority > 0);

if (sc.nr_reclaimed < nr_pages && (zone_reclaim_mode & RECLAIM_SLAB)) {
/*
* shrink_slab does not currently allow us to determine
* how many pages were freed in the zone. So we just
* shake the slab and then go offnode for a single allocation.
*
* shrink_slab will free memory on all zones and may take
* a long time.
*/
shrink_slab(sc.nr_scanned, gfp_mask, order);
sc.nr_reclaimed = 1; /* Avoid getting the off node timeout */
}

p->reclaim_state = NULL;
current->flags &= ~PF_MEMALLOC;

Expand Down

0 comments on commit 83f0e33

Please sign in to comment.