Re: [PATCH] x86: only use ERMS for user copies for larger sizes

From: Andy Lutomirski
Date: Fri Nov 23 2018 - 14:11:26 EST




> On Nov 23, 2018, at 11:44 AM, Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx> wrote:
>
>> On Fri, Nov 23, 2018 at 10:39 AM Andy Lutomirski <luto@xxxxxxxxxxxxxx> wrote:
>>
>> What is memcpy_to_io even supposed to do? Iâm guessing itâs defined as something like âcopy this data to IO space using at most long-sized writes, all aligned, and writing each byte exactly once, in order.â That sounds... dubiously useful.
>
> We've got hundreds of users of it, so it's fairly common..
>

Iâm wondering if the âat most long-sizesâ restriction matters, especially given that weâre apparently accessing some of the same bytes more than once. I would believe that trying to encourage 16-byte writes (with AVX, ugh) or 64-byte writes (with MOVDIR64B) would be safe and could meaningfully speed up some workloads.

>> I could see a function that writes to aligned memory in specified-sized chunks.
>
> We have that. It's called "__iowrite{32,64}_copy()". It has very few users.
>
> Linus