Re: [PATCH 1/3] Add a new field to struct shrinker

From: Rik van Riel
Date: Mon Jul 11 2016 - 10:37:34 EST


On Mon, 2016-07-11 at 08:37 +0200, Michal Hocko wrote:
> On Sat 09-07-16 04:43:31, Janani Ravichandran wrote:
> > Struct shrinker does not have a field to uniquely identify the
> > shrinkers
> > it represents. It would be helpful to have a new field to hold
> > names of
> > shrinkers. This information would be useful while analyzing their
> > behavior using tracepoints.
>
> This will however increase the vmlinux size even when no tracing is
> enabled. Why cannot we simply print the name of the shrinker
> callbacks?

What mechanism do you have in mind for obtaining the name,
Michal?

> > ---
> > Âinclude/linux/shrinker.h | 1 +
> > Â1 file changed, 1 insertion(+)
> >
> > diff --git a/include/linux/shrinker.h b/include/linux/shrinker.h
> > index 4fcacd9..431125c 100644
> > --- a/include/linux/shrinker.h
> > +++ b/include/linux/shrinker.h
> > @@ -52,6 +52,7 @@ struct shrinker {
> > Â unsigned long (*scan_objects)(struct shrinker *,
> > Â ÂÂÂÂÂÂstruct shrink_control *sc);
> > Â
> > + const char *name;
> > Â int seeks; /* seeks to recreate an obj */
> > Â long batch; /* reclaim batch size, 0 = default */
> > Â unsigned long flags;
> > --Â
> > 2.7.0
> >
> > --
> > To unsubscribe, send a message with 'unsubscribe linux-mm' in
> > the body to majordomo@xxxxxxxxxxÂÂFor more info on Linux MM,
> > see: http://www.linux-mm.org/ .
> > Don't email: <a href=mailto:"dont@xxxxxxxxx";> email@xxxxxxxxx </a>
>
--

All Rights Reversed.

Attachment: signature.asc
Description: This is a digitally signed message part