linux-um.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Johannes Berg <johannes@sipsolutions.net>
To: Anton Ivanov <anton.ivanov@cambridgegreys.com>,
	 linux-um@lists.infradead.org
Subject: Re: [PATCH] um: clean up mm creation
Date: Fri, 22 Sep 2023 16:20:20 +0200	[thread overview]
Message-ID: <10536e1e18d190e3f9d977511fcabb1d730aaeb6.camel@sipsolutions.net> (raw)
In-Reply-To: <88e0568b-6860-9042-7f8b-ab53edb4242e@cambridgegreys.com>

On Fri, 2023-09-22 at 14:41 +0100, Anton Ivanov wrote:
> On 22/09/2023 12:16, Johannes Berg wrote:
> > From: Johannes Berg <johannes.berg@intel.com>
> > 
> > While enabling PREEMPT on UML, we found that the call to
> > force_flush_all() cannot be done where it is, it sleeps
> > while atomic.
> > 
> > Further investigation shows that all this seems at least
> > a bit roundabout and possibly wrong wrong in the first
> > place - we copy from the 'current' process and then flush
> > when it starts running.
> > 
> > What we really want is to start fresh with an empty mm
> > process, then have it all set up by the kernel (copying
> > the original mm contents as needed), and then sync it
> > in arch_dup_mmap().
> 
> Is there a way we can come up with COW here?

Well, I kind of thought we _did_ if we have arch_dup_mmap()?

Need to understand this better.

> > 
> > We should do the same for the LDT, so need to split that
> > to be able to do this.
> > 
> > Note that this fixes what seems like an issue - we look
> > at current->mm when we copy, but that doesn't seem right
> > in the case of clone() without copying the MM. This is
> > probably saved by the forced flush later right now.
> 
> We will need to work on this.
> 
> It is nearly twice slower than the current approach on a find /usr -type f -exec cat {} > /dev/null \;

Hm, that's annoying. Guess I have to figure out why.

johannes

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

  reply	other threads:[~2023-09-22 14:20 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-22 11:16 [PATCH] um: clean up mm creation Johannes Berg
2023-09-22 13:41 ` Anton Ivanov
2023-09-22 14:20   ` Johannes Berg [this message]
2023-09-22 15:31   ` Benjamin Berg
2023-09-22 15:49     ` Anton Ivanov
2023-09-22 19:41   ` Johannes Berg
2023-09-22 20:08     ` Anton Ivanov
2023-09-22 20:12       ` Johannes Berg
2023-09-22 20:17         ` Anton Ivanov
2023-09-23  5:29         ` Anton Ivanov
2023-09-23 19:58           ` Johannes Berg
2023-09-22 13:49 ` Benjamin Berg
2023-09-22 18:15 ` Johannes Berg
2023-09-22 19:30 ` Johannes Berg

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=10536e1e18d190e3f9d977511fcabb1d730aaeb6.camel@sipsolutions.net \
    --to=johannes@sipsolutions.net \
    --cc=anton.ivanov@cambridgegreys.com \
    --cc=linux-um@lists.infradead.org \
    /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).