Re: [PATCH v3] memcg: event control at vmpressure.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed 19-06-13 20:25:03, Hyunhee Kim wrote:
> 2013/6/18 Michal Hocko <mhocko@xxxxxxx>:
> > On Tue 18-06-13 17:00:06, Hyunhee Kim wrote:
> >> 2013/6/18 Hyunhee Kim <hyunhee.kim@xxxxxxxxxxx>:
> >> > 2013/6/17 Michal Hocko <mhocko@xxxxxxx>:
> >> >> On Mon 17-06-13 20:30:11, Hyunhee Kim wrote:
> >> >> [...]
> >> >>> diff --git a/mm/vmpressure.c b/mm/vmpressure.c
> >> >>> index 736a601..a18fdb3 100644
> >> >>> --- a/mm/vmpressure.c
> >> >>> +++ b/mm/vmpressure.c
> >> >> [...]
> >> >>> @@ -150,14 +151,16 @@ static bool vmpressure_event(struct vmpressure *vmpr,
> >> >>>       level = vmpressure_calc_level(scanned, reclaimed);
> >> >>>
> >> >>>       mutex_lock(&vmpr->events_lock);
> >> >>> -
> >> >>>       list_for_each_entry(ev, &vmpr->events, node) {
> >> >>>               if (level >= ev->level) {
> >> >>> +                     if (ev->edge_trigger && (level == vmpr->last_level
> >> >>
> >> >>> +                             || level != ev->level))
> >> >>
> >> >> Hmm, why this differs from the "always" semantic? You do not want to see
> >> >> lower events? Why?
> >> >
> >> > Yes, I didn't want to see every lower level events whenever the higher
> >> > level event occurs because the higher event signal implies that the
> >> > lower memory situation also occurs.
> >
> > Is there any guarantee that such a condition would be also signalled?
> 
> I think so. In the original implementation, ev is signaled if (level
> >= ev->level).
> This means that on "level == CRITICAL", LOW and MEDIUM are always
> signaled if these are registered and somebody listen to them.

But there is no guarantee that LOW and/or MEDIUM events are triggered
actually because the vmpressure calculation can jump directly to
CRITICAL. Just imagine a case when it is really hard to reclaim anything
at all (pages are dirty and need to be written back first etc.).

> What I wanted to do can be seperated two parts: (1) don't send signals
> if the current level is same as the last level. (2) only send the
> current level not every lower level.
>
> But, I think that (1) is more close to "edge trigger" and I'll
> implement "edge trigger".

OK
-- 
Michal Hocko
SUSE Labs

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




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]