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

[MiNT] possible fork() speedup



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 */
};