[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <Y9zvlZB8iXCOp/RU@smile.fi.intel.com>
Date: Fri, 3 Feb 2023 13:27:17 +0200
From: 'Andy Shevchenko' <andriy.shevchenko@...ux.intel.com>
To: David Laight <David.Laight@...lab.com>
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Jó Ágila Bitsch <jgilab@...il.com>,
"linux-usb@...r.kernel.org" <linux-usb@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v1 1/1] usb: gadget: configfs: Use memcpy_and_pad()
On Thu, Feb 02, 2023 at 10:21:09PM +0000, David Laight wrote:
> From: Andy Shevchenko
> > Sent: 02 February 2023 15:18
> >
> > Instead of zeroing some memory and then copying data in part or all of it,
> > use memcpy_and_pad().
> > This avoids writing some memory twice and should save a few cycles.
>
> Maybe, maybe not.
> It rather depends on the lengths involved (the code doesn't seem to be in the
> main tree).
>
> The cost of the conditionals and the misaligned length/start for the
> memset() could easily overwhelm any apparent saving.
>
> A memset() of a constant whole number of words is going to be significantly
> faster than the partial one.
Then you can put some (little I suppose) efforts in optimizing memcpy_and_pad()
once for all, no?
--
With Best Regards,
Andy Shevchenko
Powered by blists - more mailing lists