Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp3778835pxb; Wed, 13 Oct 2021 12:46:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw/gbGdEJojFYzwIdzD1QW7aImKZ71xJWutf1Pk6QVFTBT4lKVeaAo/qM3VBz2oJWV6CWhK X-Received: by 2002:a17:90a:a41:: with SMTP id o59mr15820284pjo.243.1634154405061; Wed, 13 Oct 2021 12:46:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634154405; cv=none; d=google.com; s=arc-20160816; b=Tp8jPbIIdcNOwey2P2gjg7CP13SHzpaXCKP2atwEOl27hQQVDAqCKeJZz8cy61uIBx S7TiV9x2Fm7Y/AO2ghYOCFR1HvIFJgT9wE79HqZvJFshpvcgPoQiz8YvZwIAeHcGJf9/ 3u7U/lOGvVPlq5WVmocvPGoRaD5+vM9X5o63uLMQNsltlGHldfppuVvWnpU6AHJMJ8NE 202e4whHMh6G78GUf4imSKwzP1JKpt37s4n7ylZNFk0BJrz1wfNvRrFazoxuXf3wnSKt g/323q5gWZwvaGMWsWHc64hjh//gPV6hvPH1wkQEZz1Oda3vr5Wy3B1G8b6JyvR+hqlO WqwQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:from:subject:mime-version:message-id:date :dkim-signature; bh=183/Dmjt3t68g4lFUKc/z0kQhgqiT+FGVOpT95Nq0kM=; b=sTw0aTLsgIX3BFH0QxIM0mJzJx8RbfztzgDWpvSlcTbJcQzA/MYE7NfwU9D5gizgBR ctfQXpdkk121nWSy5VYc+4QEW5VWamBZIrZUi4ECsscLk8s3rRsIJPcVHUT29oLzozkK tkb422g+FvRlIVPymXXOLZySY/27d/v8+6jDqCLGqiJe2blU+DGnmULNaeHm6SNeBhRG Ome3ucjW4d7ZQ8fqtE6i4DXVt47/cPB1TgZFoMe4NFsc/XrQ0ok4VSCOh4uz+S0+C8bo If9FU4K+PUoQaWWA2Qa1JyGBwrUwUlhSUwQ797P6qIc9/9nJD5W6R7mwMablCyQdr3jf 95ow== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=OdGvP6kt; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s203si623216pgs.27.2021.10.13.12.46.33; Wed, 13 Oct 2021 12:46:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=OdGvP6kt; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235616AbhJMTp4 (ORCPT + 99 others); Wed, 13 Oct 2021 15:45:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38958 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237738AbhJMTpz (ORCPT ); Wed, 13 Oct 2021 15:45:55 -0400 Received: from mail-vk1-xa4a.google.com (mail-vk1-xa4a.google.com [IPv6:2607:f8b0:4864:20::a4a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2E009C061746 for ; Wed, 13 Oct 2021 12:43:52 -0700 (PDT) Received: by mail-vk1-xa4a.google.com with SMTP id w124-20020a1fc682000000b0029aceaf35b2so1485235vkf.19 for ; Wed, 13 Oct 2021 12:43:52 -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=atfyR1qY24V3fJMEsbQlbu3q7n7xAxZSJoSSnjRlKTFsxvPZVwB1BaF3Qo3xBPRkh3 x0FmCWiyvBQqQXoJaJ/M7okWkQZ4aDeMKRJgUSSnwCjs1uYeNOdPCFQq+0ltJeSizNCN m1NNp7tkf+20lGuKBapXshVYQfrpU/ZPolYf5SaQYkzkTHNCTdxMMAFyjeRPPb4LYKG/ nGEuCMTxNhIKNnteByFQHdRmOImbRAAsGB3iFgoD3V8LFvJ/Rep793heh2TRx0dcN+HD I0gHROKNVpWMJ23EMEbvQNNnRCnNDNe3oAchPVT5Y/nqfdXaQPr3jCHwF7w+DwKPNt8/ W5BQ== X-Gm-Message-State: AOAM533HP4+j+tKpJfmcG00018QjT1onmCKhVgBqjDdXTlnrGfEZIaqK amRVr8+SEyU2Lo/kO6DfK98QrLeb7ZNYjA== 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 Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. -- 2.33.0.882.g93a45727a2-goog