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 X-Spam-Level: X-Spam-Status: No, score=-23.3 required=3.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_IN_DEF_DKIM_WL 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 59286C433ED for ; Tue, 4 May 2021 20:06:34 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id BB9DF61132 for ; Tue, 4 May 2021 20:06:33 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BB9DF61132 Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 4189D6B0036; Tue, 4 May 2021 16:06:33 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 3F0C36B006E; Tue, 4 May 2021 16:06:33 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 290886B0070; Tue, 4 May 2021 16:06:33 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0031.hostedemail.com [216.40.44.31]) by kanga.kvack.org (Postfix) with ESMTP id 091656B0036 for ; Tue, 4 May 2021 16:06:33 -0400 (EDT) Received: from smtpin14.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id B6BBF98BF for ; Tue, 4 May 2021 20:06:32 +0000 (UTC) X-FDA: 78104631024.14.5943441 Received: from mail-lf1-f45.google.com (mail-lf1-f45.google.com [209.85.167.45]) by imf06.hostedemail.com (Postfix) with ESMTP id 20480C0007CC for ; Tue, 4 May 2021 20:06:34 +0000 (UTC) Received: by mail-lf1-f45.google.com with SMTP id z9so10641652lfu.8 for ; Tue, 04 May 2021 13:06:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=bicsEuUz1gvZF81DYUlP6NvUpuHppuBYNALePyNxC9g=; b=bNvfSVbrfIgA95/qF4ZeFRRJsvGk4NJDBuE/W5Mo3pSCABnQdq0tJklynnt2iyRivt 9xOMr5TEYWmPqYFVpqHiDwRLKNXBwFrMNDLuFGAun6YlWgWL+rtnaFljOoB6/Gx1qSIm iBVni8M3rbgLVuzq1Qu2Zk24kVhwOSchxgP8/xupAYXq5ju4dW2MrHTdjEWuC9C8JM/f RXoTLo3gqaDhyUq5y7WB3V+oHJ6W5V2ha3OD+WXseWJNokN6WU0deSL4hmToQEUOdQmn EcXf4Iix1oU4U1299rFyIyIhXxCYmfP5GNGSXAK+6/acAjcQxLvg4dn1/lWs/fVeR6ZF /Vpg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=bicsEuUz1gvZF81DYUlP6NvUpuHppuBYNALePyNxC9g=; b=hpFyclAG+TnmzOGqxXVa4/NWcUzvSGFvLUzHFVttKyPTTjEOqIS7ysSCL4EIQYIXGW kAPnRT8rYFcq4ms5QwYmxJj3Sd98x4BZnp4xuzf9FyjIBSaMGHuvxeiNb5kpKadVju2b BLGCBLKlNq7dWPXjyRHdSfZPb2v4Be6xwXPjICJMcVSC09C+Qmu9du1eUcqDuC1vgsFw cNViJfd3gGGW9F/9ZJ5t0RP/TH6YaRyezVDHttKaJBXDILwyXqs7giaxEx95B5qE3yv3 x0weTpnXc5sQaI3CDB4N00PyrjRKrayb+R325/5rbt+SHOP3CNRvS7iPsvjcADRywIrZ NSQA== X-Gm-Message-State: AOAM533CP/ukWkQEQ2NfQxuJpb4//ne/JCnj6tC2dpFPIGbKBgvWslWx Xlhqc+if3hiUazsGdXPeCyrV1AwS//rREQKcpFzhtg== X-Google-Smtp-Source: ABdhPJwKtfoljjPRo13PwAVotpRKJyTHqnYx5fpV6N1HiH3pDpyXr0DLOCZ+VOj2Zig8ET/uSnimzlZ9y/etJutPfbI= X-Received: by 2002:a05:6512:1182:: with SMTP id g2mr8642302lfr.117.1620158790666; Tue, 04 May 2021 13:06:30 -0700 (PDT) MIME-Version: 1.0 References: <20210504132350.4693-1-longman@redhat.com> <20210504132350.4693-2-longman@redhat.com> <267501a0-f416-4058-70d3-e32eeec3d6da@redhat.com> In-Reply-To: <267501a0-f416-4058-70d3-e32eeec3d6da@redhat.com> From: Shakeel Butt Date: Tue, 4 May 2021 13:06:19 -0700 Message-ID: Subject: Re: [PATCH v2 1/2] mm: memcg/slab: Properly set up gfp flags for objcg pointer array To: Waiman Long Cc: Johannes Weiner , Michal Hocko , Vladimir Davydov , Andrew Morton , Christoph Lameter , Pekka Enberg , David Rientjes , Joonsoo Kim , Vlastimil Babka , Roman Gushchin , LKML , Cgroups , Linux MM Content-Type: text/plain; charset="UTF-8" Authentication-Results: imf06.hostedemail.com; dkim=pass header.d=google.com header.s=20161025 header.b=bNvfSVbr; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf06.hostedemail.com: domain of shakeelb@google.com designates 209.85.167.45 as permitted sender) smtp.mailfrom=shakeelb@google.com X-Rspamd-Server: rspam03 X-Stat-Signature: twtecp87oah6stdby88qafpmenkfmdkw X-Rspamd-Queue-Id: 20480C0007CC Received-SPF: none (google.com>: No applicable sender policy available) receiver=imf06; identity=mailfrom; envelope-from=""; helo=mail-lf1-f45.google.com; client-ip=209.85.167.45 X-HE-DKIM-Result: pass/pass X-HE-Tag: 1620158794-862067 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 Tue, May 4, 2021 at 1:02 PM Waiman Long wrote: > > On 5/4/21 3:37 PM, Shakeel Butt wrote: > > On Tue, May 4, 2021 at 6:24 AM Waiman Long wrote: > >> Since the merging of the new slab memory controller in v5.9, the page > >> structure may store a pointer to obj_cgroup pointer array for slab pages. > >> Currently, only the __GFP_ACCOUNT bit is masked off. However, the array > >> is not readily reclaimable and doesn't need to come from the DMA buffer. > >> So those GFP bits should be masked off as well. > >> > >> Do the flag bit clearing at memcg_alloc_page_obj_cgroups() to make sure > >> that it is consistently applied no matter where it is called. > >> > >> Fixes: 286e04b8ed7a ("mm: memcg/slab: allocate obj_cgroups for non-root slab pages") > >> Signed-off-by: Waiman Long > >> --- > >> mm/memcontrol.c | 8 ++++++++ > >> mm/slab.h | 1 - > >> 2 files changed, 8 insertions(+), 1 deletion(-) > >> > >> diff --git a/mm/memcontrol.c b/mm/memcontrol.c > >> index c100265dc393..5e3b4f23b830 100644 > >> --- a/mm/memcontrol.c > >> +++ b/mm/memcontrol.c > >> @@ -2863,6 +2863,13 @@ static struct mem_cgroup *get_mem_cgroup_from_objcg(struct obj_cgroup *objcg) > >> } > >> > >> #ifdef CONFIG_MEMCG_KMEM > >> +/* > >> + * The allocated objcg pointers array is not accounted directly. > >> + * Moreover, it should not come from DMA buffer and is not readily > >> + * reclaimable. So those GFP bits should be masked off. > >> + */ > >> +#define OBJCGS_CLEAR_MASK (__GFP_DMA | __GFP_RECLAIMABLE | __GFP_ACCOUNT) > > What about __GFP_DMA32? Does it matter? It seems like DMA32 requests > > go to normal caches. > > I included __GFP_DMA32 in my first draft patch. However, __GFP_DMA32 is > not considered in determining the right kmalloc_type() (patch 2), so I > took it out to make it consistent. I can certainly add it back. > No this is fine and DMA32 question is unrelated to this patch series.