[PATCH, RFC] um: remove set_fs

Christoph Hellwig hch at lst.de
Mon Aug 23 05:17:41 PDT 2021


On Mon, Aug 23, 2021 at 09:28:37AM +0100, Anton Ivanov wrote:
> In first read - you do not want to do that.
>
> buffer_op is slow (even with all the tweaks we have done to that). It is one of the reasons UML userspace is slower than it should be.
>
> The primary reason for that is that it never copies more than a page at a time and pages in/out a page at a time.
>
> We retain reasonable kernel speed because we bypass it for kernel - "if (uaccess_kernel())".
>
> Unless I am missing something, this change will use the slow path currently used for userspace for the kernel.

uaccess_kernel() is not the fast path, it is the exception path when
someone uses the uaccess helper on kernel pointer after doing a
set_fs(KERNEL_DS).  And this path is entirel gone once CONFIG_SET_FS
is not set and replaced with calls to __get_kernel_nofault /
__put_kernel_nofault.

In other words - very little generated code actually changes with
this patch, except for the context switch path, which gets simplified.



More information about the linux-um mailing list