linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Nhat Pham <nphamcs@gmail.com>
To: Ronald Monthero <debug.penguin32@gmail.com>
Cc: sjenning@redhat.com, ddstreet@ieee.org, vitaly.wool@konsulko.com,
	 akpm@linux-foundation.org, chrisl@kernel.org,
	linux-mm@kvack.org,  linux-kernel@vger.kernel.org,
	Johannes Weiner <hannes@cmpxchg.org>,
	 Yosry Ahmed <yosryahmed@google.com>
Subject: Re: [PATCH] mm/zswap: Improve with alloc_workqueue() call
Date: Thu, 18 Jan 2024 10:03:23 -0800	[thread overview]
Message-ID: <CAKEwX=O2gcXEcMwvws=q4_izSdtjw_5oNvec=SekxxMPEOzgbA@mail.gmail.com> (raw)
In-Reply-To: <CAKEwX=PjraCg_NjP4Tnkbv8uqnVw8yJGh-mbuZC02Gp6HMcDBw@mail.gmail.com>

On Wed, Jan 17, 2024 at 11:13 AM Nhat Pham <nphamcs@gmail.com> wrote:
>
> On Tue, Jan 16, 2024 at 5:32 AM Ronald Monthero
> <debug.penguin32@gmail.com> wrote:
>
> + Johannes and Yosry
>
> >
> > The core-api create_workqueue is deprecated, this patch replaces
> > the create_workqueue with alloc_workqueue. The previous
> > implementation workqueue of zswap was a bounded workqueue, this
> > patch uses alloc_workqueue() to create an unbounded workqueue.
> > The WQ_UNBOUND attribute is desirable making the workqueue
> > not localized to a specific cpu so that the scheduler is free
> > to exercise improvisations in any demanding scenarios for
> > offloading cpu time slices for workqueues.
>
> nit: extra space between paragraph would be nice.
>
> > For example if any other workqueues of the same primary cpu
> > had to be served which are WQ_HIGHPRI and WQ_CPU_INTENSIVE.
> > Also Unbound workqueue happens to be more efficient
> > in a system during memory pressure scenarios in comparison
> >  to a bounded workqueue.
> >
> > shrink_wq = alloc_workqueue("zswap-shrink",
> >                      WQ_UNBOUND|WQ_MEM_RECLAIM, 1);
> >
> > Overall the change suggested in this patch should be
> > seamless and does not alter the existing behavior,
> > other than the improvisation to be an unbounded workqueue.
> >
> > Signed-off-by: Ronald Monthero <debug.penguin32@gmail.com>
> > ---
> >  mm/zswap.c | 3 ++-
> >  1 file changed, 2 insertions(+), 1 deletion(-)
> >
> > diff --git a/mm/zswap.c b/mm/zswap.c
> > index 74411dfdad92..64dbe3e944a2 100644
> > --- a/mm/zswap.c
> > +++ b/mm/zswap.c
> > @@ -1620,7 +1620,8 @@ static int zswap_setup(void)
> >                 zswap_enabled = false;
> >         }
> >
> > -       shrink_wq = create_workqueue("zswap-shrink");
> > +       shrink_wq = alloc_workqueue("zswap-shrink",
> > +                       WQ_UNBOUND|WQ_MEM_RECLAIM, 1);
>

[...]

> >         if (!shrink_wq)
> >                 goto fallback_fail;
> >
> > --
> > 2.34.1
> >

FWIW:
Acked-by: Nhat Pham <nphamcs@gmail.com>


      parent reply	other threads:[~2024-01-18 18:03 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-11  5:28 Ronald Monthero
2023-12-11 14:15 ` Nhat Pham
2023-12-13 13:20   ` Ronald Monthero
2023-12-14  0:28     ` Nhat Pham
2023-12-14  1:02       ` Nhat Pham
2023-12-15  9:03       ` Ronald Monthero
2023-12-20  0:21         ` Nhat Pham
2024-01-16 13:31           ` Ronald Monthero
2024-01-17 19:13             ` Nhat Pham
2024-01-17 19:30               ` Yosry Ahmed
2024-01-18 16:16                 ` Johannes Weiner
2024-01-18 16:48                   ` Johannes Weiner
2024-01-18 17:03                     ` Yosry Ahmed
2024-01-18 18:08                       ` Nhat Pham
2024-01-18 17:06                   ` Yosry Ahmed
2024-01-18 17:39                     ` Johannes Weiner
2024-01-18 18:03                       ` Yosry Ahmed
2024-01-18 18:32                       ` Nhat Pham
2024-02-21 13:32                         ` Ronald Monthero
2024-01-18 18:03               ` 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=O2gcXEcMwvws=q4_izSdtjw_5oNvec=SekxxMPEOzgbA@mail.gmail.com' \
    --to=nphamcs@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=chrisl@kernel.org \
    --cc=ddstreet@ieee.org \
    --cc=debug.penguin32@gmail.com \
    --cc=hannes@cmpxchg.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=sjenning@redhat.com \
    --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