From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out-183.mta1.migadu.com (out-183.mta1.migadu.com [95.215.58.183]) (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 7B8321465B4 for ; Fri, 30 May 2025 03:19:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.183 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1748575172; cv=none; b=iis2cwC7xU0r7Cr4f2eD8RuSGeQFdRt/aa9wz34HA3Sxjcvh6iE1hbuMdepABDp2Xj03I30In7+p6mWcRkv390ei7bVQzxLrVaRiPrgZwv8k2U6TDtOxrop6IcTufQOoL6ch+sjm/lDvCjIB8FoWBWKjLSZBzbPtxEcYQB5FRMs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1748575172; c=relaxed/simple; bh=rrOcpru5BubrRiNH2qG5rubxS9EcrGMXnRaP/gR5FOw=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=AopcTJelP2exvo8/32u9gONNQFMEMIR/unt6+cbMJU8zdexJpKMIvkPYHhuUvBvOxlmpjHE+qqZzB/vkRqbOjO0QjfXIea0DGUT9aRiK2z0ysjpcG/f5drBPA4NfekmVXtP2gHo6KgWGX71PsxfU7Lnu8XxWAMqG7mvlkKumTrk= 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=xt3YL2Tr; arc=none smtp.client-ip=95.215.58.183 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="xt3YL2Tr" Message-ID: <7867c19d-bd6c-4f8a-a227-1145fa0516d9@linux.dev> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1748575158; 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=X7EYZXFII3k2j3Ewz72wcbW5pSHjtJI5SiZbJkKBZAk=; b=xt3YL2TrLEPB9zmNh1qbjZiQtaHoDug4D3mw4ZODesuTJAOeMmDyzeHVZd1rsORk84rdDt hXQid96WxG+n3Q1Pd8X7xOz9oZ746nMWc6yvYRKLksaQaPHb3Tg8l4maPfe4725/Bh0uuS t5BT+br5U93ZrpUCWPdtKd8nZG8C+jo= Date: Fri, 30 May 2025 11:18: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 v4] tools/mm: Add script to display page state for a given PID and VADDR To: SeongJae Park 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, fweimer@redhat.com References: <20250528234232.56701-1-sj@kernel.org> 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: <20250528234232.56701-1-sj@kernel.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Migadu-Flow: FLOW_OUT 在 2025/5/29 07:42, SeongJae Park 写道: > On Wed, 28 May 2025 17:15:43 +0800 Ye Liu wrote: > >> 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 0x7fb3eb1b2000 >> PID: 1 Comm: systemd mm: 0xffff8d27279f9cc0 >> Raw: 0017ffffc000416c fffff31105a61b08 fffff31105a63608 ffff8d27121326a8 >> Raw: 0000000000000000 ffff8d271b9dcc40 0000002500000007 ffff8d2711f12700 >> User Virtual Address: 0x7fb3eb1b2000 > This is same to what the user passes as the input. I think this is not really > needed? It will be removed in the next version. >> Page Address: 0xfffff31106356a00 >> Page Flags: PG_referenced|PG_uptodate|PG_lru|PG_head|PG_active| >> PG_private|PG_reported|PG_has_hwpoisoned >> Page Size: 4096 >> Page PFN: 0x18d5a8 >> Page Physical: 0x18d5a8000 >> Page Virtual: 0xffff8d274d5a8000 >> Page Refcount: 37 >> Page Mapcount: 7 >> Page Index: 0x0 >> Page Memcg Data: 0xffff8d2711f12700 >> Memcg Name: init.scope >> Memcg Path: /sys/fs/cgroup/memory/init.scope > On my setup, above two lines look like below: > > Memcg Name: unknown > Memcg Path: Unexpected error: 'struct kernfs_node' has no member 'parent' > > Maybe there are rooms to improve? The drgn version needs to be updated. >> Page Mapping: 0xffff8d27121326a8 >> Page Anon/File: File >> Page VMA: 0xffff8d26cac47600 >> VMA Start: 0x7fb3eb1b2000 >> VMA End: 0x7fb3eb1b6000 >> This page is part of a compound page. >> This page is the head page of a compound page. >> Head Page: 0xfffff31106356a00 >> Compound Order: 2 >> Number of Pages: 4 >> >> Signed-off-by: Ye Liu > On my setup, this tool works without obvious or significant errors. > > Tested-by: SeongJae Park > Thanks, Ye > Thanks, > SJ > > [...]