From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailout3.samsung.com (mailout3.samsung.com [203.254.224.33]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6EB0A10E0 for ; Wed, 22 Jan 2025 05:29:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=203.254.224.33 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737523745; cv=none; b=jrONG0qdedI83aaYxpwWaaUQfYGoJ5O7zoV5SiSV//+uJ2a8CTVtq6kYu345NcDMw230f63Kd1KZIISYUf2x/E7HQsSDD39Ra7FvvlVWCQOMaARIdJ9luVJMWUj9oP57nJeDQC/HfI8nK0ptJcSKe0IXhaPDYwbpi4fs+4kiaTk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737523745; c=relaxed/simple; bh=agzfbNWeJbIdjGaq7jT1bGqLEWug2IMnNkEHtMzjVLs=; h=Date:From:To:Cc:Subject:Message-ID:MIME-Version:In-Reply-To: Content-Type:References; b=NrIKnhquoH+lH8Vmr4S8Kl1z9KzkdFkh+u9a6RJS5NRMbKdlo3Cl8An2sWc5ZSTay0O8IZmiu1vUvt5dDrJc3FYLLHuj+YKjhg2CoFa9NVTGFd+GSNTjnriM/vsdfRGIRXCqfcUFEL6enPf0ra3d5tqFsQZyaJjRidWhssA4kZQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=samsung.com; spf=pass smtp.mailfrom=samsung.com; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b=AufaJYoi; arc=none smtp.client-ip=203.254.224.33 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=samsung.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=samsung.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b="AufaJYoi" Received: from epcas2p3.samsung.com (unknown [182.195.41.55]) by mailout3.samsung.com (KnoxPortal) with ESMTP id 20250122052900epoutp03aa0ed1f6e3b2095a5c9fda1bb3eba1be~c7KLHwyfo1000110001epoutp03P for ; Wed, 22 Jan 2025 05:29:00 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout3.samsung.com 20250122052900epoutp03aa0ed1f6e3b2095a5c9fda1bb3eba1be~c7KLHwyfo1000110001epoutp03P DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1737523740; bh=jTIgUOPjSWcbxMsg66MPFxAGq89eHvU6LCFppmUWqNw=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=AufaJYoiPqnX42QPj8AbyN0r/Qlax4F4ueC6ADAX36QDerl3eVXdIelNO3cRnuj2Y Tyy6SX9eYrBqeyZHtnlc16MrmrW0oE8wMs3cmTUS06Y1bu3Ys1HIFLjljgJWOeWr57 ckHtrZuW9tgAKHEChSrln+dWOd+aYlwjHGRlBC8Y= Received: from epsnrtp1.localdomain (unknown [182.195.42.162]) by epcas2p1.samsung.com (KnoxPortal) with ESMTP id 20250122052859epcas2p1486f9a0fd4dd5873449b60f626eecf29~c7KKjaOGE3035230352epcas2p1b; Wed, 22 Jan 2025 05:28:59 +0000 (GMT) Received: from epsmges2p3.samsung.com (unknown [182.195.36.92]) by epsnrtp1.localdomain (Postfix) with ESMTP id 4YdCL26ftSz4x9Q1; Wed, 22 Jan 2025 05:28:58 +0000 (GMT) Received: from epcas2p1.samsung.com ( [182.195.41.53]) by epsmges2p3.samsung.com (Symantec Messaging Gateway) with SMTP id EF.D7.22105.A1280976; Wed, 22 Jan 2025 14:28:58 +0900 (KST) Received: from epsmtrp1.samsung.com (unknown [182.195.40.13]) by epcas2p4.samsung.com (KnoxPortal) with ESMTPA id 20250122052858epcas2p4cac06ba9cd5db34cfd1e9b051a22f913~c7KJUuifU0107801078epcas2p4k; Wed, 22 Jan 2025 05:28:58 +0000 (GMT) Received: from epsmgms1p2new.samsung.com (unknown [182.195.42.42]) by epsmtrp1.samsung.com (KnoxPortal) with ESMTP id 20250122052858epsmtrp142b3c7e0054b59e075522f0489901242~c7KJT4NJ11245112451epsmtrp1q; Wed, 22 Jan 2025 05:28:58 +0000 (GMT) X-AuditID: b6c32a47-fd1c970000005659-18-6790821a19a6 Received: from epsmtip2.samsung.com ( [182.195.34.31]) by epsmgms1p2new.samsung.com (Symantec Messaging Gateway) with SMTP id B0.96.18949.A1280976; Wed, 22 Jan 2025 14:28:58 +0900 (KST) Received: from tiffany (unknown [10.229.95.142]) by epsmtip2.samsung.com (KnoxPortal) with ESMTPA id 20250122052857epsmtip27724b5ab400d29e4fc920d56c7207f01~c7KJEayWJ1739317393epsmtip2K; Wed, 22 Jan 2025 05:28:57 +0000 (GMT) Date: Wed, 22 Jan 2025 14:27:36 +0900 From: Hyesoo Yu To: Hyeonggon Yoo <42.hyeyoo@gmail.com> Cc: 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, Chengming Zhou Subject: Re: [PATCH] mm: slub: Print the broken data before restoring slub. Message-ID: <20250122052736.GA1498496@tiffany> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 In-Reply-To: X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrOJsWRmVeSWpSXmKPExsWy7bCmqa5U04R0g7P9xhYTewws5qxfw2ax 8cwnVovr394wWqzsbmaz2Dyn2OLyrjlsFvfW/Ge1aPv8D0gs2chkMXGNqMXsxj5GBx6PnbPu snss2FTqsWlVJ5vHpk+T2D263l5h8jgx4zeLx5Mr05k8FjZMZfbo27KK0ePMgiPsHp83yQVw R2XbZK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TLALQMAAA== X-CMS-MailID: 20250122052858epcas2p4cac06ba9cd5db34cfd1e9b051a22f913 X-Msg-Generator: CA Content-Type: multipart/mixed; boundary="----uRLjcQzjz6V5OP_3gESdNsGQj04rNmJgdrBpg7IReAZ1oX4H=_2b8e78_" 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> ------uRLjcQzjz6V5OP_3gESdNsGQj04rNmJgdrBpg7IReAZ1oX4H=_2b8e78_ Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Content-Disposition: inline On Tue, Jan 21, 2025 at 10:35:58PM +0900, 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. > > > 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. > Thanks for pointing out the mistake. > > the bytes are printed after the restore. This information about the bytes > > 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, > > 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 > Thank you for the advice. I will add Cc:stable@vger.kernel.org in the next version. > > 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". > It is good point. I will move print_section above the skip_bug_print label. > 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? > > Best, > Hyeonggon > By passing a new parameter to the check_bytes_and_report(), It could be implemented. Would it be better to add a new boolean parameter to that function ? Or do you have any other ideas ? Thanks, Hyesoo. > > restore_bytes(s, what, value, fault, end); > > return 0; > > } > > -- > > 2.48.0 > > > ------uRLjcQzjz6V5OP_3gESdNsGQj04rNmJgdrBpg7IReAZ1oX4H=_2b8e78_ Content-Type: text/plain; charset="utf-8" ------uRLjcQzjz6V5OP_3gESdNsGQj04rNmJgdrBpg7IReAZ1oX4H=_2b8e78_--