Re: Unlock sendit-based syscalls

2018-06-27 Thread Visa Hankala
Here is a new version of the f_count atomic update diff. Now all updating of the `f_count' field should use atomic operations, and the `fhdlk' is only used for serializing access to the list of open files. In addition, the role of the `fd_fplock' should be clearer now: its only purpose is to let fd

Re: Unlock sendit-based syscalls

2018-06-21 Thread Visa Hankala
On Thu, Jun 21, 2018 at 04:49:48PM +, Visa Hankala wrote: > Here is an updated diff that has been adjusted for the current tree. Hmm, the diff is not right yet. Please ignore.

Re: Unlock sendit-based syscalls

2018-06-21 Thread Visa Hankala
On Tue, Jun 19, 2018 at 03:36:57PM +, Visa Hankala wrote: > On Tue, Jun 19, 2018 at 03:58:51PM +0200, Mark Kettenis wrote: > > > Date: Tue, 19 Jun 2018 15:38:01 +0200 > > > From: Martin Pieuchot > > > > > > On 19/06/18(Tue) 14:55, Mark Kettenis wrote: > > > > > To avoid races with another thr

Re: Unlock sendit-based syscalls

2018-06-19 Thread Visa Hankala
On Tue, Jun 19, 2018 at 03:58:51PM +0200, Mark Kettenis wrote: > > Date: Tue, 19 Jun 2018 15:38:01 +0200 > > From: Martin Pieuchot > > > > On 19/06/18(Tue) 14:55, Mark Kettenis wrote: > > > > To avoid races with another thread that might be clearing our pointer > > > > in `fd_ofiles', we need mor

Re: Unlock sendit-based syscalls

2018-06-19 Thread Mark Kettenis
> Date: Tue, 19 Jun 2018 15:38:01 +0200 > From: Martin Pieuchot > > On 19/06/18(Tue) 14:55, Mark Kettenis wrote: > > > To avoid races with another thread that might be clearing our pointer > > > in `fd_ofiles', we need more than atomic operations. For that we need > > > to serialize the threads.

Re: Unlock sendit-based syscalls

2018-06-19 Thread Martin Pieuchot
On 19/06/18(Tue) 14:55, Mark Kettenis wrote: > > To avoid races with another thread that might be clearing our pointer > > in `fd_ofiles', we need more than atomic operations. For that we need > > to serialize the threads. The most simple way to do so is with a mutex > > on a different data struc

Re: Unlock sendit-based syscalls

2018-06-19 Thread Mark Kettenis
> Date: Tue, 19 Jun 2018 10:54:21 +0200 > From: Martin Pieuchot > > On 18/06/18(Mon) 18:18, Mark Kettenis wrote: > > > Date: Mon, 18 Jun 2018 11:24:00 +0200 > > > From: Martin Pieuchot > > > > > > Diff below is the last of the serie to remove the KERNEL_LOCK() from > > > sendto(2) and sendmsg(2

Re: Unlock sendit-based syscalls

2018-06-19 Thread Martin Pieuchot
On 18/06/18(Mon) 18:18, Mark Kettenis wrote: > > Date: Mon, 18 Jun 2018 11:24:00 +0200 > > From: Martin Pieuchot > > > > Diff below is the last of the serie to remove the KERNEL_LOCK() from > > sendto(2) and sendmsg(2) for sockets protected by the NET_LOCK(). > > > > As explained previously [0]

Re: Unlock sendit-based syscalls

2018-06-18 Thread Mark Kettenis
> Date: Mon, 18 Jun 2018 11:24:00 +0200 > From: Martin Pieuchot > > Diff below is the last of the serie to remove the KERNEL_LOCK() from > sendto(2) and sendmsg(2) for sockets protected by the NET_LOCK(). > > As explained previously [0] this diff uses a simple non-intrusive > approached based on

Unlock sendit-based syscalls

2018-06-18 Thread Martin Pieuchot
Diff below is the last of the serie to remove the KERNEL_LOCK() from sendto(2) and sendmsg(2) for sockets protected by the NET_LOCK(). As explained previously [0] this diff uses a simple non-intrusive approached based on a single mutex. I'd like to get this in before doing any refactoring of this

Unlock sendit() based syscalls

2018-06-04 Thread Martin Pieuchot
Diff below contains the interesting bits to unlock most of the network related syscalls. As previously explained [0], we know that `f_data' is immutable for sockets so we only have to protect `f_count'. This is done by using a global mutex: `fhdlk'. I'm aware that this is not the best solution,