From owner-mint@fishpool.com Mon Sep 8 19:17:22 2003 Date: Mon, 8 Sep 2003 19:14:05 +0200 (CEST) From: Standa Opichal X-X-Sender: stop@mail.idoox.com To: mint@fishpool.com Subject: [MiNT] possible fork() speedup Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Delivered-To: mint@fishpool.com Delivered-To: mint@lists.fishpool.fi X-ecartis-version: Ecartis v1.0.0 Sender: mint-bounce@lists.fishpool.fi Errors-to: mint-bounce@lists.fishpool.fi X-original-sender: opichals@seznam.cz Precedence: bulk List-help: List-unsubscribe: List-ID: X-List-ID: 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 */ };