Messages in this thread | | | Date | Mon, 5 May 2008 14:21:15 +0900 | From | "minchan Kim" <> | Subject | Re: [-mm][PATCH 4/5] core of reclaim throttle |
| |
> @@ -120,6 +125,7 @@ struct scan_control { > int vm_swappiness = 60; > long vm_total_pages; /* The total number of pages which the VM controls */ > > +#define MAX_RECLAIM_TASKS CONFIG_NR_MAX_RECLAIM_TASKS_PER_ZONE > static LIST_HEAD(shrinker_list); > static DECLARE_RWSEM(shrinker_rwsem); > > @@ -1187,7 +1193,46 @@ static int shrink_zone(int priority, str > > unsigned long nr_inactive; > unsigned long nr_to_scan; > unsigned long nr_reclaimed = 0; > + int ret = 0; > + int throttle_on = 0; > + unsigned long freed; > + unsigned long threshold; > > + > + /* avoid recursing wait_evnet */ > + if (current->flags & PF_RECLAIMING) > + goto shrinking; > + > + throttle_on = 1; > + current->flags |= PF_RECLAIMING; > + wait_event(zone->reclaim_throttle_waitq, > + atomic_add_unless(&zone->nr_reclaimers, 1, MAX_RECLAIM_TASKS)); > + > + /* in some situation (e.g. hibernation), shrink processing shouldn't be > + cut off even though large memory freeded. */ > + if (!sc->may_cut_off) > + goto shrinking; > +
where do you initialize may_cut_off ? Current Implementation, may_cut_off is always "0" so always goto shrinking -- Thanks, barrios
| |