Received: by 2002:a05:6a10:c7c6:0:0:0:0 with SMTP id h6csp2476080pxy; Tue, 3 Aug 2021 07:26:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz9nOuUcH1RieadKmMQLP7ysTz9mruPN+8aLD6V1Z7EzUibh6nuNeJjj4zSb1Y/xg3VI3EU X-Received: by 2002:a05:6602:3404:: with SMTP id n4mr424084ioz.31.1628000760341; Tue, 03 Aug 2021 07:26:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628000760; cv=none; d=google.com; s=arc-20160816; b=Vue3JhW4hASpMiA1EdpwX6lfwOBM/hGOXE+nSGRPhgdLNUro3PyfSXEhm69ButDFXh 8uoZOXIfYLr01Y8ZpbJasGZqBdHSPOYhSvczPbML6ZeBrKtXg3ycr+KiF5eL0MXVxmg7 nwUeHGsHcq0aNpdVcaUEHm6MLtoF9GvGYNOk35fRElq9Df74fmtaXiyWzXGOAvpO+Iwz hrBDgn/bg0BMH1/sLbd/sduPxdZ1BFyz+8L+aRhBjSJmq4YKl/HdRHjoVIb/bymkU08I Fwh0OFh/6+HF9s6aa25AJ6V4xVYgoo0Y4qcz3jLSfmL4xDpuI6nBdNOio5nF0ZMxgyJ/ OvzQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-language:content-transfer-encoding :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=Uy2G/90alP3XE/ho2b4pNBYoaZ4NHAa+s6K6GuJEYEg=; b=IIcFvVnn6GJVYIibOALW8cQY/gjbyQ8xudEoqr3Y3Cpsbw3KMm8jLABV6y9Ik66TC4 Lx2i6cMOWpI8TiYPIjPZ41bjjkAe11nFtncYB3ZPlKN3zPiZ3mOBAgOChX3e3LAxvVS0 sQ9V9MvK92IsEfsWNBgr8lnu5TzUg9c6lYGWFDkUJZicsp5PjzxfzNq2qdwIFHxyYC4m 8FHnHgrkVSya+gEe/+T21JleooHvMubAXqOY0ulprgBBdo1P/pkVcXFXRi95ts6LrQpN K9s2cYLtZPujAUIsaeiYO5OycjxRDZMKBO8gwrIaX0X0eY/VEbjkGtINdVLB7IqKcuws Dfnw== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l6si17301924ilk.99.2021.08.03.07.25.47; Tue, 03 Aug 2021 07:26:00 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236518AbhHCOYz (ORCPT + 99 others); Tue, 3 Aug 2021 10:24:55 -0400 Received: from szxga02-in.huawei.com ([45.249.212.188]:7919 "EHLO szxga02-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236282AbhHCOYy (ORCPT ); Tue, 3 Aug 2021 10:24:54 -0400 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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. > . >