Re: On github now

2015-04-16 Thread kanonenvogel....@gmail.com
Well, lets begin. In the future, I wish to have fd_getfile() returning acquired fp instance. The goal is to not to have pointer to destroyed fp instance in FREF()/FRELE()/fd_getfile() races. This one requres modification of getsock(), getvnode() and dupfdopen() functions, they must receive pointer

Re: File protection, second attempt

2015-04-15 Thread kanonenvogel....@gmail.com
On 14 Apr 2015, at 18:35, Mike Belopuhov wrote: > > Supposedly you don't have to KERNEL_LOCK for pool_{get,put} anymore. Underlying uvm calls are not mp safe and not protected by KERNEL_LOCK() calls.

Re: falloc and related stuff

2015-04-09 Thread kanonenvogel....@gmail.com
Struct file again. f_flag isn’t modified often, so it’s modifacation can be atomic. f_msgcount and f_rxfer, f_wxfer, f_seek, f_rbytes, f_wbytes can be protected by rwlock. f_offset protection is actual for vnodes only. FIF_MARK and FIF_DEFER flags are used only by unpc garbage collector. This f

Re: falloc and related stuff

2015-04-08 Thread kanonenvogel....@gmail.com
On 08 Apr 2015, at 17:33, kanonenvogel@gmail.com wrote: > > Is it a good idea? bad idea because of sys_pread/sys_pwrite

Re: falloc and related stuff

2015-04-08 Thread kanonenvogel....@gmail.com
On 08 Apr 2015, at 15:03, Ted Unangst wrote: > Also, this only helps if you're sure that the code reading the flag will do so > in an smp safe way. In many cases, the reading code will also need to acquire > a lock in order to correctly do something after reading the flag. From the > diff context

Re: falloc and related stuff

2015-04-08 Thread kanonenvogel....@gmail.com
On 08 Apr 2015, at 15:03, Ted Unangst wrote: > The atomic functions are quite expensive on > some architectures, so we don't want to just use them everywhere. So, rwlock is better here? Also, can you explain this lines from finishdup() function (openbsd-5., file kern/kern_descrip.c, lines 576-

Re: falloc and related stuff

2015-04-08 Thread kanonenvogel....@gmail.com
On 08 Apr 2015, at 02:31, Philip Guenther wrote: > On Tue, Apr 7, 2015 at 3:57 PM, Kanonenvogel > wrote: >> I have idea to modify falloc() function and related logic. >> Now, after successful faclloc call, we have half-initialized struct file >> object, protected by FIF_LARVAL flag. >> I wan