From mboxrd@z Thu Jan 1 00:00:00 1970 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 EB896C433FE for ; Thu, 14 Oct 2021 15:24:49 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 8AFF161053 for ; Thu, 14 Oct 2021 15:24:49 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 8AFF161053 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 07842900003; Thu, 14 Oct 2021 11:24:49 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 02795900002; Thu, 14 Oct 2021 11:24:48 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E3232900003; Thu, 14 Oct 2021 11:24:48 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0241.hostedemail.com [216.40.44.241]) by kanga.kvack.org (Postfix) with ESMTP id D5801900002 for ; Thu, 14 Oct 2021 11:24:48 -0400 (EDT) Received: from smtpin22.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 8F3882D382 for ; Thu, 14 Oct 2021 15:24:48 +0000 (UTC) X-FDA: 78695415456.22.00CC64C Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by imf21.hostedemail.com (Postfix) with ESMTP id 6DA17D04073E for ; Thu, 14 Oct 2021 15:24:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1634225087; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=HBGMhkW5l3xF58RlsWd4EAEKmLqaalQ7yZY4iWVTFTE=; b=A/VMNZ18napNWdvPjUzcb7/v94qxPoWVjosbt5qGTtAhvKwqh2As6Vc+mb+lUN29ETQGIP VdLT/Xh+V7NwAaXYQY/CjtWiWHdVtKeMTw+Yt4EPp/Rt3S82dsowQw6lxMJABXFBRgYGVY SIhAK/fJ5xKf5Z/3eJb33ePcaTRKz+w= Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-343-alrR2emCOwmtWT1DsJbvlw-1; Thu, 14 Oct 2021 11:24:44 -0400 X-MC-Unique: alrR2emCOwmtWT1DsJbvlw-1 Received: by mail-wr1-f70.google.com with SMTP id v15-20020adfa1cf000000b00160940b17a2so4816155wrv.19 for ; Thu, 14 Oct 2021 08:24:44 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:organization:in-reply-to :content-transfer-encoding; bh=HBGMhkW5l3xF58RlsWd4EAEKmLqaalQ7yZY4iWVTFTE=; b=B+mRcSfVvq4Gk8XgxKq6F+ddc2umZg9FM8eglFx+GCEyeTcUZgDb3wu470N8bB6rXU v95wbjW+fIAywsgBsXtX9jfHMHatyWgVhSfFwovUvWsir9lam2rGUElGgEx6ksWZyE0d Fz3cr5Hn+bZX9zlgwWb9r3rBbbVwUE8taEfRyaKKfcDR6tTm+IHIyVyCasPpzni3Qvts qTTjUcd1bxRLIE2SBe4VUrgaGIbFkaGJaCD1EGRpngb/gtG5M67y30ES6D25WHlZFddr qgpKJhnvprAa3joN50CtiFnECnegQGn+CjZL1+hSwum8yVqkLuYauPq/lN9rqtv20aEq LAAw== X-Gm-Message-State: AOAM532FeHPlkGm9bTqDRthAXnFYSKaEJgG51qOKOWNh+UkzJcCSi7YB zCIJnFxEY35wSjEjINzSLeAU3XGwpF4/gk71lApZ+dfA04aVmjjT3GiP4ZnHtUPd0OTXxSYge8k InIUoUOAepUA= X-Received: by 2002:a05:600c:4f8b:: with SMTP id n11mr6387179wmq.54.1634225083148; Thu, 14 Oct 2021 08:24:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzYP7fwAuhg8aaoUbBVxOQCwoZYB4gcFaYUWfrZsNY6fPstrdXmDGBHNtD9+emUpkCG1n2fEg== X-Received: by 2002:a05:600c:4f8b:: with SMTP id n11mr6387148wmq.54.1634225082934; Thu, 14 Oct 2021 08:24:42 -0700 (PDT) Received: from [192.168.3.132] (p5b0c694e.dip0.t-ipconnect.de. [91.12.105.78]) by smtp.gmail.com with ESMTPSA id v185sm8368508wme.35.2021.10.14.08.24.41 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 14 Oct 2021 08:24:42 -0700 (PDT) Message-ID: <84b44b45-217e-885a-c513-de266315888f@redhat.com> Date: Thu, 14 Oct 2021 17:24:41 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.1.0 Subject: Re: [PATCH v2] memcg: page_alloc: skip bulk allocator for __GFP_ACCOUNT To: Shakeel Butt , Johannes Weiner , Michal Hocko , Mel Gorman Cc: Uladzislau Rezki , Vasily Averin , Roman Gushchin , Matthew Wilcox , Andrew Morton , cgroups@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org References: <20211014151607.2171970-1-shakeelb@google.com> From: David Hildenbrand Organization: Red Hat In-Reply-To: <20211014151607.2171970-1-shakeelb@google.com> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 6DA17D04073E X-Stat-Signature: 3qn18aawzs1aced9qgnwb7ietezumsyx Authentication-Results: imf21.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b="A/VMNZ18"; dmarc=pass (policy=none) header.from=redhat.com; spf=none (imf21.hostedemail.com: domain of david@redhat.com has no SPF policy when checking 216.205.24.124) smtp.mailfrom=david@redhat.com X-Rspamd-Server: rspam02 X-HE-Tag: 1634225087-887183 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: On 14.10.21 17:16, Shakeel Butt wrote: > 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 > --- > Changes since v1: > - do fallback allocation instead of failure, suggested by Michal Hocko. > - Added memcg_kmem_enabled() check, corrected by Vasily Averin > > mm/page_alloc.c | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/mm/page_alloc.c b/mm/page_alloc.c > index 668edb16446a..9ca871dc8602 100644 > --- a/mm/page_alloc.c > +++ b/mm/page_alloc.c > @@ -5230,6 +5230,10 @@ unsigned long __alloc_pages_bulk(gfp_t gfp, int preferred_nid, > if (unlikely(page_array && nr_pages - nr_populated == 0)) > goto out; > > + /* Bulk allocator does not support memcg accounting. */ > + if (memcg_kmem_enabled() && (gfp & __GFP_ACCOUNT)) > + goto failed; > + > /* Use the single page allocator for one page. */ > if (nr_pages - nr_populated == 1) > goto failed; > LGTM Acked-by: David Hildenbrand -- Thanks, David / dhildenb