Re: [PATCH v3 29/33] PCI/P2PDMA: Convert to printbuf
From: Bjorn Helgaas
Date: Wed Jun 08 2022 - 19:44:01 EST
On Wed, Jun 08, 2022 at 07:24:02PM -0400, Kent Overstreet wrote:
> On 6/8/22 17:11, Bjorn Helgaas wrote:
> > On Sat, Jun 04, 2022 at 03:30:38PM -0400, Kent Overstreet wrote:
> > > This converts from seq_buf to printbuf. We're using printbuf in external
> > > buffer mode, so it's a direct conversion, aside from some trivial
> > > refactoring in cpu_show_meltdown() to make the code more consistent.
> >
> > cpu_show_meltdown() doesn't appear in p2pdma.c. Leftover from another
> > patch? Maybe from 27/33 ("powerpc: Convert to printbuf")?
Don't forget this part :)
> > I'm not opposed to this, but it would be nice to say what the benefit
> > is. How is printbuf better than seq_buf? It's not obvious from the
> > patch how this is better/safer/shorter/etc.
> >
> > Even the cover letter [1] is not very clear about the benefit. Yes, I
> > see it has something to do with improving buffer management, and I
> > know from experience that's a pain. Concrete examples of typical
> > printbuf usage and bugs that printbufs avoid would be helpful.
>
> Take a look at the vsprintf.c conversion if you want to see big
> improvements. Also, %pf() is another thing that's going to enable a lot more
> improvements.
Like I said, I'm not opposed to this, I'm just looking for a hint in
this commit log that makes me think "yes, this is a good idea for
PCI."
Right now it just says "converts X to Y." I'm hoping for "convert X
to Y to avoid <some problem with X>."
Bjorn