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 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id C159DD591AC for ; Mon, 18 Nov 2024 19:11:23 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 40D746B0085; Mon, 18 Nov 2024 14:11:23 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 3BD876B008A; Mon, 18 Nov 2024 14:11:23 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 284BE6B008C; Mon, 18 Nov 2024 14:11:23 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 097D66B008A for ; Mon, 18 Nov 2024 14:11:23 -0500 (EST) Received: from smtpin07.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id B706A1A04AD for ; Mon, 18 Nov 2024 19:11:22 +0000 (UTC) X-FDA: 82800156684.07.8723EEC Received: from out-188.mta0.migadu.com (out-188.mta0.migadu.com [91.218.175.188]) by imf08.hostedemail.com (Postfix) with ESMTP id F2FCE160003 for ; Mon, 18 Nov 2024 19:10:47 +0000 (UTC) Authentication-Results: imf08.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=AYrP8LJZ; spf=pass (imf08.hostedemail.com: domain of roman.gushchin@linux.dev designates 91.218.175.188 as permitted sender) smtp.mailfrom=roman.gushchin@linux.dev; dmarc=pass (policy=none) header.from=linux.dev ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1731956932; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=J9bdmC8O0mZuSc1d3ov6kK3zAXL6Ki/uwfsmjx15YrI=; b=3oB4w9BEP7Zv/mN8oyD5/vTeiH6uOvBd7/I7mR2VFApjGh/mrEI1HwqXGl79fFWyTgGBDJ LMoKWoFIQboPSn/MJW29tx0CZKhxNXzjw8upjbuD/QXikkpwOWIhkMIT0zG5XFW5tmgYOb F+ar/iYcQk/grzLVGFUw5ED8JFQm+HQ= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1731956932; a=rsa-sha256; cv=none; b=6KVrflzuz8KEZi1kJylGdTq1xEM7u3XxP6DWoiW7J/M7x07mtjpagjXBe3jNf821qUU/Ar LmXLqUxmNWgTPHujwZk6gzqpA4jfH68vVOMbYM0nvuGd6wdbevwRTHk535NBcTZP2WAy/7 k+0Lq69Nr6WMbcEoOI88soX8F/3So2E= ARC-Authentication-Results: i=1; imf08.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=AYrP8LJZ; spf=pass (imf08.hostedemail.com: domain of roman.gushchin@linux.dev designates 91.218.175.188 as permitted sender) smtp.mailfrom=roman.gushchin@linux.dev; dmarc=pass (policy=none) header.from=linux.dev Date: Mon, 18 Nov 2024 19:11:05 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1731957075; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=J9bdmC8O0mZuSc1d3ov6kK3zAXL6Ki/uwfsmjx15YrI=; b=AYrP8LJZV2AGKUOMf90n+zfu8+d1nAItkyc8LsvyQowiseGlvnGU+zD0Dt3EY5ONppo0Xe 7EQ2qFFx9REbsv7WMGmtRD9WY6WsnDyciUXEOiytFTesKekvLLsR6l9Zigv/WrtKF4v9QS EpMbWvpMZO6tUGBRzZI402Evm3OZ0oc= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Roman Gushchin To: Pasha Tatashin Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-doc@vger.kernel.org, linux-fsdevel@vger.kernel.org, cgroups@vger.kernel.org, linux-kselftest@vger.kernel.org, akpm@linux-foundation.org, corbet@lwn.net, derek.kiernan@amd.com, dragan.cvetic@amd.com, arnd@arndb.de, gregkh@linuxfoundation.org, viro@zeniv.linux.org.uk, brauner@kernel.org, jack@suse.cz, tj@kernel.org, hannes@cmpxchg.org, mhocko@kernel.org, shakeel.butt@linux.dev, muchun.song@linux.dev, Liam.Howlett@oracle.com, lorenzo.stoakes@oracle.com, vbabka@suse.cz, jannh@google.com, shuah@kernel.org, vegard.nossum@oracle.com, vattunuru@marvell.com, schalla@marvell.com, david@redhat.com, willy@infradead.org, osalvador@suse.de, usama.anjum@collabora.com, andrii@kernel.org, ryan.roberts@arm.com, peterx@redhat.com, oleg@redhat.com, tandersen@netflix.com, rientjes@google.com, gthelen@google.com Subject: Re: [RFCv1 0/6] Page Detective Message-ID: References: <20241116175922.3265872-1-pasha.tatashin@soleen.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20241116175922.3265872-1-pasha.tatashin@soleen.com> X-Migadu-Flow: FLOW_OUT X-Rspam-User: X-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: F2FCE160003 X-Stat-Signature: fdufnqfngmqioys3aqgfyzm4kijpap7k X-HE-Tag: 1731957047-701404 X-HE-Meta: U2FsdGVkX1/W6O3Zxy6A8YdE1aECiquATk1TAlCeC/vy9ndqdIwEMzho6wkUmi8DFxk2dVKv5iUl3Cml+1iQS+bP8lYhmKoS8vupRbornlql4ktoZNFtGUjnYuaX+NYjKlDcwZLyZK5pDWTfOaxUrQCR3aaMK69FtRTJ4C5mS+I5kcWz4hehkYjqpH+HffAFMH9bZ3UDHmcsd+wWVvbHMcfmK5ycQSf4tMqDYW0Pn716zWOocvM8TD2hjhbAvQGovxIPmm0dXmDdm9RJy7LfWej6Jn2i47HWu0ATwUhkSWs/c+QruUnRYin6VxAykM1xnoigW9aCzUxI2vMJqC9LffR7bPLeOOBcaEhAC+LsENxpOjXkTTu+4XLDDUy0pUd9+kdkGJufBKKHE9CUH0L+tkoUPjYkjP5IKAZ4K5tgrORuNtw1AH1u/7/f8R+i50Wv7yi+QYPyXsPp1xohI07XroBA5x1B9wMv+sTlK36/A1opYiRPnYRUx52w6QWr/QssIfx8th6PlXhTgUa+kyOL+I1aWvhccPcluCXN9GB8NgWHIuEH1gLxJBaNGN7pobwx0hZdXXX6yG9uNxXjmuPF9iTBC0nC9W2iAuIV3arb8pzPnLJ8utl74Icm3UCPbN/MwQQCqPNLj3foui8Jpid2u8L6H6niOjKCNfqZzMpvE3sVv6au9cytksG9GP/SJRQrvbIiCGoW3sPjIF+ktU6TUulL70LfM3l33O2RpIlnCyJ1SznmCakEJ1SXJDwvMVFSphWdEzi2NHiAvec+lRKfWhhTIIht9iB1AMv5ALmwPrA1kL66Vftkwge7iXs9S7XEwXErirl1j/p8vAPPo5/JnFOBRJ75WA+MAdejlKNA44htoEsxyOWvefl+PrTkscMY1XoEbc3gsclTVjZvuQ9eLQb3roM9sDaA4OeADiiPgO6f+mDvhnlEDqsOOlsWlqT9htpx9wlpGsH15VOlll9 mD/+cr4u Ro1Zc9CMnr4sXQ/VKaKOHLt+EDF1KlbDpHL5hJ+IhPcgChx9nOADngRsc8XTAHosZvWPztG0W9Qpj9ZTWaiT2FvIuTHckV+1/x9lwWhtSPrLwAkMST0CnNV+V1zblEaaI3HqWmA/hwibPp0POxAA2gfPmoGZZlRuAGa4+oPCU7L6fTFJZd5r2KUGmjQ== 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: List-Subscribe: List-Unsubscribe: On Sat, Nov 16, 2024 at 05:59:16PM +0000, Pasha Tatashin wrote: > Page Detective is a new kernel debugging tool that provides detailed > information about the usage and mapping of physical memory pages. > > It is often known that a particular page is corrupted, but it is hard to > extract more information about such a page from live system. Examples > are: > > - Checksum failure during live migration > - Filesystem journal failure > - dump_page warnings on the console log > - Unexcpected segfaults > > Page Detective helps to extract more information from the kernel, so it > can be used by developers to root cause the associated problem. > > It operates through the Linux debugfs interface, with two files: "virt" > and "phys". > > The "virt" file takes a virtual address and PID and outputs information > about the corresponding page. > > The "phys" file takes a physical address and outputs information about > that page. > > The output is presented via kernel log messages (can be accessed with > dmesg), and includes information such as the page's reference count, > mapping, flags, and memory cgroup. It also shows whether the page is > mapped in the kernel page table, and if so, how many times. This looks questionable both from the security and convenience points of view. Given the request-response nature of the interface, the output can be provided using a "normal" seq-based pseudo-file. But I have a more generic question: doesn't it make sense to implement it as a set of drgn scripts instead of kernel code? This provides more flexibility, is safer (even if it's buggy, you won't crash the host) and should be at least in theory equally powerful. Thanks!