From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out-186.mta1.migadu.com (out-186.mta1.migadu.com [95.215.58.186]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 96A605383 for ; Thu, 24 Apr 2025 02:18:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.186 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1745461096; cv=none; b=o9kaopyf6jV3yknDaa8cqhaGCcUAmZpKR3Eqw1NPnMLQ9U+RhAWKj/XK3P2VLpMc2MS35+R3zDkLUT68Ad1/ggFnW3AsiDu1HGdAUwdilTpX/oKzIE71i5RpmcIm9XiOw3QZkG+Ugz/5A5cgR/0p4eU1ZP2KsBPUINs+ig9Wluo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1745461096; c=relaxed/simple; bh=UVVi4P/sqC1/mlMQUgwoPMiBvWDUJoPNhcKxSph6Fow=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=OUBu/Shps5uNgR+9VA2rRUCRl0P8wIiqCNHsgVlADsVhf/Znra9xNzC9RbfiTAV9IdgqGIHSlav3QVZCd2pQWDLoEc0K7W7i279ZJCId+vXCpF/9fX0gPlP1p8LZo0B2PxqXLoKl6aHgLzZfeqT7fvjzy36L7+df1Vq6ceo3PGs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=EJi9vs5V; arc=none smtp.client-ip=95.215.58.186 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="EJi9vs5V" Message-ID: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1745461091; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=2T5lAnrEJNQwQyiPVjj4uMl+QlzCXBRaN6qYGLhWYKE=; b=EJi9vs5VuPrCf+IsuIhmfeiUsjfuW5oijaBPLAesl2OHnb4Ge6KVn4qvnoI0fU9psMDF8S HSqkipFcZiY3aBK8VUUnFztyL5Hg/bnx42cesDbGQAF2a64Qi9GskUXeln6DVMzpLjWSIt Pvrtpvx5HmlDBGDz5rSlWEyEe+LQZTo= Date: Thu, 24 Apr 2025 10:17:59 +0800 Precedence: bulk X-Mailing-List: linux-toolchains@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Subject: Re: [PATCH v3] tools/mm: Add script to display page state for a given PID and VADDR To: Florian Weimer Cc: akpm@linux-foundation.org, linux-debuggers@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-toolchains@vger.kernel.org, osandov@osandov.com, paulmck@kernel.org, sweettea-kernel@dorminy.me, liuye@kylinos.cn References: <20250423014850.344501-1-ye.liu@linux.dev> <87jz7bky7i.fsf@oldenburg.str.redhat.com> Content-Language: en-US X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Ye Liu In-Reply-To: <87jz7bky7i.fsf@oldenburg.str.redhat.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Migadu-Flow: FLOW_OUT 在 2025/4/23 17:45, Florian Weimer 写道: > * Ye Liu: > >> From: Ye Liu >> >> Introduces a new drgn script, `show_page_info.py`, which allows users >> to analyze the state of a page given a process ID (PID) and a virtual >> address (VADDR). This can help kernel developers or debuggers easily >> inspect page-related information in a live kernel or vmcore. >> >> The script extracts information such as the page flags, mapping, and >> other metadata relevant to diagnosing memory issues. >> >> Output example: >> sudo ./show_page_info.py 1 0x7f43df5acf00 >> PID: 1 Comm: systemd mm: 0xffff8881273bbc40 >> Raw: 0017ffffc000416c ffffea00043a4508 ffffea0004381e08 ffff88810f086a70 >> Raw: 0000000000000000 ffff888120c9b0c0 0000002500000007 ffff88812642c000 >> User Virtual Address: 0x7f43df5acf00 >> Page Address: 0xffffea00049a0b00 >> Page Flags: PG_referenced|PG_uptodate|PG_lru|PG_head|PG_active| >> PG_private|PG_reported >> Page Size: 16384 >> Page PFN: 0x12682c >> Page Physical: 0x12682c000 >> Page Virtual: 0xffff88812682c000 >> Page Refcount: 37 >> Page Mapcount: 7 >> Page Index: 0x0 >> Page Memcg Data: 0xffff88812642c000 >> Memcg Name: init.scope >> Memcg Path: /sys/fs/cgroup/memory/init.scope >> Page Mapping: 0xffff88810f086a70 >> Page Anon/File: File >> Page VMA: 0xffff88810e4af3b8 >> VMA Start: 0x7f43df5ac000 >> VMA End: 0x7f43df5b0000 >> This page is part of a compound page. >> This page is the head page of a compound page. >> Head Page: 0xffffea00049a0b00 >> Compound Order: 2 >> Number of Pages: 4 > Does this show the page access flags anywhere in the output? If not, > would it be possible to include this information? This script is currently a basic version, and we plan to gradually add more detailed information about pages, including the page access flags you mentioned, as well as PGD, PUD, PMD, PTE, file/anon rmap folios, and more. This will be refined over time.                              Thanks, Ye Liu > Thanks, > Florian >