Re: memset as memzero

2007-09-23 Thread Willy Tarreau
On Sun, Sep 23, 2007 at 10:05:05AM -0700, Linus Torvalds wrote: > > > On Sun, 23 Sep 2007, Arnaldo Carvalho de Melo wrote: > > > > bzero! That is it, its nothing new, just a sane name to something [..] > > No, please no! > > The BSD memory functions are nasty. If you do bzero, you logically sh

Re: memset as memzero

2007-09-23 Thread Linus Torvalds
On Sun, 23 Sep 2007, Arnaldo Carvalho de Melo wrote: > > bzero! That is it, its nothing new, just a sane name to something [..] No, please no! The BSD memory functions are nasty. If you do bzero, you logically should do the others too, and they are way inferior to the standard ones. Let's no

Re: memset as memzero

2007-09-23 Thread Arnaldo Carvalho de Melo
Em Sun, Sep 23, 2007 at 12:33:13PM -0400, Robert P. J. Day escreveu: > On Sun, 23 Sep 2007, Dave Jones wrote: > > > There is one useful argument for memzero (or bzero to give it its > > proper name), and that's that it's impossible to screw up. I'm still > > amazed at how many times I see > > > >

Re: memset as memzero

2007-09-23 Thread Robert P. J. Day
On Sun, 23 Sep 2007, Dave Jones wrote: > There is one useful argument for memzero (or bzero to give it its > proper name), and that's that it's impossible to screw up. I'm still > amazed at how many times I see > > memset (x,size,0); > > in various code. So much so, that my editor highlights

Re: memset as memzero

2007-09-23 Thread Arnaldo Carvalho de Melo
Em Sun, Sep 23, 2007 at 11:32:43AM -0400, Dave Jones escreveu: > On Sat, Sep 22, 2007 at 11:53:53AM -0700, Linus Torvalds wrote: > > > > > > On Sat, 22 Sep 2007, Arjan van de Ven wrote: > > > > > > it doesn't add value memset with a constant 0 is just as fast > > > (since the compiler

Re: memset as memzero

2007-09-23 Thread Dave Jones
On Sat, Sep 22, 2007 at 11:53:53AM -0700, Linus Torvalds wrote: > > > On Sat, 22 Sep 2007, Arjan van de Ven wrote: > > > > it doesn't add value memset with a constant 0 is just as fast > > (since the compiler knows it's 0) than any wrapper around it, and the > > syntax around it is ot

Re: memset as memzero

2007-09-22 Thread Oleg Verych (nntp)
22-09-2007, Bernd Eckenfels: > In article <[EMAIL PROTECTED]> you wrote: >> it doesn't add value memset with a constant 0 is just as fast >> (since the compiler knows it's 0) than any wrapper around it, and the >> syntax around it is otherwise the same. linux/arch/x86_64/lib/memset.S isn't fil

Re: memset as memzero

2007-09-22 Thread Cyrill Gorcunov
[Arjan van de Ven - Sat, Sep 22, 2007 at 12:46:59PM -0700] | On Sat, 22 Sep 2007 12:33:55 +0400 | Cyrill Gorcunov <[EMAIL PROTECTED]> wrote: | | > Hi list, | > | > could anyone tell me why there is no official memzero function (or | > macros) in the kernel. | | it doesn't add value memset wi

Re: memset as memzero

2007-09-22 Thread Bernd Eckenfels
In article <[EMAIL PROTECTED]> you wrote: > it doesn't add value memset with a constant 0 is just as fast > (since the compiler knows it's 0) than any wrapper around it, and the > syntax around it is otherwise the same. it would however allow easier changing if you need to add a page cleaning

Re: memset as memzero

2007-09-22 Thread Linus Torvalds
On Sat, 22 Sep 2007, Arjan van de Ven wrote: > > it doesn't add value memset with a constant 0 is just as fast > (since the compiler knows it's 0) than any wrapper around it, and the > syntax around it is otherwise the same. Indeed. The reason we have "clear_page()" is not because the valu

Re: memset as memzero

2007-09-22 Thread Arjan van de Ven
On Sat, 22 Sep 2007 12:33:55 +0400 Cyrill Gorcunov <[EMAIL PROTECTED]> wrote: > Hi list, > > could anyone tell me why there is no official memzero function (or > macros) in the kernel. it doesn't add value memset with a constant 0 is just as fast (since the compiler knows it's 0) than any wr

Re: memset as memzero

2007-09-22 Thread Cyrill Gorcunov
[Robert P. J. Day - Sat, Sep 22, 2007 at 05:55:04AM -0400] | On Sat, 22 Sep 2007, Cyrill Gorcunov wrote: | | > Thanks Robert for the answer, I'll mark this (clear_page) in my | > "must to take a look" list ;) | | there's already been a discussion about clear_page() as well: | | http://lists.op

Re: memset as memzero

2007-09-22 Thread Robert P. J. Day
On Sat, 22 Sep 2007, Cyrill Gorcunov wrote: > Thanks Robert for the answer, I'll mark this (clear_page) in my > "must to take a look" list ;) there's already been a discussion about clear_page() as well: http://lists.openwall.net/linux-kernel/2006/12/29/39 you might want to start there to get

Re: memset as memzero

2007-09-22 Thread Cyrill Gorcunov
[Robert P. J. Day - Sat, Sep 22, 2007 at 04:48:28AM -0400] | On Sat, 22 Sep 2007, Cyrill Gorcunov wrote: | | > Hi list, | > | > could anyone tell me why there is no official memzero function (or | > macros) in the kernel. As I see a lot of kernel parts calls for it | > (defying own macros as alias

Re: memset as memzero

2007-09-22 Thread Robert P. J. Day
On Sat, 22 Sep 2007, Cyrill Gorcunov wrote: > Hi list, > > could anyone tell me why there is no official memzero function (or > macros) in the kernel. As I see a lot of kernel parts calls for it > (defying own macros as alias to memset). Maybe there is a special > reason not to do so? Actually my

memset as memzero

2007-09-22 Thread Cyrill Gorcunov
Hi list, could anyone tell me why there is no official memzero function (or macros) in the kernel. As I see a lot of kernel parts calls for it (defying own macros as alias to memset). Maybe there is a special reason not to do so? Actually my suggestion is to define _one_ general macros for this.