On Wed, 2018-11-21 at 06:32 -0700, Jens Axboe wrote: > I did some more investigation yesterday, and found this: > > commit 236222d39347e0e486010f10c1493e83dbbdfba8 > Author: Paolo Abeni <pab...@redhat.com> > Date: Thu Jun 29 15:55:58 2017 +0200 > > x86/uaccess: Optimize copy_user_enhanced_fast_string() for short strings > > which does attempt to rectify it, but only using ERMS for >= 64 byte copies. > At least for me, looks like the break even point is higher than that, which > would mean that something like the below would be more appropriate.
Back then I used a custom kernel module and the tsc to micro-benchmark the patched function and the original one with different buffer sizes. I'm sorry, the relevant code has been lost. In my experiments 64 bytes was the break even point for all the CPUs I had handy, but I guess that may change with other models. Cheers, Paolo