All of lore.kernel.org
 help / color / mirror / Atom feed
From: Petr Mladek <pmladek@suse.com>
To: Joe Perches <joe@perches.com>
Cc: John Ogness <john.ogness@linutronix.de>,
	Alexander Monakov <amonakov@ispras.ru>,
	Paul Menzel <pmenzel@molgen.mpg.de>,
	Joerg Roedel <jroedel@suse.de>,
	Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>,
	iommu@lists.linux-foundation.org,
	LKML <linux-kernel@vger.kernel.org>,
	Sergey Senozhatsky <senozhatsky@chromium.org>,
	Steven Rostedt <rostedt@goodmis.org>
Subject: Re: [PATCH] iommu/amd: Fix extended features logging
Date: Mon, 12 Apr 2021 12:59:50 +0200	[thread overview]
Message-ID: <YHQoJtUOh7A1k1PF@alley> (raw)
In-Reply-To: <9a9246c417587f17009543f8048d5f9b7a2ed68f.camel@perches.com>

On Sun 2021-04-11 14:08:14, Joe Perches wrote:
> On Sun, 2021-04-11 at 21:52 +0200, John Ogness wrote:
> > I'd rather fix dev_info callers to allow pr_cont and then fix any code
> > that is using this workaround.
> 
> Assuming you mean all dev_<level>() uses, me too.
> 
> > And if the print maintainers agree it is OK to encourage
> > pr_cont(LOGLEVEL "...") usage, then people should really start using
> > that if the loglevel on those pieces is important.
> 
> I have no stong feeling about the use of pr_cont(<KERN_LEVEL>
> as valuable or not.  I think it's just a trivial bit that
> could be somewhat useful when interleaving occurs.
> 
> A somewhat better mechanism would be to have an explicit
> cookie use like:
> 
> 	cookie = printk_multipart_init(KERN_LEVEL, fmt, ...);
> 	while (<condition>)
> 		printk_multipart_cont(cookie, fmt, ...);
> 	printk_multipark_end(cookie, fmt, ...);
> 
> And separately, there should be a pr_debug_cont or equivalent.

We would need to implement this a lockless way. It is doable,
for example, using some per-CPU X per-context buffers. Which would
require to disable preemption in the section.

But I think that using dev_cont_info() would be easier after all.

That said, some printk_*_init()/end() API would be useful
for storing the pieces in a temporary buffer. It would allow
to store the entire lines without the risk of interleaving
with other messages.

Best Regards,
Petr

WARNING: multiple messages have this Message-ID (diff)
From: Petr Mladek via iommu <iommu@lists.linux-foundation.org>
To: Joe Perches <joe@perches.com>
Cc: Paul Menzel <pmenzel@molgen.mpg.de>,
	Joerg Roedel <jroedel@suse.de>,
	John Ogness <john.ogness@linutronix.de>,
	Alexander Monakov <amonakov@ispras.ru>,
	LKML <linux-kernel@vger.kernel.org>,
	Steven Rostedt <rostedt@goodmis.org>,
	Sergey Senozhatsky <senozhatsky@chromium.org>,
	iommu@lists.linux-foundation.org
Subject: Re: [PATCH] iommu/amd: Fix extended features logging
Date: Mon, 12 Apr 2021 12:59:50 +0200	[thread overview]
Message-ID: <YHQoJtUOh7A1k1PF@alley> (raw)
In-Reply-To: <9a9246c417587f17009543f8048d5f9b7a2ed68f.camel@perches.com>

On Sun 2021-04-11 14:08:14, Joe Perches wrote:
> On Sun, 2021-04-11 at 21:52 +0200, John Ogness wrote:
> > I'd rather fix dev_info callers to allow pr_cont and then fix any code
> > that is using this workaround.
> 
> Assuming you mean all dev_<level>() uses, me too.
> 
> > And if the print maintainers agree it is OK to encourage
> > pr_cont(LOGLEVEL "...") usage, then people should really start using
> > that if the loglevel on those pieces is important.
> 
> I have no stong feeling about the use of pr_cont(<KERN_LEVEL>
> as valuable or not.  I think it's just a trivial bit that
> could be somewhat useful when interleaving occurs.
> 
> A somewhat better mechanism would be to have an explicit
> cookie use like:
> 
> 	cookie = printk_multipart_init(KERN_LEVEL, fmt, ...);
> 	while (<condition>)
> 		printk_multipart_cont(cookie, fmt, ...);
> 	printk_multipark_end(cookie, fmt, ...);
> 
> And separately, there should be a pr_debug_cont or equivalent.

We would need to implement this a lockless way. It is doable,
for example, using some per-CPU X per-context buffers. Which would
require to disable preemption in the section.

But I think that using dev_cont_info() would be easier after all.

That said, some printk_*_init()/end() API would be useful
for storing the pieces in a temporary buffer. It would allow
to store the entire lines without the risk of interleaving
with other messages.

Best Regards,
Petr
_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu

  reply	other threads:[~2021-04-12 10:59 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-10 21:11 [PATCH] iommu/amd: Fix extended features logging Alexander Monakov
2021-04-10 21:11 ` Alexander Monakov
2021-04-11  6:17 ` Paul Menzel
2021-04-11  6:17   ` Paul Menzel
2021-04-11 11:22   ` Alexander Monakov
2021-04-11 11:22     ` Alexander Monakov
2021-04-11 19:52     ` John Ogness
2021-04-11 19:52       ` John Ogness
2021-04-11 20:43       ` Alexander Monakov
2021-04-11 20:43         ` Alexander Monakov
2021-04-11 21:08       ` Joe Perches
2021-04-11 21:08         ` Joe Perches
2021-04-12 10:59         ` Petr Mladek [this message]
2021-04-12 10:59           ` Petr Mladek via iommu
2021-04-12 10:49       ` Petr Mladek
2021-04-12 10:49         ` Petr Mladek via iommu
2021-04-11 11:31 ` Joe Perches
2021-04-11 11:31   ` Joe Perches
2021-04-11 11:42   ` Alexander Monakov
2021-04-11 11:42     ` Alexander Monakov

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=YHQoJtUOh7A1k1PF@alley \
    --to=pmladek@suse.com \
    --cc=amonakov@ispras.ru \
    --cc=iommu@lists.linux-foundation.org \
    --cc=joe@perches.com \
    --cc=john.ogness@linutronix.de \
    --cc=jroedel@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pmenzel@molgen.mpg.de \
    --cc=rostedt@goodmis.org \
    --cc=senozhatsky@chromium.org \
    --cc=suravee.suthikulpanit@amd.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.