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.9 required=3.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1,USER_IN_DEF_DKIM_WL autolearn=no 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 5F9D3C49ED7 for ; Sat, 21 Sep 2019 09:09:05 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id F0313208C0 for ; Sat, 21 Sep 2019 09:09:04 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="SkyMdLbV" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org F0313208C0 Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 4B3176B0003; Sat, 21 Sep 2019 05:09:04 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 462936B0006; Sat, 21 Sep 2019 05:09:04 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 3510F6B0007; Sat, 21 Sep 2019 05:09:04 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0031.hostedemail.com [216.40.44.31]) by kanga.kvack.org (Postfix) with ESMTP id 0E6D96B0003 for ; Sat, 21 Sep 2019 05:09:04 -0400 (EDT) Received: from smtpin04.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with SMTP id 7282A40FC for ; Sat, 21 Sep 2019 09:09:03 +0000 (UTC) X-FDA: 75958353366.04.eggs26_893b77f55b01a X-HE-Tag: eggs26_893b77f55b01a X-Filterd-Recvd-Size: 4838 Received: from mail-pf1-f196.google.com (mail-pf1-f196.google.com [209.85.210.196]) by imf05.hostedemail.com (Postfix) with ESMTP for ; Sat, 21 Sep 2019 09:09:02 +0000 (UTC) Received: by mail-pf1-f196.google.com with SMTP id 205so6159906pfw.2 for ; Sat, 21 Sep 2019 02:09:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:from:to:cc:subject:in-reply-to:message-id:references :user-agent:mime-version; bh=LKS6iRhORtVWtWzPRk2V93JoQAB4JDX0z138KY8j8Ak=; b=SkyMdLbVZeuAeURGdY/fK7VUmGBH5duim15ZdpccY6a9VaRa7ysYDVaA7VUcqecynC NSpY6XX7eKwmBaeUoQsRnsl8Ko0gjuRoRIAfs8u3KYHs5i2OYzOw/fFTozNtkUaCu2uQ yNNr+zvypRK5jh7JvO6BN0ixVJ+hDH1K+zQEW1ntYn0IoTebzEtKHcjp1P948b9Mwn5K FZwnxU3syHnu79tDtL0nisC7ArTpimgR+i6/Y1d2xBOG+X3gSt6oxZptCPjK9AUW2rlQ f2zDP2C8ZNKIQHotlvns49lEBLnfHOyh03czL/hGG2EChz39ihxw7K/DIedL8LuJxDrb zehQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:in-reply-to:message-id :references:user-agent:mime-version; bh=LKS6iRhORtVWtWzPRk2V93JoQAB4JDX0z138KY8j8Ak=; b=iSzyrSoc/RjzpXYJe4qqc1Yy/csOGkWxS4LjRhgrhn6loDBJgxHKBWxlpeFrtbeqm9 7CkpD15m2jNBJbAGEq1SqrQsuF8LUamVricvNJE5fdjzUQaRf/562DNJBejkuAZvYX1j E2PbYWKA6OmSiFYhdGlkF1oFGkxOudvrR7jrCTTBplCAmz4dZ5KcYd3Jwzo22UEDJTK4 jBZrWR1tDptJtoEfb9Cu/rJEQAJvHFtrnzGTqUGRw2Oeo09tdECqDL1N9ttQWT6n0lbV s7II/yC5WaIKPGniPfteXtC6ksgR1CLmfGlcH/gKB6+V0a3cGFDgayk6IPDQs/3Ggxw6 ffyg== X-Gm-Message-State: APjAAAWRi1gOKs60HBHNa9zQb3UKxOxXuSM2/NXwjI07LQfnT+EFMeEB hoVquI7j4/GKgwlf/TZvKHBK1g== X-Google-Smtp-Source: APXvYqyDG2iSDN+jBYdCL3+alE/9Xq3bNU+YDf3e+OZLkMg4U9lsu0+pJcxGpuPE3fYiB4Uxvo8gvQ== X-Received: by 2002:a63:6a81:: with SMTP id f123mr19648574pgc.348.1569056941451; Sat, 21 Sep 2019 02:09:01 -0700 (PDT) Received: from [2620:15c:17:3:3a5:23a7:5e32:4598] ([2620:15c:17:3:3a5:23a7:5e32:4598]) by smtp.gmail.com with ESMTPSA id w69sm6951409pgd.91.2019.09.21.02.08.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 21 Sep 2019 02:09:00 -0700 (PDT) Date: Sat, 21 Sep 2019 02:08:59 -0700 (PDT) From: David Rientjes X-X-Sender: rientjes@chino.kir.corp.google.com To: Miles Chen cc: Christoph Lameter , Pekka Enberg , Joonsoo Kim , Andrew Morton , linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-mediatek@lists.infradead.org, wsd_upstream@mediatek.com Subject: Re: [PATCH] mm: slub: print_hex_dump() with DUMP_PREFIX_OFFSET In-Reply-To: <20190920104849.32504-1-miles.chen@mediatek.com> Message-ID: References: <20190920104849.32504-1-miles.chen@mediatek.com> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII 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: On Fri, 20 Sep 2019, Miles Chen wrote: > 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. > I agree it looks nicer for poisoning, I'm not sure that every caller of print_section() is the same, however. For example trace() seems better off as DUMP_PREFIX_ADDRESS since it already specifies the address of the object being allocated or freed and offset here wouldn't really be useful, no?