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 . 87g
On 08 Apr 2015, at 17:33, kanonenvogel@gmail.com wrote: > > Is it a good idea? bad idea because of sys_pread

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 Ted Unangst
kanonenvogel@gmail.com wrote: > > 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 >

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

Re: falloc and related stuff

2015-04-07 Thread Philip Guenther
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 want to initialise struct file object within falloc() and then p

falloc and related stuff

2015-04-07 Thread Kanonenvogel
Hello. 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 want to initialise struct file object within falloc() and then put it to fd_ofiles array and filehead list. This modi