From patchwork Tue Jul 12 02:28:07 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rongwei Wang X-Patchwork-Id: 12914477 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id B0557C43334 for ; Tue, 12 Jul 2022 02:28:19 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 20CAA940032; Mon, 11 Jul 2022 22:28:19 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 193A8940010; Mon, 11 Jul 2022 22:28:19 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 03439940032; Mon, 11 Jul 2022 22:28:18 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id E0F56940010 for ; Mon, 11 Jul 2022 22:28:18 -0400 (EDT) Received: from smtpin21.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay11.hostedemail.com (Postfix) with ESMTP id A7F6F809C5 for ; Tue, 12 Jul 2022 02:28:18 +0000 (UTC) X-FDA: 79676863476.21.EA4A501 Received: from out30-57.freemail.mail.aliyun.com (out30-57.freemail.mail.aliyun.com [115.124.30.57]) by imf01.hostedemail.com (Postfix) with ESMTP id 21B8F40030 for ; Tue, 12 Jul 2022 02:28:15 +0000 (UTC) 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 ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1657592898; a=rsa-sha256; cv=none; b=B6DSehxUVK2G0G+IVjYzTAO6Ln396Rh3AqjN2KqF2FsaJ0ZfXghdzNjvgRfuFu9upsglaL 2AnSBickgCMtvzw3gmvRjj1TwZpYuL3gTqW+IjMnaa9dnauJAZr25pTXMwb9Zc9bqHQ4wg koWmlk2W+CZCt1FqY9vU6rEioNzwEN8= ARC-Authentication-Results: i=1; imf01.hostedemail.com; dkim=none; spf=pass (imf01.hostedemail.com: domain of rongwei.wang@linux.alibaba.com designates 115.124.30.57 as permitted sender) smtp.mailfrom=rongwei.wang@linux.alibaba.com; dmarc=pass (policy=none) header.from=alibaba.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1657592898; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Hx/OmN7i5DePavteDrpEzsZSE2sGzJ9oASfjNC/R13s=; b=ZIHaDKVS5rM0X6+bHL9VKvfxXQjjNauW0Ng0ZOozKzHsZPNSQEF9PjDH65se1joZFxL4U9 crdOEJOxy1f0SsmbY0BDYiSZwsqcybyXcNkgPc9SO3P5VLXTiuwo+wzAidJWxBcnztOK5U Ve9Pm3FVaS2dtr0KxpKdskGK8um/OT0= X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: 21B8F40030 X-Rspam-User: X-Stat-Signature: mw66581gchymj85pxwgmit1hsxuxe3qt Authentication-Results: imf01.hostedemail.com; dkim=none; spf=pass (imf01.hostedemail.com: domain of rongwei.wang@linux.alibaba.com designates 115.124.30.57 as permitted sender) smtp.mailfrom=rongwei.wang@linux.alibaba.com; dmarc=pass (policy=none) header.from=alibaba.com X-HE-Tag: 1657592895-79945 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: 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);