From: Kent Overstreet <kent.overstreet@gmail.com>
To: Bjorn Helgaas <helgaas@kernel.org>,
"Matthew Wilcox (Oracle)" <willy@infradead.org>
Cc: linux-kernel@vger.kernel.org, pmladek@suse.com,
linux-pci@vger.kernel.org
Subject: Re: [PATCH v5 27/32] PCI/P2PDMA: Convert to printbuf
Date: Mon, 8 Aug 2022 14:42:03 -0400 [thread overview]
Message-ID: <1b92761a-c166-b84f-8d77-a966d4c0ef9a@gmail.com> (raw)
In-Reply-To: <20220808175122.GA1215280@bhelgaas>
On 8/8/22 13:51, Bjorn Helgaas wrote:
> I don't object to the patch, but it would be nice if the commit log
> hinted at what the advantage is. I assume it's faster/safer/better in
> some way, but I have no idea what.
Printbufs have some additional features over seq_buf but they're not
used here. The main one you might be interested in is heap allocation:
that means no need to statically allocate buffers on the stack and no
need to calculate the buffer size, printbufs will reallocate as necessary.
I generally haven't been converting code to use that unless it's obvious
that we're in a context where it's safe to allocate memory and can deal
with allocation failures.
I notice that in calc_map_type_and_dist() you're using xa_store() which
can fail, but you're not checking for that or returning errors properly
:) perhaps a fix for that could also switch to using printbuf in
heap-allocation mode.
> Also, cpu_show_meltdown() doesn't appear in this patch, so maybe
> that's relevant to some other patch but not this one?
Whoops, was copying the commit message from another patch, yeah.n
next prev parent reply other threads:[~2022-08-08 18:42 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20220808024128.3219082-1-willy@infradead.org>
2022-08-08 2:41 ` [PATCH v5 27/32] PCI/P2PDMA: Convert to printbuf Matthew Wilcox (Oracle)
2022-08-08 17:51 ` Bjorn Helgaas
2022-08-08 18:42 ` Kent Overstreet [this message]
2022-08-09 2:07 ` Bjorn Helgaas
2022-08-09 8:00 ` Christoph Hellwig
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=1b92761a-c166-b84f-8d77-a966d4c0ef9a@gmail.com \
--to=kent.overstreet@gmail.com \
--cc=helgaas@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=pmladek@suse.com \
--cc=willy@infradead.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).