[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [MiNT] possible fork() speedup



Hi!

Replying to myself because my proposal is not that easy to implement as I 
thought before.

It would need to extend the fcookie structure with an additional 
copy-on-write flag which may require all the .xfs to be updated. I'm not 
sure about the binary compatibility issues, but I think it might be done.
Or is it something that man should not touch in FreeMiNT?

Anyway what is the reason to keep the fcookie root[NDRIVES] in each 
process structure and not only in the kernel one?

regards

STan


On Mon, 8 Sep 2003, Standa Opichal wrote:

> Hi All!
> 
> Petr Stehlik has just noticed that there is the 
> dupcookie()/releasecookie() called frequently on the ARAnyM HOSTFS even 
> while gcc'ing something on non-HOSTFS drive.
> 
> The problem is that the root and curdir arrays (in currproc->p_cwd) are 
> copied on each fork() call. This requires to employ all mounted and ever 
> cd'ed drive driver by the touple call.
> 
> What do you think about a possibility to add a long field that would 
> hold the copy-on-write flags for all the curdir[] entries (the root[] is 
> not modified anywhere) and check it whenever the entry is to be changed 
> and copy/leave-untouched accordingly. There is AFAICS now after only a 
> brief investigation only one place where the curdir[] entry is beeing 
> changed (sys/dosdir.c:414).
> 
> Any comments?
> 
> regards
> 
> STan
> 
> ===================
> 
> struct cwd
> {
>         ....
> 
>         /* DOS emulation
>          */
> 
>         ....
>         fcookie         root[NDRIVES];  /* root directories */
>         fcookie         curdir[NDRIVES];/* current directory */
> };
> 
> 
> 
>