From patchwork Thu Apr 13 14:34:49 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xiongwei Song X-Patchwork-Id: 13210357 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 4E7B8C77B61 for ; Thu, 13 Apr 2023 14:35:48 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id BECAD6B007B; Thu, 13 Apr 2023 10:35:47 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id B9C52900003; Thu, 13 Apr 2023 10:35:47 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A8AD5900002; Thu, 13 Apr 2023 10:35:47 -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 9C08F6B007B for ; Thu, 13 Apr 2023 10:35:47 -0400 (EDT) Received: from smtpin24.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 625441A0146 for ; Thu, 13 Apr 2023 14:35:46 +0000 (UTC) X-FDA: 80676616692.24.3939FB6 Received: from pv50p00im-ztdg10011301.me.com (pv50p00im-ztdg10011301.me.com [17.58.6.40]) by imf14.hostedemail.com (Postfix) with ESMTP id 623FA100021 for ; Thu, 13 Apr 2023 14:35:44 +0000 (UTC) Authentication-Results: imf14.hostedemail.com; dkim=pass header.d=me.com header.s=1a1hai header.b=XcKoR5cL; spf=pass (imf14.hostedemail.com: domain of sxwjean@me.com designates 17.58.6.40 as permitted sender) smtp.mailfrom=sxwjean@me.com; dmarc=pass (policy=quarantine) header.from=me.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1681396544; 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:dkim-signature; bh=8jRYHdyOLx4stczwHdVkraZpDl6WNFY1n6xs2s88Ih4=; b=Gx/NSwJLsYxroK1OZcuzt+DLoMV3+qUP4uUM3eSSNuDXM7q8SJYkfQy5qyCf4yTdbVDSYp dNJ8bnmd7ggxB+BViElwtSE5/jTL9JKflsU2Ge9vgXF5gLqdrLLLlukQsArrhjE0HSGmVK /DmqzkZhptNOvJccDPmar3Qx4CowYpw= ARC-Authentication-Results: i=1; imf14.hostedemail.com; dkim=pass header.d=me.com header.s=1a1hai header.b=XcKoR5cL; spf=pass (imf14.hostedemail.com: domain of sxwjean@me.com designates 17.58.6.40 as permitted sender) smtp.mailfrom=sxwjean@me.com; dmarc=pass (policy=quarantine) header.from=me.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1681396544; a=rsa-sha256; cv=none; b=qIKwSVmnYcLkq8qUGw2fhVyG/fEKunXLMF11sDqNxrTmggyJ3M7n8nOsLOYn+C7GyYT6wO 3qoM2kiqEpITh+SapDu7WxroVVslUAuw/u1fYQvfF43qyEjoRTCgpZahxL/o+7E7sfOK+U hK9AwUqqKKXxToaUl1xPgzk4WNPU9NI= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=me.com; s=1a1hai; t=1681396543; bh=8jRYHdyOLx4stczwHdVkraZpDl6WNFY1n6xs2s88Ih4=; h=From:To:Subject:Date:Message-Id:MIME-Version; b=XcKoR5cL/+upnaXqW5vEFVtkOztLb/OPL22EeKcuRy5aCKbMwJbI0lmkNMOd97cF8 U4nWgm3EJLu3+KVDvf2gpegVHJId7BREhcCxvx0qgyQyLCBDTjraGch7/Mh+sNnUpG 92/s8k/7x+2YqeGtk54ynj7p2UiHQ7d14zQlskNXll1HQ2Y1ksAoVjU0kHOYzrYiPh O4AJHBWOs1x1gkwS9kM8kB0zDEJDbBt+ipH34112Kl8ECnMt0m7FFOWkdnvWUFNQsi BPcQeMwhwXLQhEceqI+c8OpkxVYB4WBRjjstjTcPZrynKlB+GOgOZrkIwuBvUOfAV7 O7Z4mjnAAXeZQ== Received: from xiongwei.. (pv50p00im-dlb-asmtp-mailmevip.me.com [17.56.9.10]) by pv50p00im-ztdg10011301.me.com (Postfix) with ESMTPSA id 95D4518043E; Thu, 13 Apr 2023 14:35:37 +0000 (UTC) From: sxwjean@me.com To: cl@linux.com, penberg@kernel.org, rientjes@google.com, iamjoonsoo.kim@lge.com, akpm@linux-foundation.org, vbabka@suse.cz, roman.gushchin@linux.dev, 42.hyeyoo@gmail.com, keescook@chromium.org Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, linux-hardening@vger.kernel.org, Xiongwei Song Subject: [PATCH 2/5] slub: Put objects_show() into CONFIG_SLUB_DEBUG enabled block Date: Thu, 13 Apr 2023 22:34:49 +0800 Message-Id: <20230413143452.211250-3-sxwjean@me.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230413143452.211250-1-sxwjean@me.com> References: <20230413143452.211250-1-sxwjean@me.com> MIME-Version: 1.0 X-Proofpoint-GUID: QqH1Ghpj5ydBr4pmMZw4eIZhmrwWvj9d X-Proofpoint-ORIG-GUID: QqH1Ghpj5ydBr4pmMZw4eIZhmrwWvj9d X-Proofpoint-Virus-Version: =?utf-8?q?vendor=3Dfsecure_engine=3D1=2E1=2E170-?= =?utf-8?q?22c6f66c430a71ce266a39bfe25bc2903e8d5c8f=3A6=2E0=2E517=2C18=2E0?= =?utf-8?q?=2E883=2C17=2E0=2E605=2E474=2E0000000_definitions=3D2022-06-21=5F?= =?utf-8?q?08=3A2022-06-21=5F01=2C2022-06-21=5F08=2C2020-01-23=5F02_signatur?= =?utf-8?q?es=3D0?= X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 phishscore=0 clxscore=1015 bulkscore=0 malwarescore=0 adultscore=0 suspectscore=0 mlxlogscore=999 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2209130000 definitions=main-2304130130 X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: 623FA100021 X-Rspam-User: X-Stat-Signature: q5acik3aa7eoymbn9b7s1nznbgis3xhg X-HE-Tag: 1681396544-475791 X-HE-Meta: U2FsdGVkX1+enmDlnTPBJLCknOMERZU+ukd4b57GmT8MI3tfgYc+c+gzQUOlnM4EWH+eZAx9ef8NGrOhZHpsszemZ9H7I4quBf3rLauCMxs74gkFTMGwo1DQGLyF0YYAgvo9iwyLBEZ6+B1KgNeQlZ89B31T5alabcH0YqBd51QWL9I9jIs/ZY1pnWRsexkQ8EHs7ALiO9HKK2lBphxvUJbyxHAHaY6NPfAGD8tRLXWrfs3G7Dp8nPTjpsfz9t2vrCIkWfAIfegeG33x1rQu5nQw8XqxYz5K4W9KVnSqJ0BuWRwIofv6p+xTj3mlSjpwbHXCFHSnyNZH3WyIQPR9itLek2EwbgrzUsJbj1NO6S/1NQxVE5Z+G6zh902oT9An6DaSJ+L6DheuC7EwbcmJoKmOcUMaRpwW8A3vEr17PSXfL7vFuDYy/5tN9lRqyPPmBucRuzyn09GXMPi5/bD1ArgWgaXgegxCcY0u2nBAzGcaCV4+BlRKj8zNj6NgZFpdya9u3yzdaKynlrmZyskI8BX4jCNZ7K9C/SXVyIdlPO06vGxUIdx+UFbcaglw/9hLve07f+Mjml+2h7unDdpJNcm5HKEKwefQKgUn2ElSycnK3bBKQGDFSmeFV8XGOtQ9SN3NEh9BogbfDJ+TcsdGyo+dAzkwCDSWx3B9jV+PpbMSDbcRGPANGVeZYIj9hJDEcpDgbEVvugfyacrTCXwnN5zWW9w1yt7WcdX6FiTlyRifO+hAE9sq0r0sfZFOJzXHjjYgPZg9ba13xA/R3C6sNkX2zF2d8ZtsHNJlTJJhSWu4hMQpisRnxc1UyY7UNYICKQ6aLS1250wbpl0vUIJwJAwQkBLdCY533iAmYomn0pEPDIVwRCOHK2axa4/o9MjQD/Nz6q3YWgcHOM5xhqt5ZbsjJ+78QnLKaYIHNRkZzBKK++wcG/zesuZuc5OFrnYmguAavRI1TZi8v9dsH7y riAeTAdL sguvTHt/mI95/QW9IHTgto+1aPsewkJ6TRySsVes/ZD95+fbrFe6SDTkJojljtwtxYuli81wsTdnAejAlN7X81GjisNC7nfdrIOQ+LyL8B7VCDfuZT1XVtmMaHdTkBY1wwoY+txLbGZ/nulu+Z/nyjl+4CvWFq2BXdXS3wuLHvqsyzmtDXBnL08udprtQO+g8MDlpIHfQkWG/1ubwZISEzOeZuVgTU1sfNQWylPQNMAvBeI1Wl2uMZnlZasgMHKJsk4eY9jx+eaMkOA4VxvNoYzW22Ems2SiQGy1i9d9DieP3aZynw4P6ZrTByLqLZypSTBniROQenX4eiCZesGuGeM1rf44yBaE5U4HzOoTrG6mSERHBx3uWXrFJFnUKsdtBxSOYWfMWOHnITb3zCNrfab6q8A== 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: From: Xiongwei Song The SO_ALL|SO_OBJECTS pair is only used when enabling CONFIG_SLUB_DEBUG option, so the objects_show() definition should be surrounded by CONFIG_SLUB_DEBUG too. Signed-off-by: Xiongwei Song --- mm/slub.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/mm/slub.c b/mm/slub.c index 5cc56f780241..b8afe12ebba1 100644 --- a/mm/slub.c +++ b/mm/slub.c @@ -5613,12 +5613,6 @@ static ssize_t cpu_slabs_show(struct kmem_cache *s, char *buf) } SLAB_ATTR_RO(cpu_slabs); -static ssize_t objects_show(struct kmem_cache *s, char *buf) -{ - return show_slab_objects(s, buf, SO_ALL|SO_OBJECTS); -} -SLAB_ATTR_RO(objects); - static ssize_t objects_partial_show(struct kmem_cache *s, char *buf) { return show_slab_objects(s, buf, SO_PARTIAL|SO_OBJECTS); @@ -5713,6 +5707,12 @@ static ssize_t total_objects_show(struct kmem_cache *s, char *buf) } SLAB_ATTR_RO(total_objects); +static ssize_t objects_show(struct kmem_cache *s, char *buf) +{ + return show_slab_objects(s, buf, SO_ALL|SO_OBJECTS); +} +SLAB_ATTR_RO(objects); + static ssize_t sanity_checks_show(struct kmem_cache *s, char *buf) { return sysfs_emit(buf, "%d\n", !!(s->flags & SLAB_CONSISTENCY_CHECKS));