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=-15.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 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 EF7E9C4338F for ; Tue, 3 Aug 2021 14:24:51 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 827956103C for ; Tue, 3 Aug 2021 14:24:51 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 827956103C Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=huawei.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 96F238D0002; Tue, 3 Aug 2021 10:24:50 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 920E58D0001; Tue, 3 Aug 2021 10:24:50 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 80EAE8D0002; Tue, 3 Aug 2021 10:24:50 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0203.hostedemail.com [216.40.44.203]) by kanga.kvack.org (Postfix) with ESMTP id 639308D0001 for ; Tue, 3 Aug 2021 10:24:50 -0400 (EDT) Received: from smtpin33.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 018F4181AF5EA for ; Tue, 3 Aug 2021 14:24:50 +0000 (UTC) X-FDA: 78433990740.33.00BE292 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by imf29.hostedemail.com (Postfix) with ESMTP id 1E034901E0CF for ; Tue, 3 Aug 2021 14:24:47 +0000 (UTC) Received: from dggemv711-chm.china.huawei.com (unknown [172.30.72.55]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4GfH8y65sNz83Th; Tue, 3 Aug 2021 22:20:50 +0800 (CST) Received: from dggpemm500001.china.huawei.com (7.185.36.107) by dggemv711-chm.china.huawei.com (10.1.198.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Tue, 3 Aug 2021 22:24:41 +0800 Received: from [10.174.177.243] (10.174.177.243) by dggpemm500001.china.huawei.com (7.185.36.107) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Tue, 3 Aug 2021 22:24:40 +0800 Subject: Re: [PATCH] slub: fix unreclaimable slab stat for bulk free To: Shakeel Butt CC: Christoph Lameter , Pekka Enberg , "David Rientjes" , Vlastimil Babka , "Michal Hocko" , Roman Gushchin , Wang Hai , Muchun Song , Andrew Morton , Linux MM , LKML References: <20210728155354.3440560-1-shakeelb@google.com> <8c14efe2-69dc-6eab-3cd5-c042576770e7@huawei.com> From: Kefeng Wang Message-ID: <35a0b75a-f348-d21c-4ff4-fadba0c4db02@huawei.com> Date: Tue, 3 Aug 2021 22:24:39 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.7.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-Originating-IP: [10.174.177.243] X-ClientProxiedBy: dggems701-chm.china.huawei.com (10.3.19.178) To dggpemm500001.china.huawei.com (7.185.36.107) X-CFilter-Loop: Reflected X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: 1E034901E0CF Authentication-Results: imf29.hostedemail.com; dkim=none; dmarc=pass (policy=none) header.from=huawei.com; spf=pass (imf29.hostedemail.com: domain of wangkefeng.wang@huawei.com designates 45.249.212.188 as permitted sender) smtp.mailfrom=wangkefeng.wang@huawei.com X-Stat-Signature: 3j5tf3yc68uqho34nqr1j69t5fn3c45r X-HE-Tag: 1628000687-149229 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 2021/7/29 22:03, Shakeel Butt wrote: > 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. Ok, we met a BUG_ON(!PageCompound(page)) in kfree() twice in lts4.4, we are still debugging it. It's different to analyses due to no vmcore, and can't be reproduced. WARN_ON() here could help us to notice the issue. Also is there any experience or known fix/way to debug this kinds of issue? memory corruption? Any suggestion will be appreciated, thanks. > . >