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, URIBL_BLOCKED,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 2917DC4338F for ; Thu, 29 Jul 2021 14:03:33 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 989EF60F48 for ; Thu, 29 Jul 2021 14:03:32 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 989EF60F48 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 21B218D0002; Thu, 29 Jul 2021 10:03:32 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 1CC2D8D0001; Thu, 29 Jul 2021 10:03:32 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 0BA158D0002; Thu, 29 Jul 2021 10:03:32 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0222.hostedemail.com [216.40.44.222]) by kanga.kvack.org (Postfix) with ESMTP id E5E7B8D0001 for ; Thu, 29 Jul 2021 10:03:31 -0400 (EDT) Received: from smtpin09.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 8BD0518253A59 for ; Thu, 29 Jul 2021 14:03:31 +0000 (UTC) X-FDA: 78415793022.09.AD7650C Received: from mail-lj1-f182.google.com (mail-lj1-f182.google.com [209.85.208.182]) by imf04.hostedemail.com (Postfix) with ESMTP id 31F0A50000A4 for ; Thu, 29 Jul 2021 14:03:31 +0000 (UTC) Received: by mail-lj1-f182.google.com with SMTP id h11so7636605ljo.12 for ; Thu, 29 Jul 2021 07:03:30 -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=h4HxCrPv2nHY4WojFwqRRKr/XuvP+P2kNyaf8CVbmQA=; b=UVfa+s2qTXOHLywI++x8/3rTAglgFws2bP4BUnE/ySOTZk6kJfTR+C9VivplKI7fYp eQpA+wZlN/eNBNkC8VBp4F3AwA5Xevn6TQpmUi+ckobTmkn6mh61dvKRziifrb8usds7 g15YcY2thd8vbBaLw6zUd/MMWs6hG+xzp8ysoklza/PePYOA0RRSpRa1jaqFx1Ryh4a2 eAkBcMarMtkP3pfIocGw7fkSZ0KLaseQXnu66r8OxehggNxrjF2AYhOkXkd6I2Co83iA UENT0ZK/GBnsx9ARBvffU6BDKSZu34bbq49bpH8hM1z1XSjTtHkLJ1qnVJWZwKKe8cK/ 8kGw== 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=h4HxCrPv2nHY4WojFwqRRKr/XuvP+P2kNyaf8CVbmQA=; b=EXwl+UPjp32mQz48+3GQ1yx1dkD+KTaFhQ2XmYZ6U/010n3XBx89TCP9Z8yirMor8Y U13kLtpThtFI1BIOQUPKmhDFWtWITI+Fvtj8xLGUabZpvn0DEg64dgGdfvP+FHeyHpBC vKJynYqWVVTIWHtuNXs5ZqWloiEwHpU/cJ6+oOwyaBtFKkMWmMZvdBTMGFZx2tXorr4P 14pgm7P11/0u7ZJUsz3vwXP6JHijTrslcPxG6VE5q3wR5A/xaO9DgkETWJxBcu1r0n3A LBVwblp9v8slPDvhsQf6MCbblk8UbRzhklx7cGzooQMwiADtMln1/39toE6/uirQFn9q FMxA== X-Gm-Message-State: AOAM531IFliJedRGpvgK9gdajZ+QmLnW+8JJVIE91oEqj/j29xDUFpr2 92CU0jsp2gXI69vkSI9bC4MmdJ9tJkW9Os234G76qQ== X-Google-Smtp-Source: ABdhPJw3yQovWlC8B1n/adJ/irgUUq1IGOPYdaP+54tBXbWyF1uuvAizWPJwKvpBsDCJXh/62Qn7x6nqY41u+HPWev8= X-Received: by 2002:a2e:8e24:: with SMTP id r4mr2975434ljk.34.1627567408888; Thu, 29 Jul 2021 07:03:28 -0700 (PDT) MIME-Version: 1.0 References: <20210728155354.3440560-1-shakeelb@google.com> <8c14efe2-69dc-6eab-3cd5-c042576770e7@huawei.com> In-Reply-To: <8c14efe2-69dc-6eab-3cd5-c042576770e7@huawei.com> From: Shakeel Butt Date: Thu, 29 Jul 2021 07:03:17 -0700 Message-ID: Subject: Re: [PATCH] slub: fix unreclaimable slab stat for bulk free To: Kefeng Wang Cc: Christoph Lameter , Pekka Enberg , David Rientjes , Vlastimil Babka , Michal Hocko , Roman Gushchin , Wang Hai , Muchun Song , Andrew Morton , Linux MM , LKML Content-Type: text/plain; charset="UTF-8" X-Rspamd-Server: rspam01 X-Rspamd-Queue-Id: 31F0A50000A4 Authentication-Results: imf04.hostedemail.com; dkim=pass header.d=google.com header.s=20161025 header.b=UVfa+s2q; spf=pass (imf04.hostedemail.com: domain of shakeelb@google.com designates 209.85.208.182 as permitted sender) smtp.mailfrom=shakeelb@google.com; dmarc=pass (policy=reject) header.from=google.com X-Stat-Signature: 1ohjygp3ufqfuyqisrekxu9ijinngosz X-HE-Tag: 1627567411-977355 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 Wed, Jul 28, 2021 at 11:52 PM Kefeng Wang wrote: > > > On 2021/7/28 23:53, Shakeel Butt wrote: > > SLUB uses page allocator for higher order allocations and update > > unreclaimable slab stat for such allocations. At the moment, the bulk > > free for SLUB does not share code with normal free code path for these > > type of allocations and have missed the stat update. So, fix the stat > > update by common code. The user visible impact of the bug is the > > potential of inconsistent unreclaimable slab stat visible through > > meminfo and vmstat. > > > > Fixes: 6a486c0ad4dc ("mm, sl[ou]b: improve memory accounting") > > Signed-off-by: Shakeel Butt > > --- > > mm/slub.c | 22 ++++++++++++---------- > > 1 file changed, 12 insertions(+), 10 deletions(-) > > > > diff --git a/mm/slub.c b/mm/slub.c > > index 6dad2b6fda6f..03770291aa6b 100644 > > --- a/mm/slub.c > > +++ b/mm/slub.c > > @@ -3238,6 +3238,16 @@ struct detached_freelist { > > struct kmem_cache *s; > > }; > > > > +static inline void free_nonslab_page(struct page *page) > > +{ > > + unsigned int order = compound_order(page); > > + > > + VM_BUG_ON_PAGE(!PageCompound(page), page); > > Could we add WARN_ON here, or we got nothing when CONFIG_DEBUG_VM is > disabled. I don't have a strong opinion on this. Please send a patch with reasoning if you want WARN_ON_ONCE here.