From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 58B193B6BF4 for ; Mon, 11 May 2026 08:29:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778488186; cv=none; b=XLli7/hPDeHZ5qogKmKbJx6r8ZG7t7Yk31CXVqyk+I9nJhcS9COVw0YWK/bA0U4UsFiE8TYeUqB88TZvWH+0lLBzd5Ri1AChP+1SRgkRjJXrWjiYVW0zeK0Eh2sx28yLLPWjqmvyE7Iuv2+BpH+FZyPHa2tWgCi7LeMftw2Vh3c= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778488186; c=relaxed/simple; bh=4vNyIkIyQDx176/ITKZGdHKOBUMpxhGNGN7ppUjW29s=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=QLSnjN97eJ9hljIhAS6MDJEqyqd38ThVjB7Sp1yh3lEhIAXdP/SNnZmJBTXt6+BxJe5ZiMntgAVmFYPcwcEtLNvCyf3Tf+aSywXDlV4PQI6Kdhvb79/MThaFYvBwfIWK4c5diD+IXYE/O730EciEs1EbWT3qrrPiwU7pac5Jtdk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de; spf=pass smtp.mailfrom=suse.de; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=l/whHjSH; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=yKOhO8EK; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=l/whHjSH; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=yKOhO8EK; arc=none smtp.client-ip=195.135.223.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="l/whHjSH"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="yKOhO8EK"; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="l/whHjSH"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="yKOhO8EK" Received: from imap1.dmz-prg2.suse.org (unknown [10.150.64.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 5F5B8684D0; Mon, 11 May 2026 08:29:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1778488177; h=from:from:reply-to: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=1mTLvLvsgikq3/uAA+awnYyeFqD1EEbK2ez9xmLG9E4=; b=l/whHjSHNRVQwaHnOrg/Sh5oZhNgI2xDHhiV6VH3ez0o4qGhdtYwsWUOX3X5Esvh5Seiqu 8N1dlH82TFRVG+rFmtZuVESWKJtCyuuRjUsnYk/vK1ATVLn6CcAwJN05f6fcgOYKX8a+EM 6d0B58+vHlEvHq1mrAoZp0Q3lKqa/QA= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1778488177; h=from:from:reply-to: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=1mTLvLvsgikq3/uAA+awnYyeFqD1EEbK2ez9xmLG9E4=; b=yKOhO8EKUaCkIPtox/rBKKktF1QkJnCJJuS30DuKnZ7KW0x5KXZZE5UsGfTlOk7mO+0NgY y4kxUKO2muabHdCg== Authentication-Results: smtp-out2.suse.de; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1778488177; h=from:from:reply-to: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=1mTLvLvsgikq3/uAA+awnYyeFqD1EEbK2ez9xmLG9E4=; b=l/whHjSHNRVQwaHnOrg/Sh5oZhNgI2xDHhiV6VH3ez0o4qGhdtYwsWUOX3X5Esvh5Seiqu 8N1dlH82TFRVG+rFmtZuVESWKJtCyuuRjUsnYk/vK1ATVLn6CcAwJN05f6fcgOYKX8a+EM 6d0B58+vHlEvHq1mrAoZp0Q3lKqa/QA= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1778488177; h=from:from:reply-to: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=1mTLvLvsgikq3/uAA+awnYyeFqD1EEbK2ez9xmLG9E4=; b=yKOhO8EKUaCkIPtox/rBKKktF1QkJnCJJuS30DuKnZ7KW0x5KXZZE5UsGfTlOk7mO+0NgY y4kxUKO2muabHdCg== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id C3033593A3; Mon, 11 May 2026 08:29:36 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id c1YYLXCTAWppcAAAD6G6ig (envelope-from ); Mon, 11 May 2026 08:29:36 +0000 Date: Mon, 11 May 2026 10:29:35 +0200 From: Oscar Salvador To: Zhen Ni 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 Subject: Re: [PATCH v6 1/3] mm/page_owner: add print_mode filter Message-ID: References: <20260511033017.747781-1-zhen.ni@easystack.cn> <20260511033017.747781-2-zhen.ni@easystack.cn> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20260511033017.747781-2-zhen.ni@easystack.cn> X-Spam-Level: X-Spamd-Result: default: False [-4.30 / 50.00]; BAYES_HAM(-3.00)[100.00%]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MIME_GOOD(-0.10)[text/plain]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; MISSING_XM_UA(0.00)[]; MIME_TRACE(0.00)[0:+]; FUZZY_RATELIMITED(0.00)[rspamd.com]; RCPT_COUNT_SEVEN(0.00)[11]; RCVD_TLS_ALL(0.00)[]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.de:email,imap1.dmz-prg2.suse.org:helo,localhost.localdomain:mid] X-Spam-Flag: NO X-Spam-Score: -4.30 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? -- Oscar Salvador SUSE Labs