From: "Darrick J. Wong" <darrick.wong@oracle.com>
To: Yang Shi <yang.shi@linux.alibaba.com>
Cc: mgorman@techsingularity.net, tytso@mit.edu,
adilger.kernel@dilger.ca, dchinner@redhat.com,
akpm@linux-foundation.org, linux-ext4@vger.kernel.org,
linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org,
linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/2] fs: xfs: use BUG_ON if writepage call comes from direct reclaim
Date: Tue, 3 Jul 2018 10:19:20 -0700 [thread overview]
Message-ID: <20180703171920.GC5711@magnolia> (raw)
In-Reply-To: <1530591079-33813-2-git-send-email-yang.shi@linux.alibaba.com>
On Tue, Jul 03, 2018 at 12:11:19PM +0800, Yang Shi wrote:
> direct reclaim doesn't write out filesystem page, only kswapd could do
> this. So, if it is called from direct relaim, it is definitely a bug.
>
> And, Mel Gorman mentioned "Ultimately, this will be a BUG_ON." in commit
> 94054fa3fca1fd78db02cb3d68d5627120f0a1d4 ("xfs: warn if direct reclaim
> tries to writeback pages"),
>
> It has been many years since that commit, so it should be safe to
> elevate WARN_ON to BUG_ON now.
>
> Cc: Mel Gorman <mgorman@techsingularity.net>
> Cc: Darrick J. Wong <darrick.wong@oracle.com>
> Cc: Dave Chinner <dchinner@redhat.com>
> Signed-off-by: Yang Shi <yang.shi@linux.alibaba.com>
> ---
> fs/xfs/xfs_aops.c | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/fs/xfs/xfs_aops.c b/fs/xfs/xfs_aops.c
> index 8eb3ba3..7efc2d2 100644
> --- a/fs/xfs/xfs_aops.c
> +++ b/fs/xfs/xfs_aops.c
> @@ -1080,11 +1080,9 @@ static inline int xfs_bio_add_buffer(struct bio *bio, struct buffer_head *bh)
> * allow reclaim from kswapd as the stack usage there is relatively low.
> *
> * This should never happen except in the case of a VM regression so
> - * warn about it.
> + * BUG about it.
> */
> - if (WARN_ON_ONCE((current->flags & (PF_MEMALLOC|PF_KSWAPD)) ==
> - PF_MEMALLOC))
> - goto redirty;
> + BUG_ON((current->flags & (PF_MEMALLOC|PF_KSWAPD)) == PF_MEMALLOC);
Ugh, please do not increase the BUG() factor. Even if this happens due
to a regression it's /much/ easier to debug if we don't halt the system.
(IOWs, I decline to take this patch.)
--D
>
> /*
> * Given that we do not allow direct reclaim to call us, we should
> --
> 1.8.3.1
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-xfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2018-07-03 17:19 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-03 4:11 [PATCH 1/2] fs: ext4: use BUG_ON if writepage call comes from direct reclaim Yang Shi
2018-07-03 4:11 ` [PATCH 2/2] fs: xfs: " Yang Shi
2018-07-03 4:37 ` Dave Chinner
2018-07-03 17:19 ` Darrick J. Wong [this message]
2018-07-03 10:39 ` [PATCH 1/2] fs: ext4: " Theodore Y. Ts'o
2018-07-03 17:05 ` Yang Shi
2018-07-03 23:10 ` Yang Shi
2018-07-03 23:10 ` Yang Shi
2018-07-03 23:43 ` Theodore Y. Ts'o
2018-07-04 14:03 ` Michal Hocko
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=20180703171920.GC5711@magnolia \
--to=darrick.wong@oracle.com \
--cc=adilger.kernel@dilger.ca \
--cc=akpm@linux-foundation.org \
--cc=dchinner@redhat.com \
--cc=linux-ext4@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=linux-xfs@vger.kernel.org \
--cc=mgorman@techsingularity.net \
--cc=tytso@mit.edu \
--cc=yang.shi@linux.alibaba.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.