Re: [PATCH] vmevent: Use 'struct vmevent_attr' for vmevent_fd() ABI

From: Anton Vorontsov
Date: Tue Mar 06 2012 - 17:59:43 EST


On Tue, Mar 06, 2012 at 10:51:19PM +0200, Pekka Enberg wrote:
> This patch introduces 'struct vmevent_attr' and converts the vmevent_fd() ABI
> to use it which makes the ABI much more flexible.
>
> Originally-by: Leonid Moiseichuk <leonid.moiseichuk@xxxxxxxxx>
> Cc: David Rientjes <rientjes@xxxxxxxxxx>
> Cc: Anton Vorontsov <anton.vorontsov@xxxxxxxxxx>
> Signed-off-by: Pekka Enberg <penberg@xxxxxxxxxx>
> ---

Sorry for hijacking this thread, but speaking of big
changes. Are there any plans or ideas to add other methods
of sampling, i.e. something not timer-based?

I like how it's done for cgroups, i.e. via rate-limited events
(and the events are "page alloc/free").

But doing this cgroup-way would probably dismiss the point of
"lightweight" notifications.

Though, current vmevent seems not so lightweigh in sense of
battery usage and accuracy (i.e. how quick we're able to
detect the crossed threshold). To get better accuracy we
would need to run timer at higher frequencies, but then we
would waste more battery.

Sure, vmevent is still lightweight in sense that it does not
cause much runtime overhead or memory wastage (unlike cgroups).

The only idea I have for vmevent is to make some hybrid: timer
plus shrinker API. That way we would detect "low memory" events
fast enough via shrinker API, and thus run timer at low freq.

But we would still have a running timer, which would wake up
a system periodically, which is still quite bad. :-/

Thanks,

--
Anton Vorontsov
Email: cbouatmailru@xxxxxxxxx
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/