Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp673680pxu; Wed, 14 Oct 2020 10:41:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzv/jPr09FIz/LXpgNO37d9kLgUMPJtsmFCv1IX+cdPmj6BcVxnWfOPLv3CIedWM5VebG/t X-Received: by 2002:a17:906:9417:: with SMTP id q23mr156331ejx.536.1602697317430; Wed, 14 Oct 2020 10:41:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602697317; cv=none; d=google.com; s=arc-20160816; b=WY6YMlE5mVcLLOntaiNOHqWsmyyBovm4HpFcItt0QELcfkUZw201VITX/DoJZ7kj1K xmvzUxqbMifMca5XUoMRKdr3S716lwS29wgKY1CDKwUC54BYb/YYfQVyTAMlF1avNvSA I/AxNJYQvGWRGb5VGjIyqtcJm/CB30HVdyNTJstJBirj75xlNvyeVypCOYf7RQd60VJp Fdf2rl0bJ0wFXVQAmClnoLUrcaPFYxMji9CPKwkRC58TY/IgD59+BQA3MLPkiwpsGrJS ddZPWm4AomwAKoKXA1+Wm8hoQa1PmCOmwxBgoW92SB10/B3E/D2TMCDBp0TDJ/NuP+QE aCmA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=cwZLUp1KAUH8V2Udgfzg4KPtcFi1KUCmjOrBmrfznFU=; b=oMAs3J7Jjb5dfri+oTm0B+w/aS2t7OTYUtr7GjzofJpyaBeKk/taeWNed1GJ149lcu BUOgO4h3JpNyzx27+qjC9yxKLGmmGo5EI2bwlndzssQv52Hxs3q7MNWQg4W2iOdTbmpg XlK+wqm9nD7yb0DgQj/y6kkyP5CDz8mI3qSIQ1BM4hJk4mqA6KJTqVwXofAy5cpby6NE LIF3TBeuTDLnYAntK1sv3RJat83+RETEdI3RdmH4EY3Donn97qUIcV+NJ94eY7mKLF03 TPURFD4KZI+ABNnbf6g2npijOwbDKdfLrqlc4EX/dndwu0JpNvw/yfRGTeX1iz2rbXns Mslg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e14si264176ejx.177.2020.10.14.10.41.33; Wed, 14 Oct 2020 10:41:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729536AbgJNQe0 (ORCPT + 99 others); Wed, 14 Oct 2020 12:34:26 -0400 Received: from netrider.rowland.org ([192.131.102.5]:57899 "HELO netrider.rowland.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1727071AbgJNQe0 (ORCPT ); Wed, 14 Oct 2020 12:34:26 -0400 Received: (qmail 719817 invoked by uid 1000); 14 Oct 2020 12:34:25 -0400 Date: Wed, 14 Oct 2020 12:34:25 -0400 From: Alan Stern To: Sebastian Andrzej Siewior Cc: Thomas Gleixner , LKML , Peter Zijlstra , Johan Hovold , Greg Kroah-Hartman , linux-usb@vger.kernel.org, Thomas Winischhofer , "Ahmed S. Darwish" , Mathias Nyman , Valentina Manea , Shuah Khan , linux-omap@vger.kernel.org, Kukjin Kim , Krzysztof Kozlowski , linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, Felipe Balbi , Duncan Sands Subject: Re: [patch 03/12] USB: serial: keyspan_pda: Consolidate room query Message-ID: <20201014163425.GF712494@rowland.harvard.edu> References: <20201014145215.518912759@linutronix.de> <20201014145727.338773481@linutronix.de> <20201014161433.GB712494@rowland.harvard.edu> <20201014162714.ctv5earlhwsp4iqs@linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201014162714.ctv5earlhwsp4iqs@linutronix.de> User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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