[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190918072542.GC12770@dhcp22.suse.cz>
Date: Wed, 18 Sep 2019 09:25:42 +0200
From: Michal Hocko <mhocko@...nel.org>
To: xiubli@...hat.com
Cc: mingo@...hat.com, peterz@...radead.org, akpm@...ux-foundation.org,
linux-kernel@...r.kernel.org
Subject: Re: [RFC PATCH] memalloc_noio: update the comment to make it cleaner
On Wed 18-09-19 04:58:20, xiubli@...hat.com wrote:
> From: Xiubo Li <xiubli@...hat.com>
>
> The GFP_NOIO means all further allocations will implicitly drop
> both __GFP_IO and __GFP_FS flags and so they are safe for both the
> IO critical section and the the critical section from the allocation
> recursion point of view. Not only the __GFP_IO, which a bit confusing
> when reading the code or using the save/restore pair.
Historically GFP_NOIO has always implied GFP_NOFS as well. I can imagine
that this might come as an surprise for somebody not familiar with the
code though. I am wondering whether your update of the documentation
would be better off at __GFP_FS, __GFP_IO resp. GFP_NOFS, GFP_NOIO level.
This interface is simply a way to set a scoped NO{IO,FS} context.
> Signed-off-by: Xiubo Li <xiubli@...hat.com>
> ---
> include/linux/sched/mm.h | 9 +++++----
> 1 file changed, 5 insertions(+), 4 deletions(-)
>
> diff --git a/include/linux/sched/mm.h b/include/linux/sched/mm.h
> index 4a7944078cc3..9bdc97e52de1 100644
> --- a/include/linux/sched/mm.h
> +++ b/include/linux/sched/mm.h
> @@ -211,10 +211,11 @@ static inline void fs_reclaim_release(gfp_t gfp_mask) { }
> * memalloc_noio_save - Marks implicit GFP_NOIO allocation scope.
> *
> * This functions marks the beginning of the GFP_NOIO allocation scope.
> - * All further allocations will implicitly drop __GFP_IO flag and so
> - * they are safe for the IO critical section from the allocation recursion
> - * point of view. Use memalloc_noio_restore to end the scope with flags
> - * returned by this function.
> + * All further allocations will implicitly drop __GFP_IO and __GFP_FS
> + * flags and so they are safe for both the IO critical section and the
> + * the critical section from the allocation recursion point of view. Use
> + * memalloc_noio_restore to end the scope with flags returned by this
> + * function.
> *
> * This function is safe to be used from any context.
> */
> --
> 2.21.0
--
Michal Hocko
SUSE Labs
Powered by blists - more mailing lists