[patch-2.3.40-pre6] kzalloc() (ala kmem_zalloc() of SVR4)

Tigran Aivazian tigran en sco.COM
Lun Ene 24 10:29:00 CST 2000


(dropped Linus from cc as I believe it is not a very important topic)

On 24 Jan 2000, Jes Sorensen wrote:
> Jeff> I proposed something along these lines several months ago, poke
> Jeff> around for the thread.  While I agree with the patch, because it
> Jeff> will save me a few lines of code here and there, an idea that
> Jeff> came out of the previous discussion is also worth considering --
> Jeff> zeroing pages during system idle time, and then handing those
> Jeff> out from kzalloc() (or kmalloc(GFP_ZERO|GFP_xxx) or whatever)
> 
> Another thing I forgot to bring up earlier in the dicussion, most of
> the places doing kmalloc();memset(); are in initialization parts of
> the code, ie. they will be marked __init, so the optimization is a
> no-win, the only thing you save is to write one line less of code.

There are plenty of cases where it is used without __init. However, now
that I hear Jeff's idea of GFP_ZERO flag to kmalloc() I agree that it is
superiour. There is no need to invent (and export) a new function (with a
funny name as well) where the old one will suffice. Also, it saves an
extra function call.

Regards,
Tigran.


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo en vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



Más información sobre la lista de distribución Ayuda