From patchwork Mon Jul 5 17:05:37 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Uladzislau Rezki X-Patchwork-Id: 12359455 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.5 required=3.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED,DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 78B47C07E9B for ; Mon, 5 Jul 2021 17:05:51 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 13E9C6196A for ; Mon, 5 Jul 2021 17:05:51 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 13E9C6196A Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 0AEA76B009E; Mon, 5 Jul 2021 13:05:50 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 05C886B009F; Mon, 5 Jul 2021 13:05:49 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id DF2506B00A0; Mon, 5 Jul 2021 13:05:49 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0115.hostedemail.com [216.40.44.115]) by kanga.kvack.org (Postfix) with ESMTP id BDB626B009E for ; Mon, 5 Jul 2021 13:05:49 -0400 (EDT) Received: from smtpin40.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 49AA4211D4 for ; Mon, 5 Jul 2021 17:05:49 +0000 (UTC) X-FDA: 78329161218.40.A6574E1 Received: from mail-lj1-f171.google.com (mail-lj1-f171.google.com [209.85.208.171]) by imf24.hostedemail.com (Postfix) with ESMTP id 1247EB0000A1 for ; Mon, 5 Jul 2021 17:05:48 +0000 (UTC) Received: by mail-lj1-f171.google.com with SMTP id e3so17004657ljo.6 for ; Mon, 05 Jul 2021 10:05:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=YgGY083lvLVDzanfWlQ0rK3bjJx/pViz/NxffbwtZEQ=; b=dBFd5kkN5R/6BKe/bT+G6lO1i/6O5lC1M2dHb+86aXA/WXTYGQb6mBc3jetstUJQnm HXbWE5fWg3chcW44p0hQVeqQaFYNba7Bu5jYXfoTQJ+Sb0uvr/Tz0iCY3zHU6FKfVK1F WAsVdYzyzp+Wg/yekGnJXyDYW7bjliIGD8bUNSz4dgPjFeuA8/pyigatlDWXSQqN/1SX pf545g8syC+9gVQ+Xb++b/vT+AUytIT1bWfmsyfArGktScQSKysISgu63acfNQcl3WF+ 1DYXueqii2NRqNJW60hBN+btFonBeKqfy0VMfH6dKXd/90tQhCSXqcQ8S/jEQIhn3xsZ 8Ynw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=YgGY083lvLVDzanfWlQ0rK3bjJx/pViz/NxffbwtZEQ=; b=lf//clYMf2vdIjM8VAwOsIK+HIV7WEoEDbBaBR3TJtC05bWtkgOYf8AI4pnORdpMLM qsor/3HSlEs+U6xtUbDxCdTjvyLd8wztXrzHpgS53qxbO1k8nNwR8zaUcxeWsDACk2Of 0HkFr9GomkuVbzdfUafK9ExMTnHBRc9p0WAZDWMPzrMh6HZ7kzkPiYw147tyZqT7Htxr 3Bfqf7NBgIXSfMjtEGrtmSVXGEWckVs8WEIC5BhWgaDrZHqZ9+Adr5ekPgV21XSe6Bdq Poaz39CwsP0+vg+la5mkO7Y/36aW9wj5bp3+/OTC5+D0xxaNHORKWhmuN/uJLjsWDNmR v2dQ== X-Gm-Message-State: AOAM530yyQg5fPDoNUu1e4H9F6aygVYvgKqOYvv9wgguVyRiWFu5/Iit mjbnVBq0rxtcgnmzGgwIV96bRnVCxGjvhw== X-Google-Smtp-Source: ABdhPJzj6R5GWsoGGDqn94UDvOZjb4i7iVY2GUrrj6lsJ5Pv6ar+475lKDyzdWG/6FUM0YFcm4Qa6A== X-Received: by 2002:a2e:7210:: with SMTP id n16mr4930887ljc.8.1625504747828; Mon, 05 Jul 2021 10:05:47 -0700 (PDT) Received: from pc638.lan (h5ef52e3d.seluork.dyn.perspektivbredband.net. [94.245.46.61]) by smtp.gmail.com with ESMTPSA id k12sm578501lfv.14.2021.07.05.10.05.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 05 Jul 2021 10:05:47 -0700 (PDT) From: "Uladzislau Rezki (Sony)" To: Andrew Morton Cc: linux-mm@kvack.org, LKML , Mel Gorman , Christoph Hellwig , Matthew Wilcox , Nicholas Piggin , Uladzislau Rezki , Hillf Danton , Michal Hocko , Oleksiy Avramchenko , Steven Rostedt Subject: [PATCH v2 2/2] mm/vmalloc: Remove gfpflags_allow_blocking() check Date: Mon, 5 Jul 2021 19:05:37 +0200 Message-Id: <20210705170537.43060-2-urezki@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210705170537.43060-1-urezki@gmail.com> References: <20210705170537.43060-1-urezki@gmail.com> MIME-Version: 1.0 X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: 1247EB0000A1 X-Stat-Signature: y5urzfh6q9x6oqdbwqh5szksibnstder Authentication-Results: imf24.hostedemail.com; dkim=pass header.d=gmail.com header.s=20161025 header.b=dBFd5kkN; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf24.hostedemail.com: domain of urezki@gmail.com designates 209.85.208.171 as permitted sender) smtp.mailfrom=urezki@gmail.com X-HE-Tag: 1625504748-933463 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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) Acked-by: Michal Hocko --- 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; }