Subject: Re: CVS commit: src/lib/libc/arch/i386/string
To: Perry E. Metzger <perry@piermont.com>
From: Matthias Drochner <M.Drochner@fz-juelich.de>
List: current-users
Date: 02/04/2005 19:36:21
perry@piermont.com said:
> #define memcpy(a, b, c)    __builtin_memcpy((a), (b), (c)) 

I think, in the kernel we'd gain more by using processor
specific optimizations where appropriate.
On my box, memset() called by pmap_zero_page() is by far
the biggest single consumer of CPU power. At that point
we know that the memory area is relatively large, is
aligned and is to be filled with zeroes. Throwing all
that knowledge away for calling a function which is
standard outside the kernel is... not clever. And we know
the CPU relatively well, contrary to a userland application.
(Atm I'm playing with a "i686_pagezero" function borrowed
from FreeBSD. Whether the effect is noticable depends on
the workload, and whether "vm.idlezero" is set.)

best regards
Matthias