From patchwork Wed Jun 5 07:13:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chengming Zhou X-Patchwork-Id: 13686252 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 4E5E6C25B76 for ; Wed, 5 Jun 2024 07:15:16 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id DBFA96B0085; Wed, 5 Jun 2024 03:15:15 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id D6FBA6B0092; Wed, 5 Jun 2024 03:15:15 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C37886B0093; Wed, 5 Jun 2024 03:15:15 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id A4E5F6B0085 for ; Wed, 5 Jun 2024 03:15:15 -0400 (EDT) Received: from smtpin25.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 261A44134A for ; Wed, 5 Jun 2024 07:15:15 +0000 (UTC) X-FDA: 82195973790.25.1708B6B Received: from out-175.mta1.migadu.com (out-175.mta1.migadu.com [95.215.58.175]) by imf02.hostedemail.com (Postfix) with ESMTP id AB61080015 for ; Wed, 5 Jun 2024 07:15:12 +0000 (UTC) Authentication-Results: imf02.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=NKUe4OPq; spf=pass (imf02.hostedemail.com: domain of chengming.zhou@linux.dev designates 95.215.58.175 as permitted sender) smtp.mailfrom=chengming.zhou@linux.dev; dmarc=pass (policy=none) header.from=linux.dev ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1717571712; 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=MgQ54wqpPyu/de/IC92RsymjWefuXxvvmWin5jNjSXQ=; b=wnMlnPc/GqOucSpymQi1DB/j1LiQ1oIgwMK4z+9WOpFvkdPSK6atQfnJ4oATQQjL5j8zxN p7Mz5WrfS9V5tXsyi5nNU1eAhV6E7i17FB1p2dhNdI+2JpeqwOYfio4H/2gMbiuanLS7FD AkZ1uNxOnkkTy4NoSs+D3+3VUAX/XhM= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1717571713; a=rsa-sha256; cv=none; b=xYO7ZDK5FaIqdepn6bjc13XbruwzuWRwQniL6iUlLOLODo1zvdvk2Zy1tkMv+LNdKQASFM GBmURMNVk9MWnZK1qpxYasrxLGRs84IL7mozQR7SjkIbTagR1teZDcyGzvByhKexRHBNXk QGGC4EOwc2+QDhybrMIvB1Y0ckXcaHQ= ARC-Authentication-Results: i=1; imf02.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=NKUe4OPq; spf=pass (imf02.hostedemail.com: domain of chengming.zhou@linux.dev designates 95.215.58.175 as permitted sender) smtp.mailfrom=chengming.zhou@linux.dev; dmarc=pass (policy=none) header.from=linux.dev X-Envelope-To: linux-mm@kvack.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1717571710; 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=MgQ54wqpPyu/de/IC92RsymjWefuXxvvmWin5jNjSXQ=; b=NKUe4OPqpSUR+OR0Mazu4CTFXw74QR/uNWe4nUmch5P9NkbUpRewOT9h9o33Kzh/vMMUcy grwy/JjedJmanJJ0m11fEWNiw1JJjOlIyRuA2rqQQ1wI3ojtkWashhBWUdjVg2FG2YRAVt kH7g5Bkga45BiE7fUFm/+FSm6ubcSpM= X-Envelope-To: penberg@kernel.org X-Envelope-To: roman.gushchin@linux.dev X-Envelope-To: feng.tang@intel.com X-Envelope-To: zhouchengming@bytedance.com X-Envelope-To: rientjes@google.com X-Envelope-To: linux-kernel@vger.kernel.org X-Envelope-To: akpm@linux-foundation.org X-Envelope-To: iamjoonsoo.kim@lge.com X-Envelope-To: vbabka@suse.cz X-Envelope-To: chengming.zhou@linux.dev X-Envelope-To: cl@linux.com X-Envelope-To: 42.hyeyoo@gmail.com X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Chengming Zhou Subject: [PATCH v2 0/3] slab: fix and cleanup of slub_debug Date: Wed, 05 Jun 2024 15:13:53 +0800 Message-Id: <20240605-b4-slab-debug-v2-0-c535b9cd361c@linux.dev> MIME-Version: 1.0 X-B4-Tracking: v=1; b=H4sIADEQYGYC/3XMQQ6DIBCF4auYWXcaINRCV96jcSEy6CRGG6jEx nj3Uvdd/i953w6JIlOCR7VDpMyJl7mEulTQj908ELIvDUooLW7KoNOYps6hJ7cOKL2Rdxt6a+s OyucVKfB2es+29MjpvcTPyWf5W/9JWaJAU1tNQRuhfGgmntft6ilDexzHF2LHNJSqAAAA 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=1717571705; l=1377; i=chengming.zhou@linux.dev; s=20240508; h=from:subject:message-id; bh=NUq4hUMFyN/6UPuWAGO3h695blPsgWsaqsOr34MSY/E=; b=+ms+kPaOg2SJvqKFwZFq2Vqt+ZOIoeYlDeMC/ug+gvORklv4nOem+bSIiRiBIk3E8HfRT1/WW RHu6lPGP1vxBwtz3hvdDs+7HMG9DQAe/q1avhaeuD7WC4Hx7rDdnC1I X-Developer-Key: i=chengming.zhou@linux.dev; a=ed25519; pk=kx40VUetZeR6MuiqrM7kPCcGakk1md0Az5qHwb6gBdU= X-Migadu-Flow: FLOW_OUT X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: AB61080015 X-Rspam-User: X-Stat-Signature: rstboqbgpak31asuapmumqpgbzf7ih7n X-HE-Tag: 1717571712-785163 X-HE-Meta: U2FsdGVkX19g/SzpOJ441qONZ2BnsiJs7DZWC8ykaNgbxsv9dIhxfYU0fuXCMGq/nUQxmiasYP4pZmt6tgea0w5FBBgaHWSVFCHoHZs7ZiJ6H7mFbxU9jMqPQ/FQ4WvWippGjB7IK/jzyJ7Hq2IRF/hytDghzIHFTcmPzr4PLsLDqAN1XIkmM/rFG9xmc4Fzch/fKgWRH9+uDJ2vUK9njU5OqVvYIbne+57eMjppO3SVNraG0MjiXvoytBmhvc/6NZ/yzgc0ePgqTcnnG5K+snGdArntB5TMjTKaOYjMkAAeCknHJ0+jD6XBbc9HpB5TjIIpHHNXWNH5+ork6P0MzEo/WbnkdfE0qla8h03vOyktqq0XSnzytJdcC96LkmpBVLpPlSBU8WNKaTrNAN+wMxFkv+eEJvo5H14uALi3e6ajsVPvP7E4HuTTobDFqdWTBrIkNg0YJaUFsCUbXbhWjqR9pKnRHYAdijrrxnimLbyepYpAGO5wJYChDGiH5PUwPJavJSyj1OtjvHqIX7AAQh7pvmr6KmXht+m9qMRjNM5IUqP8x+hZKevYbWNTnr/Qgvb9MbC6H3BHLpDPRq7xxYXM4kS2MLpjMxxskCjm7LjB5f942lke0Z4xyA2cxBQ+DJTxDTbyRGrwVdLWfjkKBH5jTV62mOsOS5JqUCGIVH8lgiHq0GCm/TPCvzJ5MDlwPwKErmeq4TgNUs2gfbhFsmzz06Mt4bKJGP0/Yl6EgGLpwpJ5wssrp1x1cGvMKaPf1uR5/cNProBBpAt0KIKwNjRhk1fIma8OVSPBAhgmQog3WmQDYLoVM4kFC07tiL/Zi+0vJMnNfcPzhcKFCRj51hYekTmAUKyO6vjBxZsJg0ITsx9wQ7sOzDyEyIFbJABoMXgbyrkHDiQmy5jyQYYGP7CcFkDBHJ7dsJONlG72rgLmdVtymXACgA1eULObsIUjzoMeUH5rJd7IeHWUYlQ 5stgssXD KB4FC5UaT+MCmyY/w5sUx5paiebAWim7YCeFpUi+FXM0lfNVVdn7yinuNEIsTYcQH2EuYIoM54ZA3CJjUu7bZPaokYKOVwlUhb1qyO/A7R+FPVHtSQ8vgYmSfX+bnkNH71NYdK2c52F47EqEwznRVrGNTa3QzVKxQhKhkS0TpYV3mJCamHH53l2jsgD5KOPNTmmG7RM8bTc9KfNxSMGH2d2PWpRVjSoFjDlv22l+yIzbHKhUKWXqXKS0HCBJ8pQrs8TOy 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 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 | 60 +++++++++++++++++++++++--------------------- tools/include/linux/poison.h | 7 ++---- 3 files changed, 36 insertions(+), 38 deletions(-) --- base-commit: 1613e604df0cd359cf2a7fbd9be7a0bcfacfabd0 change-id: 20240528-b4-slab-debug-1d8179fc996a Best regards,