From: Brian Foster <bfoster@redhat.com>
To: Dave Chinner <david@fromorbit.com>
Cc: xfs@oss.sgi.com
Subject: Re: [PATCH 1/3] Revert "xfs: block allocation work needs to be kswapd aware"
Date: Fri, 11 Jul 2014 08:32:10 -0400 [thread overview]
Message-ID: <20140711123210.GA3077@laptop.bfoster> (raw)
In-Reply-To: <1405034779-2028-2-git-send-email-david@fromorbit.com>
On Fri, Jul 11, 2014 at 09:26:17AM +1000, Dave Chinner wrote:
> This reverts commit 1f6d64829db78a7e1d63e15c9f48f0a5d2b5a679.
>
> This commit resulted in regressions in performance in low
> memory situations where kswapd was doing writeback of delayed
> allocation blocks. It resulted in significant parallelism of the
> kswapd work and with the special kswapd flags meant that hundreds of
> active allocation could dip into kswapd specific memory reserves and
> avoid being throttled. This cause a large amount of performance
> variation, as well as random OOM-killer invocations that didn't
> previously exist.
>
> Signed-off-by: Dave Chinner <dchinner@redhat.com>
> ---
I was going to suggest to keep the bool types, but that's fixed up in
the subsequent patch. ;) Looks good...
Reviewed-by: Brian Foster <bfoster@redhat.com>
> fs/xfs/xfs_bmap_util.c | 16 +++-------------
> fs/xfs/xfs_bmap_util.h | 13 ++++++-------
> 2 files changed, 9 insertions(+), 20 deletions(-)
>
> diff --git a/fs/xfs/xfs_bmap_util.c b/fs/xfs/xfs_bmap_util.c
> index 703b3ec..057f671 100644
> --- a/fs/xfs/xfs_bmap_util.c
> +++ b/fs/xfs/xfs_bmap_util.c
> @@ -258,23 +258,14 @@ xfs_bmapi_allocate_worker(
> struct xfs_bmalloca *args = container_of(work,
> struct xfs_bmalloca, work);
> unsigned long pflags;
> - unsigned long new_pflags = PF_FSTRANS;
>
> - /*
> - * we are in a transaction context here, but may also be doing work
> - * in kswapd context, and hence we may need to inherit that state
> - * temporarily to ensure that we don't block waiting for memory reclaim
> - * in any way.
> - */
> - if (args->kswapd)
> - new_pflags |= PF_MEMALLOC | PF_SWAPWRITE | PF_KSWAPD;
> -
> - current_set_flags_nested(&pflags, new_pflags);
> + /* we are in a transaction context here */
> + current_set_flags_nested(&pflags, PF_FSTRANS);
>
> args->result = __xfs_bmapi_allocate(args);
> complete(args->done);
>
> - current_restore_flags_nested(&pflags, new_pflags);
> + current_restore_flags_nested(&pflags, PF_FSTRANS);
> }
>
> /*
> @@ -293,7 +284,6 @@ xfs_bmapi_allocate(
>
>
> args->done = &done;
> - args->kswapd = current_is_kswapd();
> INIT_WORK_ONSTACK(&args->work, xfs_bmapi_allocate_worker);
> queue_work(xfs_alloc_wq, &args->work);
> wait_for_completion(&done);
> diff --git a/fs/xfs/xfs_bmap_util.h b/fs/xfs/xfs_bmap_util.h
> index 075f722..935ed2b 100644
> --- a/fs/xfs/xfs_bmap_util.h
> +++ b/fs/xfs/xfs_bmap_util.h
> @@ -50,13 +50,12 @@ struct xfs_bmalloca {
> xfs_extlen_t total; /* total blocks needed for xaction */
> xfs_extlen_t minlen; /* minimum allocation size (blocks) */
> xfs_extlen_t minleft; /* amount must be left after alloc */
> - bool eof; /* set if allocating past last extent */
> - bool wasdel; /* replacing a delayed allocation */
> - bool userdata;/* set if is user data */
> - bool aeof; /* allocated space at eof */
> - bool conv; /* overwriting unwritten extents */
> - bool stack_switch;
> - bool kswapd; /* allocation in kswapd context */
> + char eof; /* set if allocating past last extent */
> + char wasdel; /* replacing a delayed allocation */
> + char userdata;/* set if is user data */
> + char aeof; /* allocated space at eof */
> + char conv; /* overwriting unwritten extents */
> + char stack_switch;
> int flags;
> struct completion *done;
> struct work_struct work;
> --
> 2.0.0
>
> _______________________________________________
> xfs mailing list
> xfs@oss.sgi.com
> http://oss.sgi.com/mailman/listinfo/xfs
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
next prev parent reply other threads:[~2014-07-11 12:32 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-10 23:26 [PATCH 0/3] xfs: regression fixes for 3.16-rc5 Dave Chinner
2014-07-10 23:26 ` [PATCH 1/3] Revert "xfs: block allocation work needs to be kswapd aware" Dave Chinner
2014-07-11 12:32 ` Brian Foster [this message]
2014-07-10 23:26 ` [PATCH 2/3] xfs: refine the allocation stack switch Dave Chinner
2014-07-11 12:33 ` Brian Foster
2014-07-11 21:57 ` Dave Chinner
2014-07-10 23:26 ` [PATCH 3/3] xfs: null unused quota inodes when quota is on Dave Chinner
2014-07-11 13:15 ` Brian Foster
2014-07-11 22:00 ` Dave Chinner
2014-07-11 15:22 ` Arkadiusz Miśkiewicz
2014-07-11 15:30 ` Arkadiusz Miśkiewicz
2014-07-14 0:58 ` Dave Chinner
-- strict thread matches above, loose matches on Subject: below --
2014-07-14 4:48 [PATCH 0/3, V2] xfs; fixes for 3.16-rc5 Dave Chinner
2014-07-14 4:48 ` [PATCH 1/3] Revert "xfs: block allocation work needs to be kswapd aware" Dave Chinner
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=20140711123210.GA3077@laptop.bfoster \
--to=bfoster@redhat.com \
--cc=david@fromorbit.com \
--cc=xfs@oss.sgi.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