Re: Futexes and network filesystems.

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Eric W. Biederman <ebiederm@...>
Cc: Ingo Molnar <mingo@...>, Linus Torvalds <torvalds@...>, Dave Hansen <haveblue@...>, Andrew Morton <akpm@...>, Pavel Emelyanov <xemul@...>, Ulrich Drepper <drepper@...>, <linux-kernel@...>, Dinakar Guniguntala [imap] <dino@...>, Sripathi Kodi <sripathik@...>
Date: Wednesday, November 21, 2007 - 2:16 am

On Nov 20, 2007, at 17:53:52, Er ic W. Biederman wrote:

Actually, I would think that get_vm_task_id(void *addr) would be a  
more useful interface.  The call would still be a relatively simple  
lookup to find the struct file associated with the particular virtual  
mapping, but it would be race-free from the perspective of userspace  
and would not require that we somehow figure out the file descriptor  
associated with a particular mmap() (which may be closed by this  
point in time).  Useful extension would be the get_fd_task_id(int fd)  
and get_fs_task_id(const char *path), but those are less important.

The other important thing is to ensure that somehow the numbers are  
considered unique only within the particular domain of a container,  
such that you can migrate a container from one system to another even  
using a simple local ext3 filesystem (on a networked block device)  
and still be able to have things work properly even after the  
migration.  Naturally this would only work with an upgraded libc but  
I think that's a reasonable requirement to enforce for migration of  
futexes and cross-network futexes.

Even for network filesystems which don't implement coherent shared  
memory, you might add a memexcl() system call which (when used by  
multiple cooperating processes) ensures that a given page is only  
ever mapped by at most one computer accessing a given network  
filesystem.  The page-outs and page-ins when shuttling that page  
across the network would be expensive, but I believe the cost would  
be reasonable for many applications and it would allow traditional  
atomic ops on the mapped pages to take and release futexes in the  
uncontended case.

Cheers,
Kyle Moffett

-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[patch] PID namespace design bug, workaround, Ingo Molnar, (Thu Nov 1, 10:43 am)
Re: [patch] PID namespace design bug, workaround, Pavel Emelyanov, (Thu Nov 1, 11:02 am)
Re: [patch] PID namespace design bug, workaround, Ulrich Drepper, (Thu Nov 1, 10:53 am)
Re: [patch] PID namespace design bug, workaround, Ingo Molnar, (Thu Nov 1, 11:05 am)
Re: [patch] PID namespace design bug, workaround, Theodore Tso, (Thu Nov 1, 2:57 pm)
Re: [patch] PID namespace design bug, workaround, Ingo Molnar, (Thu Nov 1, 3:53 pm)
Re: [patch] PID namespace design bug, workaround, Ulrich Drepper, (Thu Nov 1, 8:23 pm)
Re: [patch] PID namespace design bug, workaround, Pavel Emelyanov, (Thu Nov 1, 10:51 am)
Re: [patch] PID namespace design bug, workaround, Ulrich Drepper, (Thu Nov 1, 10:56 am)
Re: [patch] PID namespace design bug, workaround, Dave Hansen, (Thu Nov 1, 12:12 pm)
Re: [patch] PID namespace design bug, workaround, Pavel Emelyanov, (Thu Nov 1, 11:05 am)
Re: [patch] PID namespace design bug, workaround, Ulrich Drepper, (Thu Nov 1, 8:21 pm)
Re: [patch] PID namespace design bug, workaround, Pavel Emelyanov, (Fri Nov 2, 3:55 am)
Re: [patch] PID namespace design bug, workaround, Andrew Morton, (Fri Nov 2, 4:04 am)
Re: [patch] PID namespace design bug, workaround, Dave Hansen, (Fri Nov 2, 1:30 pm)
Re: [patch] PID namespace design bug, workaround, Linus Torvalds, (Fri Nov 2, 1:39 pm)
Re: [patch] PID namespace design bug, workaround, Ingo Molnar, (Sat Nov 3, 4:12 pm)
Futexes and network filesystems., Er ic W. Biederman, (Tue Nov 20, 6:53 pm)
Re: Futexes and network filesystems., Kyle Moffett, (Wed Nov 21, 2:16 am)
Re: Futexes and network filesystems., Eric W. Biederman, (Wed Nov 21, 2:30 am)
Re: [patch] PID namespace design bug, workaround, Linus Torvalds, (Sat Nov 3, 6:40 pm)
Re: [patch] PID namespaces, Ingo Molnar, (Sun Nov 4, 6:38 am)
Re: [patch] PID namespaces, Denys Vlasenko, (Mon Nov 5, 10:47 am)
Re: [patch] PID namespaces, Dave Hansen, (Sun Nov 4, 4:12 pm)
Re: [patch] PID namespace design bug, workaround, Arjan van de Ven, (Sat Nov 3, 7:55 pm)
Re: [patch] PID namespace design bug, workaround, Nicholas Miell, (Sat Nov 3, 12:02 am)
Re: [patch] PID namespace design bug, workaround, Pavel Emelyanov, (Fri Nov 2, 4:14 am)
Re: [patch] PID namespace design bug, workaround, Ulrich Drepper, (Fri Nov 2, 10:05 am)
Re: [patch] PID namespace design bug, workaround, Pavel Emelyanov, (Fri Nov 2, 10:21 am)
Re: [patch] PID namespace design bug, workaround, Eric W. Biederman, (Sun Nov 4, 3:17 am)
Re: [patch] PID namespace design bug, workaround, Ulrich Drepper, (Fri Nov 2, 11:34 am)
Re: [patch] PID namespace design bug, workaround, Pavel Emelyanov, (Fri Nov 2, 11:58 am)
Re: [patch] PID namespace design bug, workaround, Ulrich Drepper, (Sat Nov 3, 12:34 am)
Re: [patch] PID namespace design bug, workaround, Pavel Emelyanov, (Tue Nov 6, 3:49 am)
Re: [patch] PID namespace design bug, workaround, Theodore Tso, (Fri Nov 2, 5:39 pm)
Re: [patch] PID namespace design bug, workaround, Peter Zijlstra, (Thu Nov 1, 10:56 am)
Re: [patch] PID namespace design bug, workaround, Pavel Emelyanov, (Thu Nov 1, 11:06 am)
Re: [patch] PID namespace design bug, workaround, Ingo Molnar, (Thu Nov 1, 11:17 am)
Re: [patch] PID namespace design bug, workaround, Pavel Emelyanov, (Thu Nov 1, 11:30 am)