linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Petr Mladek <pmladek@suse.com>
To: Anshuman Khandual <anshuman.khandual@arm.com>
Cc: linux-mm@kvack.org,
	Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	Rasmus Villemoes <linux@rasmusvillemoes.dk>,
	Sergey Senozhatsky <senozhatsky@chromium.org>,
	Steven Rostedt <rostedt@goodmis.org>,
	Jonathan Corbet <corbet@lwn.net>,
	Andrew Morton <akpm@linux-foundation.org>,
	David Hildenbrand <david@redhat.com>,
	linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org
Subject: Re: [RFC 1/2] lib/vsprintf: Add support for pte_t
Date: Tue, 24 Jun 2025 12:48:58 +0200	[thread overview]
Message-ID: <aFqCmgT1k8daroNZ@pathway.suse.cz> (raw)
In-Reply-To: <68cdf649-a273-4d83-b862-6b675a793f18@arm.com>

On Fri 2025-06-20 13:32:31, Anshuman Khandual wrote:
> On 19/06/25 7:31 PM, Petr Mladek wrote:
> > On Wed 2025-06-18 09:42:34, Anshuman Khandual wrote:
> >> Add a new format for printing page table entries.
> > 
> > How many users do you explect, please?
> > 
> > This patch adds only one caller. It does not justify the added complexity.
> 
> Understood.
> 
> The idea is to convert all page table entry prints through out the tree
> both in generic and platform code. Added just a single generic example
> here for this being a RFC proposal. Will go through similar instances
> and be back with more comprehensive change set.

You do not need to cover all cases at this stage. For me it is enough
to know that the printf format will have several (like >= 5) users.

> >> @@ -2542,6 +2545,23 @@ char *pointer(const char *fmt, char *buf, char *end, void *ptr,
[...]
> Agreed. Andy also might have suggested about special_hex_number() helper
> on the other thread. Will try and use the helper instead.
> 
> > 
> >> +			spec.base = 16;
> >> +			spec.flags = SPECIAL | SMALL | ZEROPAD;
> >> +			if (sizeof(pte_t) == sizeof(u64)) {
> >> +				u64 val = pte_val(*pte);
> >> +
> >> +				return number(buf, end, val, spec);
> >> +			}
> >> +			WARN_ONCE(1, "Non standard pte_t\n");
> > 
> > This is nasty. It should be a compile-time check. And the code should
> 
> Something like BUILD_BUG_ON() against pte_t as either u64 or u32 aka all
> the sizes the print format is going to support and it should pass on all
> platforms ?

Yes, I had BUILD_BUG_ON() in mind. It would be nice if you check at
least the most known architectures. You could do it just by looking
into the code. We could rely on the bots, monitoring mailing list
and linux-next, for the less known architectures.

The more you check in advance the less surprises would come
from the bots.

Best Regards,
Petr


  reply	other threads:[~2025-06-24 10:49 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-18  4:12 [RFC 0/2] lib/vsprintf: Add support for pte_t Anshuman Khandual
2025-06-18  4:12 ` [RFC 1/2] " Anshuman Khandual
2025-06-18  8:18   ` David Hildenbrand
2025-06-18  8:37     ` Anshuman Khandual
2025-06-18  8:44       ` David Hildenbrand
2025-06-18 18:16         ` Pedro Falcato
2025-06-19 13:08           ` Petr Mladek
2025-06-20  6:00             ` Anshuman Khandual
2025-06-18  8:19   ` David Hildenbrand
2025-06-18  8:33     ` Anshuman Khandual
2025-06-18  8:43       ` David Hildenbrand
2025-06-20  6:30         ` Anshuman Khandual
2025-06-18 17:46   ` Andy Shevchenko
2025-06-19  9:35     ` Anshuman Khandual
2025-06-19 12:00       ` Andy Shevchenko
2025-06-20  6:53         ` Anshuman Khandual
2025-06-21 19:14           ` Andy Shevchenko
2025-06-19 13:12     ` Petr Mladek
2025-06-20  6:38       ` Anshuman Khandual
2025-06-18 18:19   ` Pedro Falcato
2025-06-19  9:53     ` Anshuman Khandual
2025-06-19 13:26   ` Matthew Wilcox
2025-06-20  8:12     ` Anshuman Khandual
2025-06-24 13:11       ` Matthew Wilcox
2025-06-24 14:23         ` Steven Rostedt
2025-06-19 14:01   ` Petr Mladek
2025-06-20  8:02     ` Anshuman Khandual
2025-06-24 10:48       ` Petr Mladek [this message]
2025-06-24 13:09         ` Andy Shevchenko
2025-06-18  4:12 ` [RFC 2/2] kunit: printf: Add test case " Anshuman Khandual

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aFqCmgT1k8daroNZ@pathway.suse.cz \
    --to=pmladek@suse.com \
    --cc=akpm@linux-foundation.org \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=anshuman.khandual@arm.com \
    --cc=corbet@lwn.net \
    --cc=david@redhat.com \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=linux@rasmusvillemoes.dk \
    --cc=rostedt@goodmis.org \
    --cc=senozhatsky@chromium.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).