From: Julian Smith <jsmith@undo-software.com>
To: Oleg Nesterov <oleg@redhat.com>
Cc: Janak Desai <janak@us.ibm.com>, Andrew Morton <akpm@osdl.org>,
ebiederm@xmission.com,
Linus Torvalds <torvalds@linux-foundation.org>,
linux-kernel@vger.kernel.org
Subject: unshare(CLONE_VM) Re: [PATCH] unshare: Use rcu_assign_pointer when setting sighand
Date: Mon, 14 Mar 2016 13:15:00 +0000 [thread overview]
Message-ID: <20160314131500.21b9f6c5@jules-lenovo3> (raw)
In-Reply-To: <441C4263.B779CDA8@tv-sign.ru>
On Sat, 18 Mar 2006 20:24:51 +0300
Oleg Nesterov <oleg@tv-sign.ru> wrote:
[...]
> However, I stronly beleive unshare(CLONE_VM) is buggy.
>
> sys_unshare:
>
>
> if (new_mm) {
> ...
> new_mm = mm;
> }
>
> ...
>
> bad_unshare_cleanup_vm:
> if (new_mm)
> mmput(new_mm);
>
>
> mmput() ignores mm->core_waiters.
Apologies for re-opening a ten-year-old thread.
I'm looking into whether it would be possible to extend the unshare
syscall to support the CLONE_VM flag with multi-threaded processes,
because this would allow us at Undo to record multi-threaded user
processes much more efficiently than at present.
We currently have to serialise threads and so suffer an N-times
slowdown when recording a process with N cpu-bound threads. But if we
could get per-thread memory permissions with unshare(CLONE_VM), we'd be
able record a multi-threaded process with almost no per-thread
slowdown.
When the unshare syscall was introduced, it seems that the
mm->core_waiters issue was the only thing that prevented CLONE_VM being
supported. Is that right, or were there other problems too?
Many thanks for any information about this.
- Julian
--
http://undo-software.com
next prev parent reply other threads:[~2016-03-14 13:58 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-03-16 16:49 [PATCH] unshare: Cleanup up the sys_unshare interface before we are committed Eric W. Biederman
2006-03-16 17:31 ` [PATCH] unshare: Use rcu_assign_pointer when setting sighand Eric W. Biederman
2006-03-17 6:48 ` Paul E. McKenney
2006-03-17 17:44 ` Oleg Nesterov
2006-03-17 20:56 ` Andrew Morton
2006-03-18 13:12 ` Oleg Nesterov
2006-03-18 15:43 ` Janak Desai
2006-03-18 17:24 ` Oleg Nesterov
2006-03-18 17:41 ` [PATCH] for 2.6.16, disable unshare_vm() Oleg Nesterov
2006-03-18 18:10 ` Linus Torvalds
2006-03-18 18:29 ` Ulrich Drepper
2006-03-18 18:48 ` Janak Desai
2016-03-14 13:15 ` Julian Smith [this message]
2016-03-14 18:35 ` unshare(CLONE_VM) Re: [PATCH] unshare: Use rcu_assign_pointer when setting sighand Linus Torvalds
2006-03-18 13:13 ` [PATCH] implement unshare(CLONE_SIGHAND) for single-thread case Oleg Nesterov
2006-03-18 15:10 ` [PATCH] unshare: Error if passed unsupported flags Eric W. Biederman
2006-03-18 15:33 ` Janak Desai
2006-03-18 16:29 ` [PATCH] unshare: Use rcu_assign_pointer when setting sighand Janak Desai
2006-03-16 19:40 ` [PATCH] unshare: Cleanup up the sys_unshare interface before we are committed Michael Kerrisk
2006-03-16 20:33 ` Andrew Morton
2006-03-16 20:41 ` Linus Torvalds
2006-03-16 21:58 ` Eric W. Biederman
2006-03-16 22:19 ` Andrew Morton
2006-03-16 21:36 ` Janak Desai
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=20160314131500.21b9f6c5@jules-lenovo3 \
--to=jsmith@undo-software.com \
--cc=akpm@osdl.org \
--cc=ebiederm@xmission.com \
--cc=janak@us.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=oleg@redhat.com \
--cc=torvalds@linux-foundation.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).