From mboxrd@z Thu Jan 1 00:00:00 1970 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 F12AAC02181 for ; Wed, 22 Jan 2025 05:44:22 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 7C3D26B0082; Wed, 22 Jan 2025 00:44:22 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 7741D6B0083; Wed, 22 Jan 2025 00:44:22 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6140A6B0085; Wed, 22 Jan 2025 00:44:22 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 3D7056B0082 for ; Wed, 22 Jan 2025 00:44:22 -0500 (EST) Received: from smtpin21.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 9A6A8141343 for ; Wed, 22 Jan 2025 05:44:21 +0000 (UTC) X-FDA: 83033997522.21.7DD076F Received: from mailout2.samsung.com (mailout2.samsung.com [203.254.224.25]) by imf12.hostedemail.com (Postfix) with ESMTP id 6B7A440008 for ; Wed, 22 Jan 2025 05:44:18 +0000 (UTC) Authentication-Results: imf12.hostedemail.com; dkim=pass header.d=samsung.com header.s=mail20170921 header.b="sjIh2//x"; spf=pass (imf12.hostedemail.com: domain of hyesoo.yu@samsung.com designates 203.254.224.25 as permitted sender) smtp.mailfrom=hyesoo.yu@samsung.com; dmarc=pass (policy=none) header.from=samsung.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1737524659; 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: in-reply-to:in-reply-to:references:references:dkim-signature; bh=sul+Mrctor/HREwnAga2JOl7SewL0teERdVT4vjJNOw=; b=bj5CJkRdFIsjFVzgTf4w1zDhJJ5y5Pe84MnVVOQiQW8h9zDioK4GVRZQV/DGbPrcRx1u5N 0ANMys2SyyAtmG7F9LgHyA0USn/kYAWTjpZWtLxC/5qucwv7QFAykMe5dDLkNgrlPWmcB2 HlRUPObewOKlJ2pw7sA5A/SAcgN5KEU= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1737524659; a=rsa-sha256; cv=none; b=0tIxlZfBJuqoQ+3/Nc1mGNNWzqHQwOakcRnqWo6EmPKiRYev29yogVmRSXr/B5nke+eOSO 2gEqkUELiJbCN5CdTGv2eGZnOuWIPk7AHtdfTGkvfva3ucIokfsqGgz033dTNy49NsgCaq PLRnZq/iIee/1RDknUFyIfEwFGOOcJc= ARC-Authentication-Results: i=1; imf12.hostedemail.com; dkim=pass header.d=samsung.com header.s=mail20170921 header.b="sjIh2//x"; spf=pass (imf12.hostedemail.com: domain of hyesoo.yu@samsung.com designates 203.254.224.25 as permitted sender) smtp.mailfrom=hyesoo.yu@samsung.com; dmarc=pass (policy=none) header.from=samsung.com Received: from epcas2p2.samsung.com (unknown [182.195.41.54]) by mailout2.samsung.com (KnoxPortal) with ESMTP id 20250122054415epoutp020dc6c00247d5d371738ad3051dc25ac6~c7XfQ23KL3003630036epoutp02V for ; Wed, 22 Jan 2025 05:44:15 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.samsung.com 20250122054415epoutp020dc6c00247d5d371738ad3051dc25ac6~c7XfQ23KL3003630036epoutp02V DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1737524655; bh=sul+Mrctor/HREwnAga2JOl7SewL0teERdVT4vjJNOw=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=sjIh2//xPWq/qTZOu/TcqL1KfMd/JNRkqOsaQyRXDKAjegGeVGpkW4hth+eR6Ufz8 EKV+aAuDvS8Vk0ZObro7G/8Sp9RpMipE7Zx+BvGTc4P328kafGWV6XREdKm7Eg3kTG 9BjOswm6vzJxBZoaDkgkeFK6c3UwKzyyniiAHjvI= Received: from epsnrtp1.localdomain (unknown [182.195.42.162]) by epcas2p3.samsung.com (KnoxPortal) with ESMTP id 20250122054414epcas2p3012e2dc3d5e7b409627565681cb534bb~c7Xe_2p_C0151201512epcas2p3k; Wed, 22 Jan 2025 05:44:14 +0000 (GMT) Received: from epsmges2p3.samsung.com (unknown [182.195.36.98]) by epsnrtp1.localdomain (Postfix) with ESMTP id 4YdCgf1k91z4x9Q5; Wed, 22 Jan 2025 05:44:14 +0000 (GMT) Received: from epcas2p4.samsung.com ( [182.195.41.56]) by epsmges2p3.samsung.com (Symantec Messaging Gateway) with SMTP id 89.AF.22105.EA580976; Wed, 22 Jan 2025 14:44:14 +0900 (KST) Received: from epsmtrp2.samsung.com (unknown [182.195.40.14]) by epcas2p4.samsung.com (KnoxPortal) with ESMTPA id 20250122054413epcas2p4399ad0d82d62af35faa2b0cb2a699fd5~c7XeCIMCT2249622496epcas2p4f; Wed, 22 Jan 2025 05:44:13 +0000 (GMT) Received: from epsmgmcp1.samsung.com (unknown [182.195.42.82]) by epsmtrp2.samsung.com (KnoxPortal) with ESMTP id 20250122054413epsmtrp2d4746db0dca16c29dfa701c31bc0d0f7~c7XeBTg7C2746827468epsmtrp22; Wed, 22 Jan 2025 05:44:13 +0000 (GMT) X-AuditID: b6c32a47-fd1c970000005659-8c-679085ae1663 Received: from epsmtip1.samsung.com ( [182.195.34.30]) by epsmgmcp1.samsung.com (Symantec Messaging Gateway) with SMTP id FC.88.33707.DA580976; Wed, 22 Jan 2025 14:44:13 +0900 (KST) Received: from tiffany (unknown [10.229.95.142]) by epsmtip1.samsung.com (KnoxPortal) with ESMTPA id 20250122054413epsmtip15c08d3aaaa851a9949621cc4107e1949~c7XdxwRt_1846318463epsmtip1D; Wed, 22 Jan 2025 05:44:13 +0000 (GMT) Date: Wed, 22 Jan 2025 14:42:55 +0900 From: Hyesoo Yu To: Chengming Zhou Cc: Hyeonggon Yoo <42.hyeyoo@gmail.com>, janghyuck.kim@samsung.com, Christoph Lameter , Pekka Enberg , David Rientjes , Joonsoo Kim , Andrew Morton , Vlastimil Babka , Roman Gushchin , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] mm: slub: Print the broken data before restoring slub. Message-ID: <20250122054255.GB1498496@tiffany> MIME-Version: 1.0 In-Reply-To: X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrGJsWRmVeSWpSXmKPExsWy7bCmhe661gnpBusec1hM7DGwmLN+DZvF xjOfWC2uf3vDaLGyu5nNYvOcYovLu+awWdxb85/Vou3zPyCxZCOTxcQ1ohazG/sYHXg8ds66 y+6xYFOpx6ZVnWwemz5NYvfoenuFyePEjN8sHk+uTGfyWNgwldmjb8sqRo8zC46we3zeJBfA HZVtk5GamJJapJCal5yfkpmXbqvkHRzvHG9qZmCoa2hpYa6kkJeYm2qr5OIToOuWmQN0uZJC WWJOKVAoILG4WEnfzqYov7QkVSEjv7jEVim1ICWnwLxArzgxt7g0L10vL7XEytDAwMgUqDAh O2P6dc6C1coV76dfY2xgvC3dxcjJISFgItF5YC9bFyMXh5DADkaJSzd+skM4nxglGj6eZQGp AnMmfVGF6dh68TMzRHwno8T15eEQDU8ZJRZM/wiWYBFQlZh0cz2YzSagLnFiyzJGEFtEQFei YdkXJhCbWaCdWeLDUbMuRg4OYQFviZUP7UHCvAJ6Ek/eHWKBsAUlTs58AmZzCthKfO95CHac hMARDokZW2YxQxzkInF7yksmCFtY4tXxLewQtpTE53cgr4HYxRLbFh9mgmhuYJTY3HEfqtlY YtazdkaIgzIl/ky+yg5ykISAssSRWywQYT6JjsN/ocK8Eh1tQhCdyhL7l81jgbAlJR6tbWeF sD0k+mbOYoeETxeTxK9HdhMY5WYheWcWkmWzgKYyC2hKr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28spYCvxvech+wRGwVlIumch6Z6F0D0LSfcC RpZVjKKpBcW56bnJBYZ6xYm5xaV56XrJ+bmbGMGxpxW0g3HZ+r96hxiZOBgPMUpwMCuJ8Ip+ 6EkX4k1JrKxKLcqPLyrNSS0+xCjNwaIkzquc05kiJJCeWJKanZpakFoEk2Xi4JRqYJJTVayX 82d7v9DB49STorgpQVu5DvxaW/Fp+8PakOQJf28H/5se67m6RIBhQscCz9zQx5e/33zbFX25 XZcz6Wdr5PEEL67ifU7rbnC3r3ik2K3zyin+U8Vxw6VLZR/OCZiTomXx7HehvLD+NtU2Pa3G w0vt077ez7NujaxWttjVs37+/jjTN28fHdapPRXU5Jizwq5WnKdGWbrZacdC1fySQ4U3yqr3 H++fP00922NmgIOXCXNNe5fC2ZJXn9/JntukMrfryL9LbqdVrp1boTthspayz6ej6RbGcXZL e2+8+b6qsrROYllPa9s0/dD4rxP52P6XNj7+sFjOfk7l9TPfTbYz6K7c18LG+NpBW4mlOCPR UIu5qDgRADFO7aMsAwAA X-CMS-MailID: 20250122054413epcas2p4399ad0d82d62af35faa2b0cb2a699fd5 X-Msg-Generator: CA Content-Type: multipart/mixed; boundary="----Cwu3ZXVVeZAiO6hmdsuERc26j9mSSa5rGzwFtoxKk617clws=_2b91c1_" X-Sendblock-Type: AUTO_CONFIDENTIAL CMS-TYPE: 102P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20250120083144epcas2p369584af764b617c3d2cb2a0568a45d6c References: <20250120083023.4162932-1-hyesoo.yu@samsung.com> X-Stat-Signature: 8hr8ne466o7a36r7qh164c8538i5z7mf X-Rspam-User: X-Rspamd-Queue-Id: 6B7A440008 X-Rspamd-Server: rspam03 X-HE-Tag: 1737524658-704002 X-HE-Meta: U2FsdGVkX1/OP8mywAfdcgYEjxr5Iizb/0HUX6nORUoOcceNQ6e8ADhqXqz27uWiIlgp1LJX0FtSGU0Zn9OTddDOtAzNqgnQJzqZUzjV8MUtnKTtG9vP9RVieOjTs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peGD27G26+h9MWD0b7WJ6vb7d1Zc8lLvLeLZaubgE/IOiy1c= 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: ------Cwu3ZXVVeZAiO6hmdsuERc26j9mSSa5rGzwFtoxKk617clws=_2b91c1_ Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Content-Disposition: inline On Wed, Jan 22, 2025 at 11:25:15AM +0800, Chengming Zhou wrote: > On 2025/1/21 21:35, Hyeonggon Yoo wrote: > > On Mon, Jan 20, 2025 at 5:31 PM Hyesoo Yu wrote: > > > > Let's add Chengming, the author of the commit, to Cc, > > as he might have some opinions about it. > > Thanks! > I am sorry, I missed your reply. > > > > > Previously, the restore occured after printing the object in slub. > > > After commit 47d911b ("slab: make check_object() more consistent"), > > > > at least 12 characters of the commit hash should be used to refer to a commit. > > Documentation/process/submitting-patches.rst states that: > > You should also be sure to use at least the first twelve > > characters of the SHA-1 ID. > > The kernel repository holds a lot of objects, making collisions > > with shorter IDs a real > > possibility. Bear in mind that, even if there is no collision with > > your six-character ID > > now, that condition may change five years from now. > > > > > the bytes are printed after the restore. This information about the bytes > > Yes, object will be dumped once we found one error and abort checking > before this commit, which changed to check all sections of the object > and dump the object at last, then corrupted section has been restored. > > > > before the restore is highly valuable for debugging purpose. > > > For instance, in a event of cache issue, it displays byte patterns > > > by breaking them down into 64-bytes units. Without this information, > > Actually, we already print the error message of corrupted section in > check_bytes_and_report() of each section checking, but it's not enough > for your case. So you add print_section(), which makes sense to me. > > > > we can only speculate on how it was broken. Hence the corrupted regions > > > are printed prior to the restoration process. > > > > Probably this should be considered for -stable releases. What do you think? > > [1] https://www.kernel.org/doc/html/latest/process/stable-kernel-rules.html > > I'm not sure since it's not bug, just the printed message is not enough > in this usecase. > I agree that it is not a bug, just missing necessary information. I won't include it in stable based on your opinion. > > > > > diff --git a/mm/slub.c b/mm/slub.c > > > index c2151c9fee22..48cefc969480 100644 > > > --- a/mm/slub.c > > > +++ b/mm/slub.c > > > @@ -1207,6 +1207,7 @@ check_bytes_and_report(struct kmem_cache *s, struct slab *slab, > > > fault[0], value); > > > > > > skip_bug_print: > > > + print_section(KERN_ERR, "Corrupt ", fault, end - fault); > > > > I don't think it's supposed to report an error here, per the name of > > the label "skip_bug_print". > > Agree, I think print_section() should be above skip_bug_print, > which means we should skip printing bug message when kunit testing. > > Here you just print the "Corrupt" part of this section, another choice > is just print this whole section, not sure which way is better. > Yes, It is my mistake. I'll fix it. If we add print_section on check_bytes_and_report, that'll print the 'corrupted section' and then print the whole section once again. I guess that printing the restored section is not meaningful for debug. It would be more efficient for log to print the whole section once. However this would require passing additional parameter to check_bytes_and_report. In the next version, I plan to modify it to only print the whole section once by adding the boolean parameter to check_bytes_and_report. Thanks, > > > > Maybe move print_trailer() and add_taint() back to > > check_bytes_and_report(), and report an error > > only once and skip reporting if it's already reported? > > Here is the dicussion[1]. > > [1] https://lore.kernel.org/all/20240528-b4-slab-debug-v1-1-8694ef4802df@linux.dev/ > > Thanks. > > > > > Best, > > Hyeonggon > > > > > restore_bytes(s, what, value, fault, end); > > > return 0; > > > } > > > -- > > > 2.48.0 > > > > ------Cwu3ZXVVeZAiO6hmdsuERc26j9mSSa5rGzwFtoxKk617clws=_2b91c1_ Content-Type: text/plain; charset="utf-8" ------Cwu3ZXVVeZAiO6hmdsuERc26j9mSSa5rGzwFtoxKk617clws=_2b91c1_--