[+cc Logan, maintainer of p2pdma.c]
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")?
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.
I guess "external buffer mode" means we use an existing buffer (on the
stack in this case) instead of allocating a buffer from the heap [2]?
And we do that for performance (i.e., we know the max size) and to
avoid sleeping to alloc?
Are there any other printf-type things in drivers/pci that
could/should be converted? Is this basically a seq_buf replacement,
so we can find everything with "git grep seq_buf drivers/pci/"?