linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Michal Hocko <mhocko@suse.com>
To: "Uladzislau Rezki (Sony)" <urezki@gmail.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	linux-mm@kvack.org, LKML <linux-kernel@vger.kernel.org>,
	Mel Gorman <mgorman@suse.de>,
	Christoph Hellwig <hch@infradead.org>,
	Matthew Wilcox <willy@infradead.org>,
	Nicholas Piggin <npiggin@gmail.com>,
	Hillf Danton <hdanton@sina.com>,
	Oleksiy Avramchenko <oleksiy.avramchenko@sonymobile.com>,
	Steven Rostedt <rostedt@goodmis.org>
Subject: Re: [PATCH v2 2/2] mm/vmalloc: Remove gfpflags_allow_blocking() check
Date: Wed, 7 Jul 2021 10:51:22 +0200	[thread overview]
Message-ID: <YOVrCs9Uxt8zcHgR@dhcp22.suse.cz> (raw)
In-Reply-To: <20210705170537.43060-2-urezki@gmail.com>

On Mon 05-07-21 19:05:37, Uladzislau Rezki (Sony) wrote:
> Get rid of gfpflags_allow_blocking() check from the vmalloc() path
> as it is supposed to be sleepable anyway. Thus remove it from the
> alloc_vmap_area() as well as from the vm_area_alloc_pages().
> 
> Signed-off-by: Uladzislau Rezki (Sony) <urezki@gmail.com>

Acked-by: Michal Hocko <mhocko@suse.com>

> ---
>  mm/vmalloc.c | 18 ++++++++----------
>  1 file changed, 8 insertions(+), 10 deletions(-)
> 
> diff --git a/mm/vmalloc.c b/mm/vmalloc.c
> index 5297958ac7c5..93a9cbdba905 100644
> --- a/mm/vmalloc.c
> +++ b/mm/vmalloc.c
> @@ -1479,6 +1479,7 @@ static struct vmap_area *alloc_vmap_area(unsigned long size,
>  				int node, gfp_t gfp_mask)
>  {
>  	struct vmap_area *va;
> +	unsigned long freed;
>  	unsigned long addr;
>  	int purged = 0;
>  	int ret;
> @@ -1542,13 +1543,12 @@ static struct vmap_area *alloc_vmap_area(unsigned long size,
>  		goto retry;
>  	}
>  
> -	if (gfpflags_allow_blocking(gfp_mask)) {
> -		unsigned long freed = 0;
> -		blocking_notifier_call_chain(&vmap_notify_list, 0, &freed);
> -		if (freed > 0) {
> -			purged = 0;
> -			goto retry;
> -		}
> +	freed = 0;
> +	blocking_notifier_call_chain(&vmap_notify_list, 0, &freed);
> +
> +	if (freed > 0) {
> +		purged = 0;
> +		goto retry;
>  	}
>  
>  	if (!(gfp_mask & __GFP_NOWARN) && printk_ratelimit())
> @@ -2834,9 +2834,7 @@ vm_area_alloc_pages(gfp_t gfp, int nid,
>  		for (i = 0; i < (1U << order); i++)
>  			pages[nr_allocated + i] = page + i;
>  
> -		if (gfpflags_allow_blocking(gfp))
> -			cond_resched();
> -
> +		cond_resched();
>  		nr_allocated += 1U << order;
>  	}
>  
> -- 
> 2.20.1

-- 
Michal Hocko
SUSE Labs

  reply	other threads:[~2021-07-07  8:51 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-05 17:05 [PATCH v2 1/2] mm/vmalloc: Use batched page requests in bulk-allocator Uladzislau Rezki (Sony)
2021-07-05 17:05 ` [PATCH v2 2/2] mm/vmalloc: Remove gfpflags_allow_blocking() check Uladzislau Rezki (Sony)
2021-07-07  8:51   ` Michal Hocko [this message]
2021-07-07 14:43     ` Uladzislau Rezki
2021-07-06 20:26 ` [PATCH v2 1/2] mm/vmalloc: Use batched page requests in bulk-allocator Andrew Morton
2021-07-07  8:42   ` Michal Hocko
2021-07-07 14:47     ` Uladzislau Rezki
2021-07-07 14:49   ` Uladzislau Rezki
2021-07-07  8:50 ` 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=YOVrCs9Uxt8zcHgR@dhcp22.suse.cz \
    --to=mhocko@suse.com \
    --cc=akpm@linux-foundation.org \
    --cc=hch@infradead.org \
    --cc=hdanton@sina.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mgorman@suse.de \
    --cc=npiggin@gmail.com \
    --cc=oleksiy.avramchenko@sonymobile.com \
    --cc=rostedt@goodmis.org \
    --cc=urezki@gmail.com \
    --cc=willy@infradead.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).