Received: by 2002:a25:b323:0:0:0:0:0 with SMTP id l35csp1544638ybj; Fri, 20 Sep 2019 12:12:35 -0700 (PDT) X-Google-Smtp-Source: APXvYqzXKeVkz9Q9jnkmqbSssDKFeXpINB6WfXgApIxgQxm1w0Iw2zCU4NXJjuxiqfSM+3xrUiUR X-Received: by 2002:a17:906:c7c6:: with SMTP id dc6mr21001817ejb.123.1569006755713; Fri, 20 Sep 2019 12:12:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569006755; cv=none; d=google.com; s=arc-20160816; b=aVGk4gV6jaRGbdkmmyPr8Bf1bgM+seZETpJB1ZEp8zJGkLT/HucyJAuiIbUHTJiCkY XMn8bNGz5VMmR4Kgh4YOjAD7rvwHND02Lj8Klqb4lZ/tRt7PN+7l9WgfpJLAy5I805p8 qeeb3QvEV5ZTgEx7gg19CGl80U3ORJgyWsg9ERCooYPJW4BmeO88/Ln45hhLlA74x8kJ w6YkwEv+/fqpUyPZA4P8vFP0ORf1KCduGxAl1fHvjs3YSMIa6Lcgb0lpxLGJ1oSyv8zD FyclT6hsSgT07edSCuhcUg8tvGlEMyHxNQMooyJO6O4s12Y0Xbwu2VQJSSF2TdzG3HTJ MlZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from; bh=bG8ySbzKBSA+vxbOQq1zL7g9rVcqnChzZh45DQ0RbXA=; b=vYbUYThK6CjJirC1513tXVF3sWJUU+Bvh1mhbe71x9oE4FVMCvDZZdOoX1SaanSABD +NjdrfMbfHyUHBUWK9z/bU/qNfAZNooba7f5rS2Ih1Z7bx0DYnt5j33OMmoarIWd2psD algxjzVwly8gGbFnfpTckgqY7cIB1iPXDhDRWCfGjcl1iLDA6JwSYXCAzf1tWT8S94tg Uzi6DS99dVw3TbmaXncJT7byfVNvjh1gc1+KCbbTHiu9o8wkV2KVHZi2PEG4E3X9FqFU JavNJ9DhT04K/2uxChHu/w+DEGc7jQywvfNBHtd2gS34EQtWtQijOfuhVScPDVBzjrC9 lZFQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id me9si1531619ejb.280.2019.09.20.12.12.11; Fri, 20 Sep 2019 12:12:35 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2408716AbfITKtA (ORCPT + 99 others); Fri, 20 Sep 2019 06:49:00 -0400 Received: from mailgw02.mediatek.com ([210.61.82.184]:31183 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S2408705AbfITKtA (ORCPT ); Fri, 20 Sep 2019 06:49:00 -0400 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 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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