All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jaegeuk Kim <jaegeuk@kernel.org>
To: Chao Yu <yuchao0@huawei.com>
Cc: linux-kernel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net
Subject: Re: [f2fs-dev] [PATCH 1/3] f2fs: avoid __GFP_NOFAIL in f2fs_bio_alloc
Date: Tue, 18 Feb 2020 18:49:28 -0800	[thread overview]
Message-ID: <20200219024928.GA96609@google.com> (raw)
In-Reply-To: <20200218102136.32150-1-yuchao0@huawei.com>

On 02/18, Chao Yu wrote:
> __f2fs_bio_alloc() won't fail due to memory pool backend, remove unneeded
> __GFP_NOFAIL flag in __f2fs_bio_alloc().

It it safe for old kernels as well when thinking backports?

> 
> Signed-off-by: Chao Yu <yuchao0@huawei.com>
> ---
>  fs/f2fs/data.c | 12 ++++--------
>  fs/f2fs/f2fs.h |  2 +-
>  2 files changed, 5 insertions(+), 9 deletions(-)
> 
> diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c
> index baf12318ec64..3a4ece26928c 100644
> --- a/fs/f2fs/data.c
> +++ b/fs/f2fs/data.c
> @@ -54,17 +54,13 @@ static inline struct bio *__f2fs_bio_alloc(gfp_t gfp_mask,
>  	return bio_alloc_bioset(gfp_mask, nr_iovecs, &f2fs_bioset);
>  }
>  
> -struct bio *f2fs_bio_alloc(struct f2fs_sb_info *sbi, int npages, bool no_fail)
> +struct bio *f2fs_bio_alloc(struct f2fs_sb_info *sbi, int npages, bool noio)
>  {
> -	struct bio *bio;
> -
> -	if (no_fail) {
> +	if (noio) {
>  		/* No failure on bio allocation */
> -		bio = __f2fs_bio_alloc(GFP_NOIO, npages);
> -		if (!bio)
> -			bio = __f2fs_bio_alloc(GFP_NOIO | __GFP_NOFAIL, npages);
> -		return bio;
> +		return __f2fs_bio_alloc(GFP_NOIO, npages);
>  	}
> +
>  	if (time_to_inject(sbi, FAULT_ALLOC_BIO)) {
>  		f2fs_show_injection_info(sbi, FAULT_ALLOC_BIO);
>  		return NULL;
> diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h
> index 5316ac3eacdf..65f569949d42 100644
> --- a/fs/f2fs/f2fs.h
> +++ b/fs/f2fs/f2fs.h
> @@ -3343,7 +3343,7 @@ void f2fs_destroy_checkpoint_caches(void);
>   */
>  int __init f2fs_init_bioset(void);
>  void f2fs_destroy_bioset(void);
> -struct bio *f2fs_bio_alloc(struct f2fs_sb_info *sbi, int npages, bool no_fail);
> +struct bio *f2fs_bio_alloc(struct f2fs_sb_info *sbi, int npages, bool noio);
>  int f2fs_init_bio_entry_cache(void);
>  void f2fs_destroy_bio_entry_cache(void);
>  void f2fs_submit_bio(struct f2fs_sb_info *sbi,
> -- 
> 2.18.0.rc1


_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

WARNING: multiple messages have this Message-ID (diff)
From: Jaegeuk Kim <jaegeuk@kernel.org>
To: Chao Yu <yuchao0@huawei.com>
Cc: linux-f2fs-devel@lists.sourceforge.net,
	linux-kernel@vger.kernel.org, chao@kernel.org
Subject: Re: [PATCH 1/3] f2fs: avoid __GFP_NOFAIL in f2fs_bio_alloc
Date: Tue, 18 Feb 2020 18:49:28 -0800	[thread overview]
Message-ID: <20200219024928.GA96609@google.com> (raw)
In-Reply-To: <20200218102136.32150-1-yuchao0@huawei.com>

On 02/18, Chao Yu wrote:
> __f2fs_bio_alloc() won't fail due to memory pool backend, remove unneeded
> __GFP_NOFAIL flag in __f2fs_bio_alloc().

It it safe for old kernels as well when thinking backports?

> 
> Signed-off-by: Chao Yu <yuchao0@huawei.com>
> ---
>  fs/f2fs/data.c | 12 ++++--------
>  fs/f2fs/f2fs.h |  2 +-
>  2 files changed, 5 insertions(+), 9 deletions(-)
> 
> diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c
> index baf12318ec64..3a4ece26928c 100644
> --- a/fs/f2fs/data.c
> +++ b/fs/f2fs/data.c
> @@ -54,17 +54,13 @@ static inline struct bio *__f2fs_bio_alloc(gfp_t gfp_mask,
>  	return bio_alloc_bioset(gfp_mask, nr_iovecs, &f2fs_bioset);
>  }
>  
> -struct bio *f2fs_bio_alloc(struct f2fs_sb_info *sbi, int npages, bool no_fail)
> +struct bio *f2fs_bio_alloc(struct f2fs_sb_info *sbi, int npages, bool noio)
>  {
> -	struct bio *bio;
> -
> -	if (no_fail) {
> +	if (noio) {
>  		/* No failure on bio allocation */
> -		bio = __f2fs_bio_alloc(GFP_NOIO, npages);
> -		if (!bio)
> -			bio = __f2fs_bio_alloc(GFP_NOIO | __GFP_NOFAIL, npages);
> -		return bio;
> +		return __f2fs_bio_alloc(GFP_NOIO, npages);
>  	}
> +
>  	if (time_to_inject(sbi, FAULT_ALLOC_BIO)) {
>  		f2fs_show_injection_info(sbi, FAULT_ALLOC_BIO);
>  		return NULL;
> diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h
> index 5316ac3eacdf..65f569949d42 100644
> --- a/fs/f2fs/f2fs.h
> +++ b/fs/f2fs/f2fs.h
> @@ -3343,7 +3343,7 @@ void f2fs_destroy_checkpoint_caches(void);
>   */
>  int __init f2fs_init_bioset(void);
>  void f2fs_destroy_bioset(void);
> -struct bio *f2fs_bio_alloc(struct f2fs_sb_info *sbi, int npages, bool no_fail);
> +struct bio *f2fs_bio_alloc(struct f2fs_sb_info *sbi, int npages, bool noio);
>  int f2fs_init_bio_entry_cache(void);
>  void f2fs_destroy_bio_entry_cache(void);
>  void f2fs_submit_bio(struct f2fs_sb_info *sbi,
> -- 
> 2.18.0.rc1

  parent reply	other threads:[~2020-02-19  2:49 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-18 10:21 [f2fs-dev] [PATCH 1/3] f2fs: avoid __GFP_NOFAIL in f2fs_bio_alloc Chao Yu
2020-02-18 10:21 ` Chao Yu
2020-02-18 10:21 ` [f2fs-dev] [PATCH 2/3] f2fs: fix to avoid triggering IO in write path Chao Yu
2020-02-18 10:21   ` Chao Yu
2020-02-18 10:21 ` [f2fs-dev] [PATCH 3/3] f2fs: avoid unneeded barrier in do_checkpoint() Chao Yu
2020-02-18 10:21   ` Chao Yu
2020-02-19  2:51   ` [f2fs-dev] " Jaegeuk Kim
2020-02-19  2:51     ` Jaegeuk Kim
2020-02-19  3:18     ` [f2fs-dev] " Chao Yu
2020-02-19  3:18       ` Chao Yu
2020-02-24 22:00       ` [f2fs-dev] " Jaegeuk Kim
2020-02-24 22:00         ` Jaegeuk Kim
2020-02-25  6:10         ` [f2fs-dev] " Chao Yu
2020-02-25  6:10           ` Chao Yu
2020-02-19  2:49 ` Jaegeuk Kim [this message]
2020-02-19  2:49   ` [PATCH 1/3] f2fs: avoid __GFP_NOFAIL in f2fs_bio_alloc Jaegeuk Kim
2020-02-19  3:12   ` [f2fs-dev] " Chao Yu
2020-02-19  3:12     ` Chao Yu

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=20200219024928.GA96609@google.com \
    --to=jaegeuk@kernel.org \
    --cc=linux-f2fs-devel@lists.sourceforge.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=yuchao0@huawei.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.