From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alan Jenkins Date: Mon, 25 May 2009 13:46:25 +0000 Subject: Good news for threading! Message-Id: <4A1AA131.7000202@tuffmail.co.uk> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: linux-hotplug@vger.kernel.org I solved one of the reservations that held me back on threaded udevd. I still have some other concerns to work on, but I'm feeling much more optimistic now. Replacing processes with threads reduced page faults (copy-on-write) by 60-80%, but that _still_ left over 10% of udevd time in page fault overhead. I've discovered I can reduce this overhead much further by marking thread stacks with MADV_DONTFORK. When a thread needs to fork an external program, it can temporarily unmark its own thread stack. Disclaimer: I have no idea why this should reduce the number of page faults. I could be getting something horribly wrong. But even if it's wrong, at least it gives me a new angle on this problem. Alan