From patchwork Wed Oct 13 19:43:38 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shakeel Butt X-Patchwork-Id: 12556843 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id AE885C433EF for ; Wed, 13 Oct 2021 19:43:53 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 61DA6611CB for ; Wed, 13 Oct 2021 19:43:53 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 61DA6611CB Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 077FA6B0071; Wed, 13 Oct 2021 15:43:53 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 0001A6B0072; Wed, 13 Oct 2021 15:43:52 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D96D7900002; Wed, 13 Oct 2021 15:43:52 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id C786D6B0071 for ; Wed, 13 Oct 2021 15:43:52 -0400 (EDT) Received: from smtpin38.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 7443822028 for ; Wed, 13 Oct 2021 19:43:52 +0000 (UTC) X-FDA: 78692439504.38.FFA7D6E Received: from mail-vk1-f201.google.com (mail-vk1-f201.google.com [209.85.221.201]) by imf06.hostedemail.com (Postfix) with ESMTP id B6FC0801A89B for ; Wed, 13 Oct 2021 19:43:51 +0000 (UTC) Received: by mail-vk1-f201.google.com with SMTP id v62-20020a1f2f41000000b002a41c96d713so1528596vkv.3 for ; Wed, 13 Oct 2021 12:43:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:message-id:mime-version:subject:from:to:cc; bh=183/Dmjt3t68g4lFUKc/z0kQhgqiT+FGVOpT95Nq0kM=; b=OdGvP6ktVCKze2jdgpC/LCWFtjsxfSQgs7UTA6ebaiBpzoW1WqKoiQuVcC1bpMOVCC i8KclRSPtGW5OeUbj5IuaiJMHVf+Aez8zx2pNI57ISq82CQEZoyEfTvyVn69C7OEgxcq gYafOMRueWW7YY9aES2dtBfRhYz2FKebug+0VXHFfQQmiSeBII857IcocA5kBECykSGf 2GkjXZ6uaf8Cfr/+DRwDyeZ8LEcsNG7p5vjscSWG25J6V8xiOkH3N4tw4bBj2JybPT+T C0YERN2BSBkhnSnncR/BTcYXjo3x6SnZTPdlui6ZcHcyYMBORDh8TxIwvTdhaGjJnzNF J4Yw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:message-id:mime-version:subject:from:to:cc; bh=183/Dmjt3t68g4lFUKc/z0kQhgqiT+FGVOpT95Nq0kM=; b=KAw0jp3eUNmHboqC8f/wtqhQqzfDzo86MWq85Yf3VLjs/i3qSFF2bT0NFvK995soyi KYaLo9Fw7bO9WOkSNm2Tbd2+o5cSjIt5UaxQp7i/0DieMhm9A4Zds99u85W84qn4R5aE QuVLleUVJrNYtFISPAxF16k2dBoRY7hjh6T3zfrT6OmjpKqOpY/8ddck9CrRYu6BsotX b2ucVCW3Cf0o/qC7dXmLtcBiLVQsBvegRTBCmNswKtBbqakv0JmqHmk1eB5DH8W2B4rV rCzz9sOQj7/HFypcrKbjflALNbpLpXlyToVkq48yQvg6l2Q5j5FG0/Rq80J1Nv4Gu5FN 67lw== X-Gm-Message-State: AOAM530VkyV819/9mY/TX7lbkHsZJntRDMjWo9b7/1tK87csu4KIlARx 8CScMA+3tJW59UcpjYVSXAMNaCTvX19V3w== X-Google-Smtp-Source: ABdhPJxKgR5GsmM54dHnMT2mXYgy1E7okQ+e1f6zKR1mUBMieg+tg2mRtJZ0uTCGaMOdR75/PYQyN+Wp/FppFA== X-Received: from shakeelb.svl.corp.google.com ([2620:15c:2cd:202:10e1:c2e0:9039:1a50]) (user=shakeelb job=sendgmr) by 2002:a67:e416:: with SMTP id d22mr1407296vsf.41.1634154231281; Wed, 13 Oct 2021 12:43:51 -0700 (PDT) Date: Wed, 13 Oct 2021 12:43:38 -0700 Message-Id: <20211013194338.1804247-1-shakeelb@google.com> Mime-Version: 1.0 X-Mailer: git-send-email 2.33.0.882.g93a45727a2-goog Subject: [PATCH] memcg: page_alloc: skip bulk allocator for __GFP_ACCOUNT From: Shakeel Butt To: Johannes Weiner , Michal Hocko , Mel Gorman Cc: Uladzislau Rezki , Vasily Averin , Roman Gushchin , Andrew Morton , cgroups@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Shakeel Butt X-Rspamd-Queue-Id: B6FC0801A89B X-Stat-Signature: eyytwnmhpqm7qfus43pmr9kfgazja3ig Authentication-Results: imf06.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=OdGvP6kt; spf=pass (imf06.hostedemail.com: domain of 39zZnYQgKCBQC1u4yy5v08805y.w86527EH-664Fuw4.8B0@flex--shakeelb.bounces.google.com designates 209.85.221.201 as permitted sender) smtp.mailfrom=39zZnYQgKCBQC1u4yy5v08805y.w86527EH-664Fuw4.8B0@flex--shakeelb.bounces.google.com; dmarc=pass (policy=reject) header.from=google.com X-Rspamd-Server: rspam06 X-HE-Tag: 1634154231-717484 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: The commit 5c1f4e690eec ("mm/vmalloc: switch to bulk allocator in __vmalloc_area_node()") switched to bulk page allocator for order 0 allocation backing vmalloc. However bulk page allocator does not support __GFP_ACCOUNT allocations and there are several users of kvmalloc(__GFP_ACCOUNT). For now make __GFP_ACCOUNT allocations bypass bulk page allocator. In future if there is workload that can be significantly improved with the bulk page allocator with __GFP_ACCCOUNT support, we can revisit the decision. Fixes: 5c1f4e690eec ("mm/vmalloc: switch to bulk allocator in __vmalloc_area_node()") Signed-off-by: Shakeel Butt --- mm/page_alloc.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 668edb16446a..b3acad4615d3 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -5215,6 +5215,10 @@ unsigned long __alloc_pages_bulk(gfp_t gfp, int preferred_nid, unsigned int alloc_flags = ALLOC_WMARK_LOW; int nr_populated = 0, nr_account = 0; + /* Bulk allocator does not support memcg accounting. */ + if (unlikely(gfp & __GFP_ACCOUNT)) + goto out; + /* * Skip populated array elements to determine if any pages need * to be allocated before disabling IRQs.