From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-m19731120.qiye.163.com (mail-m19731120.qiye.163.com [220.197.31.120]) (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 5C2EC37AA70 for ; Mon, 11 May 2026 12:10:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=220.197.31.120 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778501436; cv=none; b=sF+/b+3wJwVIBPIgcov5m73e0tekCaty0ozQRJSWWUa47hT7p6kxOzYMKmF7sxNAW+Vnezi+tdwuYzNJcQXxaZyZxt/fyBD2bx0KQcyl+uzND8HJy4uh0VJbDfjgPr1rprDmfGDBizXQFnIAceTnrgtfp8Pw0Ee2clNFGcho5Gw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778501436; c=relaxed/simple; bh=HylEQANdRzEfeMCDy2WiA6NxCv11p/mocd3/r7l4JRo=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=dsXyEh6T4oSYNA06+nwszeTUL028NWYDtUW+y+6DW3HuygA/FLWJ/WThbM5Dk+CsW2vtO9OjO2lyOxGC2ujMKeoxQzhqNFD9TrdflrHwS9vW7islaS5v7Tx1xBDuSRX+MWWzbeyzIXFe/ibM1yh99c/+n+GCw3ldEquuTncWn3w= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=easystack.cn; spf=pass smtp.mailfrom=easystack.cn; arc=none smtp.client-ip=220.197.31.120 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=easystack.cn Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=easystack.cn Received: from [192.168.0.59] (unknown [218.94.118.90]) by smtp.qiye.163.com (Hmail) with ESMTP id 19f960b4e; Mon, 11 May 2026 19:54:57 +0800 (GMT+08:00) Message-ID: <93b0b3ed-2b99-4c2c-bfaa-002f3be27171@easystack.cn> Date: Mon, 11 May 2026 19:54:56 +0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v6 1/3] mm/page_owner: add print_mode filter To: Oscar Salvador Cc: akpm@linux-foundation.org, vbabka@kernel.org, surenb@google.com, mhocko@suse.com, jackmanb@google.com, hannes@cmpxchg.org, ziy@nvidia.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org, SeongJae Park References: <20260511033017.747781-1-zhen.ni@easystack.cn> <20260511033017.747781-2-zhen.ni@easystack.cn> From: "zhen.ni" In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-HM-Tid: 0a9e16e3ef6d0229kunm9f30c014302091 X-HM-MType: 1 X-HM-Spam-Status: e1kfGhgUHx5ZQUpXWQgPGg8OCBgUHx5ZQUlOS1dZFg8aDwILHllBWSg2Ly tZV1koWUFJQjdXWRgWCB1ZQUpXWS1ZQUlXWQ8JGhUIEh9ZQVkaT08aVkIfTEtJGB4ZTx5PSFYVFA kWGhdVGRETFhoSFyQUDg9ZV1kYEgtZQVlJSkNVQk9VSkpDVUJLWVdZFhoPEhUdFFlBWU9LSFVCQk lOS1VKS0tVSkJLQlkG 在 2026/5/11 16:29, Oscar Salvador 写道: > On Mon, May 11, 2026 at 11:30:15AM +0800, Zhen Ni wrote: >> Add a print_mode filter to page_owner that allows users to choose between >> printing full stack traces or only stack handles, significantly reducing >> output size for debugging and analysis. >> >> The filter provides a string-based interface under >> /sys/kernel/debug/page_owner_filter/: >> - Reading shows the current mode with [] brackets around active option >> - Writing accepts "full_stack" or "stack_handle" strings >> >> The default full_stack mode maintains backward compatibility with existing >> usage, displaying complete stack traces for each page allocation. >> >> The stack_handle mode dramatically reduces log size by showing only >> the handle number instead of the full stack trace. The mapping from >> handles to actual stack traces can be obtained via the >> show_stacks_handles interface. >> >> Example usage: >> # echo stack_handle > /sys/kernel/debug/page_owner_filter/print_mode >> # cat /sys/kernel/debug/page_owner_filter/print_mode >> full_stack [stack_handle] >> # cat /sys/kernel/debug/page_owner >> Page allocated via order 0, migratetype Unmovable, gfp_mask 0x1100ca, >> pid 1, tgid 1 (systemd), ts 123456789 ns >> PFN 0x1000 type Unmovable Block 1 type Unmovable >> Flags 0x3fffe800000084(referenced|lru|active|private|node=0|zone=1) >> handle: 17432583 >> ... >> >> Reviewed-by: SeongJae Park >> Signed-off-by: Zhen Ni > > Overall looks good to me, one comment below > > Reviewed-by: Oscar Salvador > >> --- > ... >> --- >> mm/page_owner.c | 82 +++++++++++++++++++++++++++++++++++++++++++++++-- >> 1 file changed, 80 insertions(+), 2 deletions(-) >> >> diff --git a/mm/page_owner.c b/mm/page_owner.c >> index 8178e0be557f..27a412c52d41 100644 >> --- a/mm/page_owner.c >> +++ b/mm/page_owner.c >> @@ -1,5 +1,6 @@ >> // SPDX-License-Identifier: GPL-2.0 >> #include >> +#include > > Why do we need this? > The code already gets indirectly through I will remove it in v7. Thanks for catching this! > Best regards, Zhen