Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1539794
| From | Herbert Xu <herbert@gondor.apana.org.au> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: scatterwalk_map_and_copy incorrect optimization |
| Date | 2016-12-10 09:10 +0100 |
| Message-ID | <sMKTf-6JC-3@gated-at.bofh.it> (permalink) |
| References | <sMtfI-3GM-41@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On Fri, Dec 09, 2016 at 02:18:01PM +0100, Jason A. Donenfeld wrote: > Hi Herbert, > > The scatterwalk_map_and_copy function copies ordinary buffers to and > from scatterlists. These buffers can, of course, be on the stack, and > this remains the most popular use of this function -- getting info > between stack buffers and DMA regions. It's mostly used for adding or > checking MACs, in the majority of call sites. Its implementation is > relatively straightforward. It maps the DMA region(s) to a vaddr, and > then just calls vanilla memcpy. Pretty uncontroversial. > > However, around ~4.1 an optimization was added to prevent copying when > unnecessary (when the src and dst are the same). The optimization > looks like this: > > if (sg_page(sg) == virt_to_page(buf) && > sg->offset == offset_in_page(buf)) > return; > > There are two problems with this: This code no longer exists in the current tree. Cheers, -- Email: Herbert Xu <herbert@gondor.apana.org.au> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread
scatterwalk_map_and_copy incorrect optimization "Jason A. Donenfeld" <Jason@zx2c4.com> - 2016-12-09 14:20 +0100
Re: scatterwalk_map_and_copy incorrect optimization "Jason A. Donenfeld" <Jason@zx2c4.com> - 2016-12-09 14:30 +0100
Re: scatterwalk_map_and_copy incorrect optimization Herbert Xu <herbert@gondor.apana.org.au> - 2016-12-10 09:20 +0100
Re: scatterwalk_map_and_copy incorrect optimization Herbert Xu <herbert@gondor.apana.org.au> - 2016-12-10 09:10 +0100
csiph-web