Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp3913141imw; Mon, 11 Jul 2022 19:38:50 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sZAU4hjlWqQT8XOqg4Qw/7aLuni3r7tnZauEsiy8aawvKcax03lRlceeaiGQEHf+cPZBzK X-Received: by 2002:a17:907:7347:b0:72b:def:814 with SMTP id dq7-20020a170907734700b0072b0def0814mr22747458ejc.18.1657593530248; Mon, 11 Jul 2022 19:38:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657593530; cv=none; d=google.com; s=arc-20160816; b=ogBy4zm34mlcj24tNkLs74ccZx2r2DSiCJQbaKOrk1k+E2DAeuFUQri+pcZbd4KKhb oP3MKf5Y3g4m1cMXaSWa7DNu/iHbWemXAbwklvYHW8h5y/psdkc8ksZK+FVNhzY48jCf OYV52ggzy33loBzYUCaDBnvXdfARmGZkL8Lit7PBSdj0MM0FsnzpyxiKRH1VYS4DoS75 uweVgku83O9L1qeZc8vHHp2t1X/X2lostZudha4vcGBaTyTCPrpu0I11uPKk4RsWSmaA ePXWnUFEj8Qka36XLe+w/Abc8yYX8FTemLIxWKPivz0KJFSrtdz3WPS1xpcUS0OefLRE FGSQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=Hx/OmN7i5DePavteDrpEzsZSE2sGzJ9oASfjNC/R13s=; b=t0ahyoRAZSWuSxkYULsQA18rhY6V+b4a8uNLrNxswEHFg/cCPYTSL2WfKpItdny6P0 F8yEmLc8LlQsZeuum8UpBvtQT0YqSUMO4S1Y4j5vcJF6OlAajd6KlHcPaDGW+bljYm4j T22KwM83ZSmkDdW444muy6drgMti4ZSb3jZuptreYKDdZn+GJWXDyIJe9m5vqGOf4O9f qeH7gOegiMDH6amjcilTwWmqM8UVAW9cIeGvUkZqw6dys6L9yFMw9KzY7/csNPnMfWtC cFwGbdH9+FKdpMxj4Q+rSkFrKXavwlP2/OuRDhi8Le9GsuESz0DIIsExIwE9ZUS5zzQc 9MTg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id r17-20020a50aad1000000b0043a91d23f66si11904345edc.512.2022.07.11.19.38.24; Mon, 11 Jul 2022 19:38:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230356AbiGLC21 (ORCPT + 99 others); Mon, 11 Jul 2022 22:28:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34002 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229883AbiGLC2R (ORCPT ); Mon, 11 Jul 2022 22:28:17 -0400 Received: from out30-42.freemail.mail.aliyun.com (out30-42.freemail.mail.aliyun.com [115.124.30.42]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D13AC8AB26 for ; Mon, 11 Jul 2022 19:28:15 -0700 (PDT) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R271e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018046050;MF=rongwei.wang@linux.alibaba.com;NM=1;PH=DS;RN=10;SR=0;TI=SMTPD_---0VJ6Ep2o_1657592891; Received: from localhost.localdomain(mailfrom:rongwei.wang@linux.alibaba.com fp:SMTPD_---0VJ6Ep2o_1657592891) by smtp.aliyun-inc.com; Tue, 12 Jul 2022 10:28:12 +0800 From: Rongwei Wang To: akpm@linux-foundation.org, vbabka@suse.cz, 42.hyeyoo@gmail.com, roman.gushchin@linux.dev, iamjoonsoo.kim@lge.com, rientjes@google.com, penberg@kernel.org, cl@gentwo.de Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 3/3] mm/slub: delete confusing pr_err when debugging slub Date: Tue, 12 Jul 2022 10:28:07 +0800 Message-Id: <20220712022807.44113-3-rongwei.wang@linux.alibaba.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220712022807.44113-1-rongwei.wang@linux.alibaba.com> References: <20220712022807.44113-1-rongwei.wang@linux.alibaba.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-9.9 required=5.0 tests=BAYES_00, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,UNPARSEABLE_RELAY,USER_IN_DEF_SPF_WL autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The n->nr_slabs will be updated when really to allocate or free a slab, but this slab is unnecessarily in full list or partial list of one node. That means the total count of slab in node's full and partial list is unnecessarily equal to n->nr_slabs, even though flush_all() has been called. An example here, an error message likes below will be printed when 'slabinfo -v' is executed: SLUB: kmemleak_object 4157 slabs counted but counter=4161 SLUB: kmemleak_object 4072 slabs counted but counter=4077 SLUB: kmalloc-2k 19 slabs counted but counter=20 SLUB: kmalloc-2k 12 slabs counted but counter=13 SLUB: kmemleak_object 4205 slabs counted but counter=4209 Here, deleting this pr_err() directly. Signed-off-by: Rongwei Wang --- mm/slub.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/mm/slub.c b/mm/slub.c index 587416e39292..cdac004f232f 100644 --- a/mm/slub.c +++ b/mm/slub.c @@ -5059,11 +5059,6 @@ static int validate_slab_node(struct kmem_cache *s, validate_slab(s, slab, obj_map); count++; } - if (count != atomic_long_read(&n->nr_slabs)) { - pr_err("SLUB: %s %ld slabs counted but counter=%ld\n", - s->name, count, atomic_long_read(&n->nr_slabs)); - slab_add_kunit_errors(); - } out: spin_unlock_irqrestore(&n->list_lock, flags); -- 2.27.0