lkml.org 
[lkml]   [2009]   [Mar]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 4/4] Memory controller soft limit reclaim on contention (v3)
* KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com> [2009-03-03 11:43:49]:

> > * KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com> [2009-03-02 12:08:01]:
> >
> > > Hi Balbir,
> > >
> > > > @@ -2015,9 +2016,12 @@ static int kswapd(void *p)
> > > > finish_wait(&pgdat->kswapd_wait, &wait);
> > > >
> > > > if (!try_to_freeze()) {
> > > > + struct zonelist *zl = pgdat->node_zonelists;
> > > > /* We can speed up thawing tasks if we don't call
> > > > * balance_pgdat after returning from the refrigerator
> > > > */
> > > > + if (!order)
> > > > + mem_cgroup_soft_limit_reclaim(zl, GFP_KERNEL);
> > > > balance_pgdat(pgdat, order);
> > > > }
> > > > }
> > >
> > > kswapd's roll is increasing free pages until zone->pages_high in "own node".
> > > mem_cgroup_soft_limit_reclaim() free one (or more) exceed page in any node.
> > >
> > > Oh, well.
> > > I think it is not consistency.
> > >
> > > if mem_cgroup_soft_limit_reclaim() is aware to target node and its pages_high,
> > > I'm glad.
> >
> > Yes, correct the role of kswapd is to keep increasing free pages until
> > zone->pages_high and the first set of pages to consider is the memory
> > controller over their soft limits. We pass the zonelist to ensure that
> > while doing soft reclaim, we focus on the zonelist associated with the
> > node. Kamezawa had concernes over calling the soft limit reclaim from
> > __alloc_pages_internal(), did you prefer that call path?
>
> I read your patch again.
> So, mem_cgroup_soft_limit_reclaim() caller place seems in balance_pgdat() is better.
>
> Please imazine most bad scenario.
> CPU0 (kswapd) take to continue shrinking.
> CPU1 take another activity and charge memcg conteniously.
> At that time, balance_pgdat() don't exit very long time. then
> mem_cgroup_soft_limit_reclaim() is never called.
>

Yes, true... that is why I added the hooks in __alloc_pages_internal()
in the first two revisions, but Kamezawa objected to them. In the
scenario that you mention that balance_pgdat() is busy, if we are
under global system memory pressure, even after freeing memory from
soft limited cgroups, we don't have sufficient free memory. We need to
go reclaim from the whole system. An administrator can easily avoid
the above scenario by using hard limits on the cgroup running on CPU1.

> In ideal, if another cpu take another charge, kswapd should shrink
> soft limit again.
>

Could you please elaborate further?

>
> btw, I don't like "if (!order)" condition. memcg soft limit sould be
> always shrinked although
> it's the order of because wakeup_kswapd() argument is merely hint.
>
> another process want another order.
>

Agreed, I'll remove the check.

>
>
> --
> To unsubscribe, send a message with 'unsubscribe linux-mm' in
> the body to majordomo@kvack.org. For more info on Linux MM,
> see: http://www.linux-mm.org/ .
> Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
>

--
Balbir


\
 
 \ /
  Last update: 2009-03-03 12:19    [W:0.194 / U:0.368 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site