Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp384813ybh; Sat, 7 Mar 2020 00:31:20 -0800 (PST) X-Google-Smtp-Source: ADFU+vv8ClZZVsmlrGBhWWauoQG6/emr6AJqgBtJecLmmFsBo3bfFoEQgbrMMYWFeXssgFxw4s9R X-Received: by 2002:a9d:4c96:: with SMTP id m22mr5448483otf.21.1583569880199; Sat, 07 Mar 2020 00:31:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1583569880; cv=none; d=google.com; s=arc-20160816; b=cKLz3owkRFcLtNTIYsr8Micmgd6a4RDVnEw+Ir0ws0C/A2Iybiy0G8LXvFyt/LKKNb e3YUyZzvaofMhFTZa6Hi2A4WDSapkhC0UcqVY3LFDryobBpB6Ui9oxbBFc7Oa+/LZa7k PTxQtXsR/Ux7Tmzjq/0dMKSNPQAGV2GyiBjKerBFVw6cfy+IpARyFt8fCB/Iwr6FWe06 U3DNR1UZP3iZB0zXRSqxMtp2Pk3hy8zUgQgBiZqM+1ZAn3OL1NAO3iB03pqJMGrbyZO4 3XG31duhbbvoFheYo1yPECU+XNO9sOm78yJMVRCyz4tmht0w2U+WlvKivbFkmMK6Rts4 DvSw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:user-agent :in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:dkim-signature; bh=HIihW8z0amXwv4ZLt6K4sJz/LdPBSo4iBv14kD0S/Rs=; b=n3sQD4bc4qlO9ZEKRc3mfqP/lZteImE/zMXoLtSdO7SLEnk+xUZYBBbxqeBfjSJmHz ZKN5lxRtH+dOSorvLDFHej+j3bBFCJY3brPzqvZa2bedt7u4amCvimfYkb/AJo/1X8Ey QFOrTurHWhzWfZuaoQdRu5XE6irHikxNj8DGd2zof7u2be+El9QQq1PKqrj6bisdaD+u EYfkNkv0qZXQcxn3HyZslHiTNlpXBgDOfBRRZzwMlRFAm9CUv1DaDT8cTJuss1tmYxAS 6svV7SoUDETWebVrD22CyIYcrlzX2Yt2rbmmNPIkFNhvwC5K3/ucRvmcWb8sNEt0KLXy A6Mw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmx.net header.s=badeba3b8450 header.b=Cmfk0Dxr; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v7si2885271otb.265.2020.03.07.00.31.06; Sat, 07 Mar 2020 00:31:20 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmx.net header.s=badeba3b8450 header.b=Cmfk0Dxr; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726246AbgCGI3a (ORCPT + 99 others); Sat, 7 Mar 2020 03:29:30 -0500 Received: from mout.gmx.net ([212.227.17.21]:60209 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725954AbgCGI3a (ORCPT ); Sat, 7 Mar 2020 03:29:30 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1583569763; bh=h79C+D9/EzcE+etbcbZdLaCiNxPE5dspkTyds0Z1D14=; h=X-UI-Sender-Class:Date:From:To:Cc:Subject:References:In-Reply-To; b=Cmfk0Dxr0eO5wFGCFqKBoT264bq+7WbFiB/B7ewBbTVA5VkXU3L8QD4W62qXxHRMh DHkdLH5VBh9iIG0ssxXinGvo5wZEzZaBqp8r6XvK/olKFS/tCK71xdPfyqU7wwjacZ tyu3hfj078NEUnY8GTMmjpHJWaM7nOums7w4v7iI= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from ubuntu ([83.52.229.196]) by mail.gmx.com (mrgmx105 [212.227.17.174]) with ESMTPSA (Nemesis) id 1Mlf4c-1jaVyi3cwM-00iixk; Sat, 07 Mar 2020 09:29:23 +0100 Date: Sat, 7 Mar 2020 09:29:06 +0100 From: Oscar Carter To: Greg Kroah-Hartman Cc: Forest Bond , Quentin Deslandes , Malcolm Priestley , Gabriela Bittencourt , Colin Ian King , Oscar Carter , devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] staging: vt6656: Declare a few variables as __read_mostly Message-ID: <20200307082906.GA2948@ubuntu> References: <20200301112620.7892-1-oscar.carter@gmx.com> <20200301122514.GA1461917@kroah.com> <20200301131701.GA7487@ubuntu> <20200301150913.GA1470815@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200301150913.GA1470815@kroah.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-Provags-ID: V03:K1:/AbFBE0f0Zp6NqvRYmi/sHN078hyV83hTiMzs2AAgg1PNV/aoct SHvt/qID4eDmdTU1LS0/w7sHSKXUi2nxKLdi8Vu9Cy+nGT/2KsmP3Wlo7EJPGd00Il3HtHO 3YfIpUmqfnrMbIeWroX+fWlEzMu9fhfCq2rsYaS3yediHnoRj14g6SPzciLxij6d4/F0qCz oNU82aIlLKA2NfGqv61OQ== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:MNFbH05vUpg=:0e7OB0RPcLe5GHyg0KXodm wEU1MNmm2cozk5fuk47ptom9QD3bvKlQdDVdp3Vah0issdUV8VUlQpzy+A+WRG1iO8vIDuuoQ biNOb6h0C66uF2yibEqzZsZKDi1O95PTRKcajRchzbQkM22DyVy60A4F9JJbxEVXiyks2j+wi O2ouYM8EtHKqt/JuO+85dLDH6EZKHAhdNV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Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Mar 01, 2020 at 04:09:13PM +0100, Greg Kroah-Hartman wrote: > On Sun, Mar 01, 2020 at 02:17:01PM +0100, Oscar Carter wrote: > > On Sun, Mar 01, 2020 at 01:25:14PM +0100, Greg Kroah-Hartman wrote: > > > On Sun, Mar 01, 2020 at 12:26:20PM +0100, Oscar Carter wrote: > > > > These include module parameters. > > > > > > > > Signed-off-by: Oscar Carter > > > > --- > > > > drivers/staging/vt6656/main_usb.c | 4 ++-- > > > > 1 file changed, 2 insertions(+), 2 deletions(-) > > > > > > > > diff --git a/drivers/staging/vt6656/main_usb.c b/drivers/staging/v= t6656/main_usb.c > > > > index 5e48b3ddb94c..701300202b21 100644 > > > > --- a/drivers/staging/vt6656/main_usb.c > > > > +++ b/drivers/staging/vt6656/main_usb.c > > > > @@ -49,12 +49,12 @@ MODULE_LICENSE("GPL"); > > > > MODULE_DESCRIPTION(DEVICE_FULL_DRV_NAM); > > > > > > > > #define RX_DESC_DEF0 64 > > > > -static int vnt_rx_buffers =3D RX_DESC_DEF0; > > > > +static int __read_mostly vnt_rx_buffers =3D RX_DESC_DEF0; > > > > module_param_named(rx_buffers, vnt_rx_buffers, int, 0644); > > > > MODULE_PARM_DESC(rx_buffers, "Number of receive usb rx buffers"); > > > > > > > > #define TX_DESC_DEF0 64 > > > > -static int vnt_tx_buffers =3D TX_DESC_DEF0; > > > > +static int __read_mostly vnt_tx_buffers =3D TX_DESC_DEF0; > > > > module_param_named(tx_buffers, vnt_tx_buffers, int, 0644); > > > > MODULE_PARM_DESC(tx_buffers, "Number of receive usb tx buffers"); > > > > > > > > > > Why? What does this help with? > > > > If we declare these variables __read_mostly we can improve the perform= ance. If > > these variables are read many more times than written, each core of a = multicore > > system can maintain a copy in a local cache and the time to access is = less than > > if they use the shared-cache. > > This is a USB driver, performance is always limited to the hardware, not > the CPU location of variables. Thank you for the explanation. > > Please always benchmark things to see if it actually makes sense to make > changes like this, before proposing them. I'm sorry. > > thanks, > > greg k-h thanks, Oscar