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]
Message-ID: <20201014163425.GF712494@rowland.harvard.edu>
Date:   Wed, 14 Oct 2020 12:34:25 -0400
From:   Alan Stern <stern@...land.harvard.edu>
To:     Sebastian Andrzej Siewior <bigeasy@...utronix.de>
Cc:     Thomas Gleixner <tglx@...utronix.de>,
        LKML <linux-kernel@...r.kernel.org>,
        Peter Zijlstra <peterz@...radead.org>,
        Johan Hovold <johan@...nel.org>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        linux-usb@...r.kernel.org,
        Thomas Winischhofer <thomas@...ischhofer.net>,
        "Ahmed S. Darwish" <a.darwish@...utronix.de>,
        Mathias Nyman <mathias.nyman@...el.com>,
        Valentina Manea <valentina.manea.m@...il.com>,
        Shuah Khan <shuah@...nel.org>, linux-omap@...r.kernel.org,
        Kukjin Kim <kgene@...nel.org>,
        Krzysztof Kozlowski <krzk@...nel.org>,
        linux-arm-kernel@...ts.infradead.org,
        linux-samsung-soc@...r.kernel.org, Felipe Balbi <balbi@...nel.org>,
        Duncan Sands <duncan.sands@...e.fr>
Subject: Re: [patch 03/12] USB: serial: keyspan_pda: Consolidate room query

On Wed, Oct 14, 2020 at 06:27:14PM +0200, Sebastian Andrzej Siewior wrote:
> On 2020-10-14 12:14:33 [-0400], Alan Stern wrote:
> > Instead, consider using the new usb_control_msg_recv() API.  But it 
> > might be better to allocate the buffer once and for all.
> 
> This will still allocate and free buffer on each invocation. What about

Yes.  That's why I suggesting doing a single buffer allocation at the 
start and using it for each I/O transfer.  (But I'm not familiar with 
this code, and I don't know if there might be multiple transfers going 
on concurrently.)

> moving the query_buf to the begin of the struct / align it?

No, thank won't work either.  The key to the issue is that while some 
memory is mapped for DMA, the CPU must not touch it or anything else in 
the same cache line.  If a field is a member of a data structure, the 
CPU might very well access a neighboring member while this one is 
mapped, thereby messing up the cache line.

Alan Stern

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ