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 X-Spam-Level: X-Spam-Status: No, score=-9.7 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, UNPARSEABLE_RELAY,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E9CB9C49ED7 for ; Fri, 20 Sep 2019 10:48:59 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 969E1207FC for ; Fri, 20 Sep 2019 10:48:59 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 969E1207FC Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=mediatek.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id F07EC6B04C2; Fri, 20 Sep 2019 06:48:58 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id EB8806B04C3; Fri, 20 Sep 2019 06:48:58 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id DCE616B04C4; Fri, 20 Sep 2019 06:48:58 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0219.hostedemail.com [216.40.44.219]) by kanga.kvack.org (Postfix) with ESMTP id BCA0C6B04C2 for ; Fri, 20 Sep 2019 06:48:58 -0400 (EDT) Received: from smtpin13.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with SMTP id 2CECB8243781 for ; Fri, 20 Sep 2019 10:48:58 +0000 (UTC) X-FDA: 75954976356.13.actor07_4e22c6a8cf353 X-HE-Tag: actor07_4e22c6a8cf353 X-Filterd-Recvd-Size: 3529 Received: from mailgw02.mediatek.com (unknown [210.61.82.184]) by imf17.hostedemail.com (Postfix) with ESMTP for ; Fri, 20 Sep 2019 10:48:56 +0000 (UTC) X-UUID: ae8f3706e87c4cb793d76c5bada37fc8-20190920 X-UUID: ae8f3706e87c4cb793d76c5bada37fc8-20190920 Received: from mtkexhb01.mediatek.inc [(172.21.101.102)] by mailgw02.mediatek.com (envelope-from ) (Cellopoint E-mail Firewall v4.1.10 Build 0809 with TLS) with ESMTP id 235144964; Fri, 20 Sep 2019 18:48:52 +0800 Received: from mtkcas08.mediatek.inc (172.21.101.126) by mtkmbs06n1.mediatek.inc (172.21.101.129) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Fri, 20 Sep 2019 18:48:49 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by mtkcas08.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1395.4 via Frontend Transport; Fri, 20 Sep 2019 18:48:48 +0800 From: Miles Chen To: Christoph Lameter , Pekka Enberg , David Rientjes , Joonsoo Kim , Andrew Morton CC: , , , , Miles Chen Subject: [PATCH] mm: slub: print_hex_dump() with DUMP_PREFIX_OFFSET Date: Fri, 20 Sep 2019 18:48:49 +0800 Message-ID: <20190920104849.32504-1-miles.chen@mediatek.com> X-Mailer: git-send-email 2.18.0 MIME-Version: 1.0 Content-Type: text/plain X-MTK: N X-Bogosity: Ham, tests=bogofilter, spamicity=0.000238, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Since commit ad67b74d2469d9b8 ("printk: hash addresses printed with %p"), The use DUMP_PREFIX_OFFSET instead of DUMP_PREFIX_ADDRESS with print_hex_dump() can generate more useful messages. In the following example, it's easier get the offset of incorrect poison value with DUMP_PREFIX_OFFSET. Before: Object 00000000e817b73b: 00 00 00 00 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b Object 00000000816f4601: 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b Object 00000000169d2bb8: 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b Object 00000000f4c38716: 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b Object 00000000917e3491: 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b Object 00000000c0e33738: 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b Object 000000001755ddd1: 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b After: Object 00000000: 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b Object 00000010: 63 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b Object 00000020: 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b Object 00000030: 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b 6b a5 I think it might be worth to convert all DUMP_PREFIX_ADDRESS to DUMP_PREFIX_OFFSET for the whole Linux kernel. $ git grep 'DUMP_PREFIX_ADDRESS' | cut -f1 -d"/" | sort | uniq -c 3 arch 140 drivers 12 fs 1 include 5 lib 2 mm Signed-off-by: Miles Chen --- mm/slub.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/slub.c b/mm/slub.c index 8834563cdb4b..89d91c1eb33d 100644 --- a/mm/slub.c +++ b/mm/slub.c @@ -528,7 +528,7 @@ static void print_section(char *level, char *text, u8 *addr, unsigned int length) { metadata_access_enable(); - print_hex_dump(level, text, DUMP_PREFIX_ADDRESS, 16, 1, addr, + print_hex_dump(level, text, DUMP_PREFIX_OFFSET, 16, 1, addr, length, 1); metadata_access_disable(); } -- 2.18.0