Re: [PATCH 2/2] mm: Consider subtrees in memory.events
From: Michal Hocko
Date: Mon Jan 28 2019 - 10:19:05 EST
On Mon 28-01-19 06:54:07, Tejun Heo wrote:
> On Mon, Jan 28, 2019 at 03:52:10PM +0100, Michal Hocko wrote:
> > > All .events files generate aggregated stateful notifications. For
> > > anyone to do anything, they'd have to remember the previous state to
> > > identify what actually happened. Being hierarchical, it'd of course
> > > need to walk down when an event triggers.
> > And how do you do that in a raceless fashion?
> Hmm... I'm having trouble imagining why this would be a problem. How
> would it race?
How do you make an atomic snapshot of the hierarchy state? Or you do
not need it because event counters are monotonic and you are willing to
sacrifice some lost or misinterpreted events? For example, you receive
an oom event while the two children increase the oom event counter. How
do you tell which one was the source of the event and which one is still
pending? Or is the ordering unimportant in general?
I can imagine you can live with this model, but having a hierarchical
reporting without a source of the event just sounds too clumsy from my
POV. But I guess this is getting tangent to the original patch.