From: Nhat Pham <nphamcs@gmail.com>
To: Chris Li <chrisl@kernel.org>
Cc: Yosry Ahmed <yosryahmed@google.com>,
akpm@linux-foundation.org, tj@kernel.org,
lizefan.x@bytedance.com, hannes@cmpxchg.org,
cerasuolodomenico@gmail.com, sjenning@redhat.com,
ddstreet@ieee.org, vitaly.wool@konsulko.com, mhocko@kernel.org,
roman.gushchin@linux.dev, shakeelb@google.com,
muchun.song@linux.dev, hughd@google.com, corbet@lwn.net,
konrad.wilk@oracle.com, senozhatsky@chromium.org,
rppt@kernel.org, linux-mm@kvack.org, kernel-team@meta.com,
linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org,
david@ixit.cz
Subject: Re: [RFC PATCH v3] zswap: memcontrol: implement zswap writeback disabling
Date: Wed, 8 Nov 2023 19:08:50 -0800 [thread overview]
Message-ID: <CAKEwX=Pvf4wj6HrtFvqgWQghsAmOpYnU=1S3b0iMePBQdP_i7Q@mail.gmail.com> (raw)
In-Reply-To: <CAF8kJuPgWjim82+HmEgkkWrDNwi2co-3ay-35fjoLb8-k9rNXQ@mail.gmail.com>
On Wed, Nov 8, 2023 at 6:41 PM Chris Li <chrisl@kernel.org> wrote:
>
> Hi Nhant,
>
> On Fri, Nov 3, 2023 at 12:24 PM Nhat Pham <nphamcs@gmail.com> wrote:
> > >
> > > Would it be more convenient if the initial value is inherited from the
> > > parent (the root starts with true)?
> > >
> > > I can see this being useful if we want to set it to false on the
> > > entire machine or one a parent cgroup, we can set it before creating
> > > any children instead of setting it to 0 every time we create a new
> > > cgroup.
> >
> > I'm not 100% sure about the benefit or have a strong opinion one way
> > or another, but this sounds like a nice-to-have detail to me, and a relatively
> > low cost one (both in effort and at runtime) at that too.
> >
> > Propagating the change everytime we modify the memory.zswap.writeback
> > value of the ancestor might be data race-prone (and costly, depending on
> > how big the cgroup subtree is), but this is just a one-time-per-cgroup
> > propagation (at the new cgroup creation time).
>
> I think Yosary was suggesting inheriting the initial value from
> parents. That is just one level look up when you create the new
> cgroup, using the parent value as default. No recursive.
> What you described above seems different to me. I understand what you
> are suggesting is that writing to the parent cgroup will recursively
> write to all child cgroup.
> >
> > Can anyone come up with a failure case for this change, or why it might be
> > a bad idea?
>
> I would suggest against recursive changing value behavior.
> What if you want the parent but also want the child to keep its value
> not changed? Every change to the parent will have to go through the
> child to flip it back.
> Inherit from the parent seems fine.
>
> Chris
Hi Chris,
I've actually sent out a new version of the patch series implementing
(what I believed to be) Yosry's suggestion. Feel free to take a look!
https://lore.kernel.org/all/20231106231158.380730-1-nphamcs@gmail.com/
Here, I was actually agreeing with you - recursive propagation would
not be a good idea.
Best,
Nhat
prev parent reply other threads:[~2023-11-09 3:09 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-02 23:42 Nhat Pham
2023-11-03 1:13 ` Yosry Ahmed
2023-11-03 19:24 ` Nhat Pham
2023-11-09 2:41 ` Chris Li
2023-11-09 3:08 ` Nhat Pham [this message]
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='CAKEwX=Pvf4wj6HrtFvqgWQghsAmOpYnU=1S3b0iMePBQdP_i7Q@mail.gmail.com' \
--to=nphamcs@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=cerasuolodomenico@gmail.com \
--cc=chrisl@kernel.org \
--cc=corbet@lwn.net \
--cc=david@ixit.cz \
--cc=ddstreet@ieee.org \
--cc=hannes@cmpxchg.org \
--cc=hughd@google.com \
--cc=kernel-team@meta.com \
--cc=konrad.wilk@oracle.com \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=lizefan.x@bytedance.com \
--cc=mhocko@kernel.org \
--cc=muchun.song@linux.dev \
--cc=roman.gushchin@linux.dev \
--cc=rppt@kernel.org \
--cc=senozhatsky@chromium.org \
--cc=shakeelb@google.com \
--cc=sjenning@redhat.com \
--cc=tj@kernel.org \
--cc=vitaly.wool@konsulko.com \
--cc=yosryahmed@google.com \
/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