linux-xfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Darrick J. Wong" <djwong@kernel.org>
To: djwong@kernel.org
Cc: Dave Chinner <dchinner@redhat.com>,
	linux-xfs@vger.kernel.org, hch@infradead.org,
	david@fromorbit.com, bfoster@redhat.com
Subject: [PATCHSET v3 0/2] xfs: speed up parallel workqueues
Date: Wed, 27 Jan 2021 22:03:25 -0800	[thread overview]
Message-ID: <161181380539.1525344.442839530784024643.stgit@magnolia> (raw)

Hi all,

After some discussion on IRC with Dave, we came to the conclusion that
our background workqueue behavior could use some tweaking.  Kernel
worker threads that scan the filesystem and/or run their own
transactions more closely fit the definition of an unbound workqueue --
the work items can take a long time, they don't have much in common with
the submitter thread, the submitter isn't waiting hotly for a response,
and we the process scheduler should deal with scheduling them.
Furthermore, we don't want to place artificial limits on workqueue
scaling because that can leave unused capacity while we're blocking
(pwork is currently used for mount time quotacheck).

Therefore, we switch pwork to use an unbound workqueue, and now we let
the workqueue code figure out the relevant concurrency.  We expose the
pwork workqueue via sysfs, and document the interesting knobs in the
administrator's guide.

v2: expose all the workqueues via sysfs
v3: only expose those workqueues that exist for kernel threads that
    create their own transactions, and update the admin guide.

If you're going to start using this mess, you probably ought to just
pull from my git trees, which are linked below.

This is an extraordinary way to destroy everything.  Enjoy!
Comments and questions are, as always, welcome.

--D

kernel git tree:
https://git.kernel.org/cgit/linux/kernel/git/djwong/xfs-linux.git/log/?h=workqueue-speedups-5.12
---
 Documentation/admin-guide/xfs.rst |   38 +++++++++++++++++++++++++++++++++++++
 fs/xfs/xfs_iwalk.c                |    5 +----
 fs/xfs/xfs_log.c                  |    5 +++--
 fs/xfs/xfs_mru_cache.c            |    2 +-
 fs/xfs/xfs_pwork.c                |   25 +++++-------------------
 fs/xfs/xfs_pwork.h                |    4 +---
 fs/xfs/xfs_super.c                |   23 ++++++++++++++--------
 fs/xfs/xfs_super.h                |    6 ++++++
 8 files changed, 69 insertions(+), 39 deletions(-)


             reply	other threads:[~2021-01-28  6:04 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-28  6:03 Darrick J. Wong [this message]
2021-01-28  6:03 ` [PATCH 1/2] xfs: increase the default parallelism levels of pwork clients Darrick J. Wong
2021-01-28  9:27   ` Christoph Hellwig
2021-01-29 16:30   ` Brian Foster
2021-01-28  6:03 ` [PATCH 2/2] xfs: set WQ_SYSFS on all workqueues in debug mode Darrick J. Wong
2021-01-28  9:27   ` Christoph Hellwig
2021-01-29 16:31   ` Brian Foster

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=161181380539.1525344.442839530784024643.stgit@magnolia \
    --to=djwong@kernel.org \
    --cc=bfoster@redhat.com \
    --cc=david@fromorbit.com \
    --cc=dchinner@redhat.com \
    --cc=hch@infradead.org \
    --cc=linux-xfs@vger.kernel.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;
as well as URLs for NNTP newsgroup(s).