linux-um.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: Anton Ivanov <anton.ivanov@cambridgegreys.com>
Cc: Christoph Hellwig <hch@lst.de>,
	Johannes Berg <johannes@sipsolutions.net>,
	richard@nod.at, linux-um@lists.infradead.org
Subject: Re: [PATCH, RFC] um: remove set_fs
Date: Mon, 23 Aug 2021 14:17:41 +0200	[thread overview]
Message-ID: <20210823121741.GA12605@lst.de> (raw)
In-Reply-To: <169368f3-1651-8b5c-d979-6ec9e060f6ca@cambridgegreys.com>

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.

_______________________________________________
linux-um mailing list
linux-um@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-um


  reply	other threads:[~2021-08-23 12:17 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-09 13:38 [PATCH, RFC] um: remove set_fs Christoph Hellwig
2021-07-09 14:47 ` Johannes Berg
2021-07-09 16:57   ` Christoph Hellwig
2021-08-23  7:04   ` Christoph Hellwig
2021-08-23  7:14     ` Anton Ivanov
2021-08-23  8:28     ` Anton Ivanov
2021-08-23 12:17       ` Christoph Hellwig [this message]
2021-08-23 12:29         ` Anton Ivanov
2021-08-26 19:15           ` Richard Weinberger
2021-08-26 21:12             ` Anton Ivanov
2021-08-26 22:04               ` Richard Weinberger
2021-08-27  5:40                 ` hch

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210823121741.GA12605@lst.de \
    --to=hch@lst.de \
    --cc=anton.ivanov@cambridgegreys.com \
    --cc=johannes@sipsolutions.net \
    --cc=linux-um@lists.infradead.org \
    --cc=richard@nod.at \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).