lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Mon, 8 Aug 2022 21:07:34 -0500
From:   Bjorn Helgaas <helgaas@...nel.org>
To:     Kent Overstreet <kent.overstreet@...il.com>
Cc:     "Matthew Wilcox (Oracle)" <willy@...radead.org>,
        linux-kernel@...r.kernel.org, pmladek@...e.com,
        linux-pci@...r.kernel.org
Subject: Re: [PATCH v5 27/32] PCI/P2PDMA: Convert to printbuf

On Mon, Aug 08, 2022 at 02:42:03PM -0400, Kent Overstreet wrote:
> 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.

This doesn't tell me what the advantage of this patch is, since I
don't think *this* patch uses heap allocation.

As far as I can tell, this particular patch doesn't improve safety or
readability, so "convert X to Y even though we don't use any fancy Y
features" is a pointless message.

But if printbufs are better than seq_buf overall, and converting this
gets us closer to the goal of removing seq_buf completely, that's a
perfectly acceptable reason.  Just say that.

> 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

Powered by blists - more mailing lists