Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1357246

unshare(CLONE_VM) Re: [PATCH] unshare: Use rcu_assign_pointer when setting sighand

From Julian Smith <jsmith@undo-software.com>
Newsgroups linux.kernel
Subject unshare(CLONE_VM) Re: [PATCH] unshare: Use rcu_assign_pointer when setting sighand
Date 2016-03-14 15:00 +0100
Message-ID <rcBcm-4sZ-5@gated-at.bofh.it> (permalink)
References (2 earlier) <rcBcm-4sZ-11@gated-at.bofh.it> <rcBcm-4sZ-13@gated-at.bofh.it> <rcBcm-4sZ-15@gated-at.bofh.it> <rcBcm-4sZ-17@gated-at.bofh.it> <rcBcm-4sZ-19@gated-at.bofh.it>
Organization Undo Software

Show all headers | View raw


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

Back to linux.kernel | Previous | NextNext in thread | Find similar | Unroll thread


Thread

unshare(CLONE_VM) Re: [PATCH] unshare: Use rcu_assign_pointer when  setting sighand Julian Smith <jsmith@undo-software.com> - 2016-03-14 15:00 +0100
  Re: unshare(CLONE_VM) Re: [PATCH] unshare: Use rcu_assign_pointer  when setting sighand Linus Torvalds <torvalds@linux-foundation.org> - 2016-03-14 19:40 +0100

csiph-web