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:   Wed, 14 Oct 2020 18:44:43 +0200
From:   Sebastian Andrzej Siewior <bigeasy@...utronix.de>
To:     Alan Stern <stern@...land.harvard.edu>
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 2020-10-14 12:34:25 [-0400], Alan Stern wrote:
> 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.)

There are no concurrent transfer. There is a bit used as a lock. The
first one does the transfer, the other wait.

> > 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.

that is unfortunately true. Let me do the single buffer.

> Alan Stern

Sebastian

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ