Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1321817
| From | Toshi Kani <toshi.kani@hpe.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH 1/2] x86/lib/copy_user_64.S: Handle 4-byte uncached copy |
| Date | 2016-01-29 16:00 +0100 |
| Message-ID | <qWiGL-4DM-49@gated-at.bofh.it> (permalink) |
| References | <qVZkJ-7kv-5@gated-at.bofh.it> <qVZkJ-7kv-7@gated-at.bofh.it> <qWcBk-8sE-19@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On Fri, 2016-01-29 at 09:27 +0100, Ingo Molnar wrote: > * Toshi Kani <toshi.kani@hpe.com> wrote: : > > --- > > arch/x86/lib/copy_user_64.S | 44 ++++++++++++++++++++++++++++++++--- > > -------- > > 1 file changed, 33 insertions(+), 11 deletions(-) > > > > diff --git a/arch/x86/lib/copy_user_64.S b/arch/x86/lib/copy_user_64.S > > index 982ce34..84b5578 100644 > > --- a/arch/x86/lib/copy_user_64.S > > +++ b/arch/x86/lib/copy_user_64.S > > @@ -232,12 +232,17 @@ ENDPROC(copy_user_enhanced_fast_string) > > > > /* > > * copy_user_nocache - Uncached memory copy with exception handling > > - * This will force destination/source out of cache for more > > performance. > > + * This will force destination out of cache for more performance. > > + * > > + * Note: Cached memory copy is used when destination or size is not > > + * naturally aligned. That is: > > + * - Require 8-byte alignment when size is 8 bytes or larger. > > + * - Require 4-byte alignment when size is 4 bytes. > > */ > > ENTRY(__copy_user_nocache) : > So at minimum this patch needs to add quite a few comments to explain the > alignment dependent control flow. > > Assembly code is hard enough to read as-is. Adding 20 more lines with > zero in-line comments is a mistake. > > Btw., while at it, please add comments for the control flow of the whole > function. Above a certain complexity that is a must for assembly > functions. Agreed. I will add comments for the whole function. Thanks, -Toshi
Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread
[PATCH 1/2] x86/lib/copy_user_64.S: Handle 4-byte uncached copy Toshi Kani <toshi.kani@hpe.com> - 2016-01-28 19:20 +0100
Re: [PATCH 1/2] x86/lib/copy_user_64.S: Handle 4-byte uncached copy Ingo Molnar <mingo@kernel.org> - 2016-01-29 09:30 +0100
Re: [PATCH 1/2] x86/lib/copy_user_64.S: Handle 4-byte uncached copy Toshi Kani <toshi.kani@hpe.com> - 2016-01-29 16:00 +0100
csiph-web