Re: NET_LOCK() pr_sysctl

2017-01-18 Thread Martin Pieuchot
On 16/01/17(Mon) 23:53, Alexander Bluhm wrote: > On Mon, Jan 16, 2017 at 08:34:43PM +0100, Alexander Bluhm wrote: > > If I implement the same trick for newp, I can avoid the "netlock > > locking against myself" with sysctl on memory mapped files over > > NFS. Of course other copyin/copyout paths

Re: NET_LOCK() pr_sysctl

2017-01-16 Thread Mateusz Guzik
On Mon, Jan 16, 2017 at 07:34:43PM +, Alexander Bluhm wrote: > On Mon, Jan 09, 2017 at 11:55:55PM +0100, Alexander Bluhm wrote: > > On Thu, Dec 22, 2016 at 01:38:17AM +0100, Mateusz Guzik wrote: > > > In this particular case, what happens if the access results in a page > > > fault and the

Re: NET_LOCK() pr_sysctl

2017-01-16 Thread Hrvoje Popovski
On 16.1.2017. 23:53, Alexander Bluhm wrote: > Hrvoje Popovski has tested the diff and found some ugly > pmap_unwire: wiring for pmap 0xff00075f5210 va 0x7f7d5000 didn't > change! > kernel printfs. The happens when sysctl(8) writes a value. > > If oldp and newp are in the same page, I

Re: NET_LOCK() pr_sysctl

2017-01-16 Thread Alexander Bluhm
On Mon, Jan 16, 2017 at 08:34:43PM +0100, Alexander Bluhm wrote: > If I implement the same trick for newp, I can avoid the "netlock > locking against myself" with sysctl on memory mapped files over > NFS. Of course other copyin/copyout paths like pf(4) ioctl(2) still > have to be checked. IPsec

Re: NET_LOCK() pr_sysctl

2017-01-16 Thread Alexander Bluhm
On Mon, Jan 09, 2017 at 11:55:55PM +0100, Alexander Bluhm wrote: > On Thu, Dec 22, 2016 at 01:38:17AM +0100, Mateusz Guzik wrote: > > In this particular case, what happens if the access results in a page > > fault and the area comes from a nfs mapped file? If network i/o is done > > from the same

Re: NET_LOCK() pr_sysctl

2017-01-09 Thread Alexander Bluhm
On Thu, Dec 22, 2016 at 01:38:17AM +0100, Mateusz Guzik wrote: > In this particular case, what happens if the access results in a page > fault and the area comes from a nfs mapped file? If network i/o is done > from the same context, this should result in 'locking against myself' > assertion

Re: NET_LOCK() pr_sysctl

2016-12-21 Thread Mateusz Guzik
On Tue, Dec 20, 2016 at 05:37:20PM +, Alexander Bluhm wrote: > Obviosly a NET_LOCK() is missing in tcp_sysctl(). > > I think it is better to place the lock into net_sysctl() where all > the protocol sysctls are called via pr_sysctl. Then we don't have > to decide each case individually. As