From patchwork Fri Jun 7 08:40:11 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chengming Zhou X-Patchwork-Id: 13689483 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 3AABDC27C53 for ; Fri, 7 Jun 2024 08:40:51 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id BB2E76B00A7; Fri, 7 Jun 2024 04:40:50 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id B633B6B00AD; Fri, 7 Jun 2024 04:40:50 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A2AB46B00AE; Fri, 7 Jun 2024 04:40:50 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 848736B00A7 for ; Fri, 7 Jun 2024 04:40:50 -0400 (EDT) Received: from smtpin04.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 43FDC1401BC for ; Fri, 7 Jun 2024 08:40:50 +0000 (UTC) X-FDA: 82203447060.04.D12D765 Received: from out-182.mta0.migadu.com (out-182.mta0.migadu.com [91.218.175.182]) by imf05.hostedemail.com (Postfix) with ESMTP id A832110001A for ; Fri, 7 Jun 2024 08:40:47 +0000 (UTC) Authentication-Results: imf05.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=fHn93sf5; dmarc=pass (policy=none) header.from=linux.dev; spf=pass (imf05.hostedemail.com: domain of chengming.zhou@linux.dev designates 91.218.175.182 as permitted sender) smtp.mailfrom=chengming.zhou@linux.dev ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1717749648; 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-type: content-transfer-encoding:content-transfer-encoding:in-reply-to: references:dkim-signature; bh=vvdtkhjCpRCbJoKZAWyq//G6mKukcuJ4c3ZSKqdPLsM=; b=50oHYYXtbLC9KA4mkZHGmE0Spg3FfmBkp/1BR7AvjobazLvKj7YHk9oStmjLTm+Fj7kv/+ lo8nQSdLoljlQtaZwKrXAmh58OTvx/5gFtfnax0kbsvzW8+JBotWyDRTFgBJdb8F8Ee8ga P2mAelDDL+iG7FJfo7DZRNQd/piB4zk= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1717749648; a=rsa-sha256; cv=none; b=oj8ZFyE9G/xhOo6Lte63NGKiqrvlHPIi59BD2M8d7yTzQf4nDFfvbAa7h8iut4xBXrNL0g +Lz15BwDl93f/iE6H97jQG1ISH1Keq4VkAivyRb7VmR7ENSWOFIXX92AaNyf31T0A98/1O FHtgIz5PCsxaSqvtu8a6gTLdjaPJDNQ= ARC-Authentication-Results: i=1; imf05.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=fHn93sf5; dmarc=pass (policy=none) header.from=linux.dev; spf=pass (imf05.hostedemail.com: domain of chengming.zhou@linux.dev designates 91.218.175.182 as permitted sender) smtp.mailfrom=chengming.zhou@linux.dev X-Envelope-To: akpm@linux-foundation.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1717749645; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=vvdtkhjCpRCbJoKZAWyq//G6mKukcuJ4c3ZSKqdPLsM=; b=fHn93sf5GqLoAwhaQmi3ZyFiRgs2vOD59ms2wlrCGkXR1EJZ8El4heOvKuU3Bzf0YPHmOX KUQkPhUgbd+NyII6q559tw7ncKHk15hNCpCmWxquFPhslAshgsmBVlBUSk0e9IDjQRcD+o WxYIwjEOuMd9Q3B/pDjgbw7moaR6lHc= X-Envelope-To: cl@linux.com X-Envelope-To: linux-kernel@vger.kernel.org X-Envelope-To: penberg@kernel.org X-Envelope-To: vbabka@suse.cz X-Envelope-To: roman.gushchin@linux.dev X-Envelope-To: iamjoonsoo.kim@lge.com X-Envelope-To: 42.hyeyoo@gmail.com X-Envelope-To: rientjes@google.com X-Envelope-To: linux-mm@kvack.org X-Envelope-To: zhouchengming@bytedance.com X-Envelope-To: feng.tang@intel.com X-Envelope-To: chengming.zhou@linux.dev X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Chengming Zhou Subject: [PATCH v3 0/3] slab: fix and cleanup of slub_debug Date: Fri, 07 Jun 2024 16:40:11 +0800 Message-Id: <20240607-b4-slab-debug-v3-0-bb2a326c4ceb@linux.dev> MIME-Version: 1.0 X-B4-Tracking: v=1; b=H4sIAGzHYmYC/3XM0QqDIBiG4VsJj+dQU6c72n2MHaT+lhAVuqQR3 fusk43BDr8PnndFCWKAhK7ViiLkkMI4lFGfKmS7ZmgBB1c2YoRxIpjChuPUNwY7MHOLqVP0or3 VWjaomCmCD8vRuz/K7kJ6jvF15DPd33+lTDHBSmoOnivCnL/1YZiXs4OM9lJmHy2J+NWsaCtqY bR1taT2W2/b9gbRUTSR6AAAAA== To: Christoph Lameter , Pekka Enberg , David Rientjes , Joonsoo Kim , Andrew Morton , Vlastimil Babka , Roman Gushchin , Hyeonggon Yoo <42.hyeyoo@gmail.com>, Feng Tang Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, zhouchengming@bytedance.com, Chengming Zhou X-Developer-Signature: v=1; a=ed25519-sha256; t=1717749639; l=1733; i=chengming.zhou@linux.dev; s=20240508; h=from:subject:message-id; bh=xWj3wmt4wC1BQQNrhlB+vjoPdlDajm1Atq0xhzF45H8=; b=g40ViXDwcKmFj50AEuLOydGhbvCTB3Ri3LoiPVXTy00kTH+EHsdreEApGB1DMpDnpQqUid2+8 xPvCamkkoShBlvaVYQ1cwGh+K/CVthSAzYA+9xMQs3r10aE1LouCTMS X-Developer-Key: i=chengming.zhou@linux.dev; a=ed25519; pk=kx40VUetZeR6MuiqrM7kPCcGakk1md0Az5qHwb6gBdU= X-Migadu-Flow: FLOW_OUT X-Stat-Signature: 66z9uaardamsw4zfirog34stqgsghh3o X-Rspamd-Queue-Id: A832110001A X-Rspam-User: X-Rspamd-Server: rspam01 X-HE-Tag: 1717749647-127199 X-HE-Meta: U2FsdGVkX18xo93t9CXXAHJGBHQBYuvXXOjBU2k1hi4WTWIzCI/rLeIun4E9UDC4HGyMGo2TpDsgPZrlZo+15OGC/Pmob/FOnKdNHF4VCIL3U/ssmJgBEUPuocCe2lxliIQlxbHc5cxyAgYQDkXg+fntEMJUO2Iuqs4Uv10yKio6d7fAdI656tdbGW24xrS61tIJLF2u/+OuQDAHMkCGFRQn7HOtpMwenpERZhfZ3CgHGtBn2KWpexpburfA3mXOwNsNHYu2qY1/KKRASzxBfJsO2TvVhIpsLLiiH6zrGpdrtS8suqEPDe3kJdg3TWliP5sjAhE+pXRMrOJLxsnkorfa0y6lDHPQsnsr63L3BvPDbQ0f4dXdVo6x7oiHuxJAzHmxScLAcmEgDsOUL8PDKCxPNha0RSR9XaVpJUy6tiXU8GESt1FfBliHLTBwQk3rR+++HMg0k9RLFt/ykaLTfKmjMN4znjaJmtoDb/L/BiWJZjj7NTXIQUG0MTEdh5TSEn4Jh+IJlVTSCJ0kLvzn+rXiGJre/sNBP7tPiqGjzYNrUcavjAX2cuRKadESW+hQ0fKXXy5PVxn+8ndRPvdsyt0qJFRHRbm9Q8BveVfwIUHbsCLb7/yvmHA2PYfqrAHVHuQAt6aEdoNbIH08Mxl+EeLJknDaJR/Hr27gE0E38CNGoqy1KZesxoV6Q76z9RKYiKH3nLgSLJjRehH0XoCQ+fg4OXHD5xA7LY6Vi4kwtp5t5fVWMvHesCw0JBXCj/InZef9vHSYIlglAPHw2/twyl9D/2dT+JcVNHxM/wchi01rHvTyrR7qdVHXnmSqVm5IKlTEuj3BWt1squ8+YKcJJEXk29eV16e1APlzJ45M63b0pOXesXClTT3L9klC+znxJPrQs9uhp0DNYcIPpdjVWscbjx8KrGlAT8wRqNMTpmjByEMFDJucXzRAKw5bnqt94vyWH4ofu0WSRfLCwmY JK+nGqL/ QTugPe8L+dTv5G+08w62xlZ5aVvEDlBKOfllESG6htqDx1A6x5zV54IV7UVLJaHUFQusWAlwWMeM1WAkxeD5yGq+0OvzpI8xS9wYbh/dZHhqiNgSnH9nCpv59qCAP6nQD94Rqb33YgliU/ROoYyKPCn9VmSb/Flxd+FFmqqtbGUFlvamlpMDYdwJ0AFwF9GsGZW7aSsWoRx3BQIxJgRBX0DaY5F8kF3TaMJlr/zGYWHG/Rw82qlcG/fKF26gI2XbqqSEDEsiYy1Wskjo= 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: List-Subscribe: List-Unsubscribe: Changes in v3: - Fix slub_kunit tests failures by using new introduced slab_in_kunit_test(), which doesn't increase slab_errors. - Fix the condition of whether to check free pointer and set "ret" correctly. - Collect Reviewed-by tags from Vlastimil Babka. - Link to v2: https://lore.kernel.org/r/20240605-b4-slab-debug-v2-0-c535b9cd361c@linux.dev Changes in v2: - Change check_object() to do all the checks without skipping, report their specific error findings in check_bytes_and_report() but not print_trailer(). Once all checks were done, if any found an error, print the trailer once from check_object(), suggested by Vlastimil. - Consolidate the two cases with flags & SLAB_RED_ZONE and make the complex conditional expressions a little prettier and add comments about extending right redzone, per Vlastimil. - Add Reviewed-by from Feng Tang. - Link to v1: https://lore.kernel.org/r/20240528-b4-slab-debug-v1-0-8694ef4802df@linux.dev Hello, This series includes minor fix and cleanup of slub_debug, please see the commits for details. Signed-off-by: Chengming Zhou --- Chengming Zhou (3): slab: make check_object() more consistent slab: don't put freepointer outside of object if only orig_size slab: delete useless RED_INACTIVE and RED_ACTIVE include/linux/poison.h | 7 ++-- mm/slub.c | 77 ++++++++++++++++++++++++++++---------------- tools/include/linux/poison.h | 7 ++-- 3 files changed, 53 insertions(+), 38 deletions(-) --- base-commit: 1613e604df0cd359cf2a7fbd9be7a0bcfacfabd0 change-id: 20240528-b4-slab-debug-1d8179fc996a Best regards,