History

[PATCH] zone_reclaim: minor fixes

- If we only reclaim nr_pages then its okay to stay on node. Switch from > to >= for the comparison. - vm_table[] entry for zone_reclaim_mode is a bit screwed up. - Add empty lines around shrink_zone to show that this is the central function to be called.

Christoph Lameter committed 20 years ago

Commit c84db231 parent 52a83632 files · +5 −2Browse files

Unified · Split

2 files
  1. kernel/sysctl.c +2 −1
  2. mm/vmscan.c +3 −1
kernel/sysctl.c+2−1
@@ -878,7 +878,8 @@ static ctl_table vm_table[] = { · 877 unmodified lines
878878 .maxlen = sizeof(zone_reclaim_mode),
879879 .mode = 0644,
880880 .proc_handler = &proc_dointvec,
881− .strategy = &zero,
881+ .strategy = &sysctl_intvec,
882+ .extra1 = &zero,
882883 },
883884 #endif
884885 { .ctl_name = 0 }
mm/vmscan.c+3−1
@@ -1636,14 +1636,16 @@ int zone_reclaim(struct zone *zone, gfp_t gfp_mask, unsigned int order) · 1635 unmodified lines
16361636 p->flags |= PF_MEMALLOC;
16371637 reclaim_state.reclaimed_slab = 0;
16381638 p->reclaim_state = &reclaim_state;
1639+
16391640 shrink_zone(zone, &sc);
1641+
16401642 p->reclaim_state = NULL;
16411643 current->flags &= ~PF_MEMALLOC;
16421644
16431645 if (sc.nr_reclaimed == 0)
16441646 zone->last_unsuccessful_zone_reclaim = jiffies;
16451647
1646− return sc.nr_reclaimed > nr_pages;
1648+ return sc.nr_reclaimed >= nr_pages;
16471649 }
16481650 #endif
16491651