From: 'Andy Shevchenko' <andriy.shevchenko@linux.intel.com>
To: David Laight <David.Laight@aculab.com>
Cc: "Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
"Jó Ágila Bitsch" <jgilab@gmail.com>,
"linux-usb@vger.kernel.org" <linux-usb@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v1 1/1] usb: gadget: configfs: Use memcpy_and_pad()
Date: Fri, 3 Feb 2023 13:27:17 +0200 [thread overview]
Message-ID: <Y9zvlZB8iXCOp/RU@smile.fi.intel.com> (raw)
In-Reply-To: <c97c4048109242228b0af3199a67f0bc@AcuMS.aculab.com>
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
prev parent reply other threads:[~2023-02-03 11:27 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-02 15:17 Andy Shevchenko
2023-02-02 22:21 ` David Laight
2023-02-03 11:27 ` 'Andy Shevchenko' [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Y9zvlZB8iXCOp/RU@smile.fi.intel.com \
--to=andriy.shevchenko@linux.intel.com \
--cc=David.Laight@aculab.com \
--cc=gregkh@linuxfoundation.org \
--cc=jgilab@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®