Received: by 2002:a25:b323:0:0:0:0:0 with SMTP id l35csp2849814ybj; Mon, 23 Sep 2019 10:24:44 -0700 (PDT) X-Google-Smtp-Source: APXvYqykvFGGveFTT+5o/f1D2TczQO4CqDyMkRruI3AahzDtWsvCC14MfF+mQWdrX3tZWzEC44ox X-Received: by 2002:a05:6402:a50:: with SMTP id bt16mr1294056edb.114.1569259484342; Mon, 23 Sep 2019 10:24:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569259484; cv=none; d=google.com; s=arc-20160816; b=YXNA4jeo71I0GRRl2pmpOXVrUIWTE5ySyAu3/kjW/EOaXCDmba4InQcWHJNStIUDaQ S98+vtWawLnT7p3+hib6TpyCxKYB56mejc4dvbtRMj/+ut0AWZ1EaIC6m6eWDNyBahYT 9N5CmtnB9tw3vkgWg15cK8S1vw+W3WdarkXpINqm6LfQGJs6en7okmWCzmLwOYqmtsff oIxpSbu0aoYaG9msXmsN/XQls+wnOUnCouTEm/kKWUxfV74CVIvvzZQMr0bqaCstKe6S BH7O6AOSPjXmOa0SUxUDVYrJL0alzG0u54d1VPYv0UfC4+dujR3hUmAKdFAEadciKIq6 jYlQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date:dkim-signature; bh=LKS6iRhORtVWtWzPRk2V93JoQAB4JDX0z138KY8j8Ak=; b=wW9Mdj6xbU3c2mdSbKZvmjvuG9aHMmT943Qe6kpco0MmN93Z80cEu5lZX+MJC5Yzg2 Hpm5cxYVd0PHwAwXoSHMk5g+1HcR2iRf/HsN8WQz5ac+HDGkiPMRb+XjmMDDacQFaBNY 7jnVzjAy7maQ2BLrTq1k46b2kshuYbTR+o42aGuInAdwfBL3i8c7KWfuQO9PWMxq0KR/ 4N+LiTPKe0GjFZTpMwYkhO/CKZzLpZ0m8PK0oUw/KCOLdJpJi8lfynW3DMlUMDDrDgRb b+l0HYNL4wwMvxZIa9QzQ2LDWn4KkkiJZLi9OrWKYIm4JynYDPF/z/agfoF/dronW4yn /Bbw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=SkyMdLbV; 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=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t10si3350889edd.447.2019.09.23.10.24.19; Mon, 23 Sep 2019 10:24:44 -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; dkim=pass header.i=@google.com header.s=20161025 header.b=SkyMdLbV; 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=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2393660AbfIUJJE (ORCPT + 99 others); Sat, 21 Sep 2019 05:09:04 -0400 Received: from mail-pf1-f193.google.com ([209.85.210.193]:37747 "EHLO mail-pf1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2392557AbfIUJJE (ORCPT ); Sat, 21 Sep 2019 05:09:04 -0400 Received: by mail-pf1-f193.google.com with SMTP id y5so6149995pfo.4 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=isFTe0cRyOExfCY9sP0hn2Iwoy8RwdniEM2zAfm9BPe9buJzcMt+zqQPLd04Fjuijo GdXqMeYfRdPajYq2PIxXKRSnKszHxdEFyV8StH43cB+G3mVCd9sXYss7DnmEyMVex887 Zeyiv0ysvMys4maD7OEDmswoH7H3kY0wgYWIL9zzzDgvGgPx97eL/zXjqgNZKX8C19iW nqlBHohFocOk2RSNaWNmcFx5wLorLe0H0B5Rn/FwIzTuFAH1JoU/zYDx332+Zfrh4X0t 6dwaNIiVhEyFT87M0rhL7KY4vsFgs3s8i0AunupMX9tQ52Vf2eDRW8pI06CjFBJ7K2vl n2Ow== X-Gm-Message-State: APjAAAVxPYdjPRMQsJZu+RxTGYsj94fJRDUJ9n/YY4jgX9O9zoNALRRM rCr4Aqp7QqzvN6J/V/ra9xe6MQ== 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 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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?