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=-5.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE, SPF_PASS,USER_AGENT_SANE_1 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 04AC2C433DB for ; Tue, 26 Jan 2021 16:47:41 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 87BAE229C9 for ; Tue, 26 Jan 2021 16:47:40 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 87BAE229C9 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.cz Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 10C928D00F4; Tue, 26 Jan 2021 11:47:40 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 093768D00B0; Tue, 26 Jan 2021 11:47:40 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E9CAB8D00F4; Tue, 26 Jan 2021 11:47:39 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0154.hostedemail.com [216.40.44.154]) by kanga.kvack.org (Postfix) with ESMTP id BFA578D00B0 for ; Tue, 26 Jan 2021 11:47:39 -0500 (EST) Received: from smtpin02.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id B64A03631 for ; Tue, 26 Jan 2021 16:47:35 +0000 (UTC) X-FDA: 77748507270.02.hands04_470dce02758f Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin02.hostedemail.com (Postfix) with ESMTP id 9315910097AA2 for ; Tue, 26 Jan 2021 16:47:35 +0000 (UTC) X-HE-Tag: hands04_470dce02758f X-Filterd-Recvd-Size: 3232 Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by imf26.hostedemail.com (Postfix) with ESMTP for ; Tue, 26 Jan 2021 16:47:35 +0000 (UTC) X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id A7A4DAC97; Tue, 26 Jan 2021 16:47:33 +0000 (UTC) To: Sergey Senozhatsky , Matthew Wilcox Cc: Timur Tabi , Andrew Morton , linux-kernel@vger.kernel.org, torvalds@linux-foundation.org, Petr Mladek , roman.fietze@magna.com, keescook@chromium.org, Steven Rostedt , John Ogness , linux-mm@kvack.org, Akinobu Mita References: <20210116220950.47078-1-timur@kernel.org> <20210118182635.GD2260413@casper.infradead.org> <20210119014725.GH2260413@casper.infradead.org> From: Vlastimil Babka Subject: Re: [PATCH 0/2] introduce DUMP_PREFIX_UNHASHED for hex dumps Message-ID: <09c70d6b-c989-ca23-7ee8-b404bb0490f0@suse.cz> Date: Tue, 26 Jan 2021 17:47:33 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.6.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable 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 1/19/21 11:38 AM, Sergey Senozhatsky wrote: > On (21/01/19 01:47), Matthew Wilcox wrote: > [..] >>=20 >> > So maybe DUMP_PREFIX_UNHASHED can do the unhashed dump only when >> > CONFIG_DEBUG_KERNEL=3Dy and fallback to DUMP_PREFIX_ADDRESS otherwis= e? >>=20 >> Distros enable CONFIG_DEBUG_KERNEL. >=20 > Oh, I see. >=20 >> If you want to add CONFIG_DEBUG_LEAK_ADDRESSES, then that's great, >> and you won't even have to change users, you can just change how %p >> behaves. >=20 > I like the name. config dependent behaviour of %p wouldn't be new, > well, to some extent, e.g. XFS does something similar (see below). > I don't think Linus will be sold on this, however. Given Linus' current stance later in this thread, could we revive the ide= a of a boot time option, or at least a CONFIG (I assume a runtime toggle would b= e too much, even if limited to !kernel_lockdown :) , that would disable all has= hing? It would be really useful for a development/active debugging, as evidence= d below. Thanks. > fs/xfs/xfs_linux.h: >=20 > /* > * Starting in Linux 4.15, the %p (raw pointer value) printk modifier > * prints a hashed version of the pointer to avoid leaking kernel > * pointers into dmesg. If we're trying to debug the kernel we want th= e > * raw values, so override this behavior as best we can. > */ > #ifdef DEBUG > # define PTR_FMT "%px" > #else > # define PTR_FMT "%p" > #endif >=20 > And then they just use it as >=20 > xfs_alert(mp, "%s: bad inode magic number, dip =3D "ptr_fmt", > dino bp =3D "ptr_fmt", ino =3D %ld", > __func__, dip, bp, in_f->ilf_ino); >=20 > -ss >=20