Linux PCI subsystem development
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Petr Mladek <pmladek@suse.com>
Cc: "Bjorn Helgaas" <helgaas@kernel.org>,
	"Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>,
	"Andrew Morton" <akpm@linux-foundation.org>,
	"Steven Rostedt" <rostedt@goodmis.org>,
	"Rasmus Villemoes" <linux@rasmusvillemoes.dk>,
	"Sergey Senozhatsky" <senozhatsky@chromium.org>,
	linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org,
	"Bjorn Helgaas" <bhelgaas@google.com>
Subject: Re: [PATCH v1 2/2] PCI: Include human-readable sizes in resource assignment messages
Date: Mon, 24 Aug 2026 11:18:39 +0300	[thread overview]
Message-ID: <aov-X5UILIDfSkK6@ashevche-desk.local> (raw)
In-Reply-To: <aohWvp0bSeK-Xk9r@pathway.suse.cz>

On Fri, Aug 21, 2026 at 03:46:38PM +0200, Petr Mladek wrote:
> On Sat 2026-08-08 20:48:00, Andy Shevchenko wrote:
> > On Sat, Aug 08, 2026 at 12:23:08PM -0500, Bjorn Helgaas wrote:
> > > Include human-readable sizes, e.g., "16.0 MiB", in addition to the hex
> > > "0x1000000" size, in resource-related messages.  Also consistently include
> > > the "0x" prefix.
> > 
> > Instead of repeating many times the %#llx (%s) and accompanying
> > string_get_size() calls can we rather introduce a (sub-)extension
> > to %p[R] (perhaps against 'R' to print only size) and use it?
> 
> I am not sure if I understand it correctly. It looks to me that
> this patch uses string_get_size() for printing some "arbitrary" size
> values. Some are not part of struct resources, so using %pRR
> might be confusing.

AFAICS (but I might have missed something) they all can be containered into
the local variables of type 'struct resource' and then be used with that
extension directly. So, I don't see that it will be confusing.

> Unfortunately, implementing a generic printf modifier for printing
> human readable size is complicated. It should keep the type-size
> checks. Also it should allow to distinguish binary vs decimal
> size calculation, for example 1kB vs 1kHz for 1024B vs 1000Hz.
> See https://lore.kernel.org/all/ZbFd5TZ_pi7q3hso@casper.infradead.org/

I have an idea about this, but I think it's too premature for that type
of extension. So far, this series (AFAIU) is only about known type and
hence known units to print with the format also kinda fixed.

-- 
With Best Regards,
Andy Shevchenko



      reply	other threads:[~2026-08-24  8:18 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-08 17:23 [PATCH v1 0/2] PCI: Include human-readable BAR and window sizes Bjorn Helgaas
2026-08-08 17:23 ` [PATCH v1 1/2] vsprintf: Add %pR human-readable size Bjorn Helgaas
2026-08-08 17:38   ` sashiko-bot
2026-08-08 17:43   ` Andy Shevchenko
2026-08-08 23:45     ` Bjorn Helgaas
2026-08-09  8:25       ` Andy Shevchenko
2026-08-24  8:31         ` Ilpo Järvinen
2026-08-08 17:23 ` [PATCH v1 2/2] PCI: Include human-readable sizes in resource assignment messages Bjorn Helgaas
2026-08-08 17:27   ` sashiko-bot
2026-08-08 17:48   ` Andy Shevchenko
2026-08-21 13:46     ` Petr Mladek
2026-08-24  8:18       ` Andy Shevchenko [this message]

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=aov-X5UILIDfSkK6@ashevche-desk.local \
    --to=andriy.shevchenko@linux.intel.com \
    --cc=akpm@linux-foundation.org \
    --cc=bhelgaas@google.com \
    --cc=helgaas@kernel.org \
    --cc=ilpo.jarvinen@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=linux@rasmusvillemoes.dk \
    --cc=pmladek@suse.com \
    --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