From: Greg KH <gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org>
To: Shaun Tancheff <shaun.tancheff-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: Johannes Weiner <hannes-druUgvl0LCNAfugRpC6u6w@public.gmane.org>,
Michal Hocko <mhocko-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
Vladimir Davydov
<vdavydov.dev-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
Shaun Tancheff <shaun.tancheff-ZPxbGqLxI0U@public.gmane.org>,
Andrew Morton
<akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org>,
cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-mm-Bw31MaZKKs3YtjvyW6yDsg@public.gmane.org,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH] memcg-v1: Enable setting memory min, low, high
Date: Wed, 5 Apr 2023 16:21:31 +0200 [thread overview]
Message-ID: <2023040500-drinking-obvious-bd85@gregkh> (raw)
In-Reply-To: <CAJ48U8X28dhTWouqeT83Uqys__qf2+z-6NcdC1SbOr_xOzjgWg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
On Wed, Apr 05, 2023 at 08:54:07PM +0700, Shaun Tancheff wrote:
> On Wed, Apr 5, 2023 at 6:23 PM Greg KH <gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org> wrote:
>
> > On Wed, Apr 05, 2023 at 06:01:07PM +0700, Shaun Tancheff wrote:
> > > From: Shaun Tancheff <shaun.tancheff-ZPxbGqLxI0U@public.gmane.org>
> > >
> > > For users that are unable to update to memcg-v2 this
> > > provides a method where memcg-v1 can more effectively
> > > apply enough memory pressure to effectively throttle
> > > filesystem I/O or otherwise minimize being memcg oom
> > > killed at the expense of reduced performance.
> > >
> > > This patch extends the memcg-v1 legacy sysfs entries
> > > with:
> > > limit_in_bytes.min, limit_in_bytes.low and
> > > limit_in_bytes.high
> > > Since old software will need to be updated to take
> > > advantage of the new files a secondary method
> > > of setting min, low and high based on a percentage
> > > of the limit is also provided. The percentages
> > > are determined by module parameters.
> > >
> > > The available module parameters can be set at
> > > kernel boot time, for example:
> > > memcontrol.memcg_min=10
> > > memcontrol.memcg_low=30
> > > memcontrol.memcg_high=80
> > >
> > > Would set min to 10%, low to 30% and high to 80% of
> > > the value written to:
> > > /sys/fs/cgroup/memory/<grp>/memory.limit_in_bytes
> > >
> > > Signed-off-by: Shaun Tancheff <shaun.tancheff-ZPxbGqLxI0U@public.gmane.org>
> > > ---
> > > v0: Initial hard coded limits by percent.
> > > v1: Added sysfs access and module parameters for percent values to enable
> > > v2: Fix 32-bit, remove need for missing __udivdi3
> > > mm/memcontrol.c | 83 ++++++++++++++++++++++++++++++++++++++++++++++++-
> > > 1 file changed, 82 insertions(+), 1 deletion(-)
> > >
> > > diff --git a/mm/memcontrol.c b/mm/memcontrol.c
> > > index 2eee092f8f11..3cf8386f4f45 100644
> > > --- a/mm/memcontrol.c
> > > +++ b/mm/memcontrol.c
> > > @@ -73,6 +73,18 @@
> > >
> > > #include <trace/events/vmscan.h>
> > >
> > > +static unsigned int memcg_v1_min_default_percent;
> > > +module_param_named(memcg_min, memcg_v1_min_default_percent, uint, 0600);
> > > +MODULE_PARM_DESC(memcg_min, "memcg v1 min default percent");
> > > +
> > > +static unsigned int memcg_v1_low_default_percent;
> > > +module_param_named(memcg_low, memcg_v1_low_default_percent, uint, 0600);
> > > +MODULE_PARM_DESC(memcg_low, "memcg v1 low default percent");
> > > +
> > > +static unsigned int memcg_v1_high_default_percent;
> > > +module_param_named(memcg_high, memcg_v1_high_default_percent, uint,
> > 0600);
> > > +MODULE_PARM_DESC(memcg_high, "memcg v1 high default percent");
> >
> > This is not the 1990's, why are you using module parameters for this?
> >
> And this isn't a module, so why use module options, how are you supposed
> > to set them?
> >
> Ah .. guess I'm a bit out of date.
> The can be set either on the kernel command line or through sysfs,
> nominally
> /sys/module/memcontrol/parameters/memcg_high
> /sys/module/memcontrol/parameters/memcg_low
> /sys/module/memcontrol/parameters/memcg_min
But again, memcontrol is not a module, right?
> I will look at making these sysctl values instead.
Yeah, just stick with that please.
thanks,
greg k-h
next prev parent reply other threads:[~2023-04-05 14:21 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-05 11:01 [PATCH] memcg-v1: Enable setting memory min, low, high Shaun Tancheff
2023-04-05 11:23 ` Greg KH
[not found] ` <CAJ48U8X28dhTWouqeT83Uqys__qf2+z-6NcdC1SbOr_xOzjgWg@mail.gmail.com>
[not found] ` <CAJ48U8X28dhTWouqeT83Uqys__qf2+z-6NcdC1SbOr_xOzjgWg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2023-04-05 14:21 ` Greg KH [this message]
-- strict thread matches above, loose matches on Subject: below --
2023-04-04 20:50 Shaun Tancheff
2023-04-05 2:20 ` kernel test robot
2023-04-05 3:52 ` kernel test robot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=2023040500-drinking-obvious-bd85@gregkh \
--to=gregkh-hqyy1w1ycw8ekmwlsbkhg0b+6bgklq7r@public.gmane.org \
--cc=akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org \
--cc=cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=hannes-druUgvl0LCNAfugRpC6u6w@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-mm-Bw31MaZKKs3YtjvyW6yDsg@public.gmane.org \
--cc=mhocko-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
--cc=shaun.tancheff-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=shaun.tancheff-ZPxbGqLxI0U@public.gmane.org \
--cc=vdavydov.dev-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox