Re: Overcommit and calloc()

1999-07-20 Thread Ville-Pertti Keinonen
[EMAIL PROTECTED] (Dag-Erling Smorgrav) writes: "Kelly Yancey" [EMAIL PROTECTED] writes: Ahh...but wouldn't the bzero() touch all of the memory just allocated functionally making it non-overcommit? No. If it were an "non-overcomitting malloc", it would return NULL and set errno to

Re: Overcommit and calloc()

1999-07-20 Thread Dag-Erling Smorgrav
"Kelly Yancey" [EMAIL PROTECTED] writes: I don't know how many programs make use of calloc() but would not a more efficient algorithm be to better integrate it with malloc() such that if there is a fragment on the heap which can be used, bzero() it and return that, otherwise, simply call

Re: Overcommit and calloc()

1999-07-20 Thread Dag-Erling Smorgrav
John-Mark Gurney [EMAIL PROTECTED] writes: Dag-Erling Smorgrav scribbled this message on Jul 20: When I allocate memory, I usually intend to put something in it. There's always the odd struct sockaddr_in which I bzero() before filling it in, but they're usually on the stack. and even

Re: Overcommit and calloc()

1999-07-20 Thread Peter Dufault
Well, bzero could map all memory (outside the boundaries) to a single zeroed page marked copy on write. The statistics you could gather might then point out some grossly broken programs. Peter -- Peter Dufault ([EMAIL PROTECTED]) Realtime development, Machine control, HD Associates, Inc.

RE: Overcommit and calloc()

1999-07-20 Thread Kelly Yancey
From: Charles Randall I have another post on this list which begs the question: if memory given to us from sbrk() is already zeroed, why zero it again if we don't have too if we make calloc() smarter, we could save come clock cycles. Because the memory returned from malloc() might be

RE: Overcommit and calloc()

1999-07-20 Thread Bob Bishop
Hi, At 1:28 pm -0400 20/7/99, Kelly Yancey wrote: [...] On recent thought though, I seem to recall having read in the 4.4BSD Daemon book that having the kernel zero memory is not the preferred practice, but present because when they tried to stop many progrems dies which assumed memory was

Re: RE: Overcommit and calloc()

1999-07-20 Thread Matthew Dillon
:Hi, : :At 1:28 pm -0400 20/7/99, Kelly Yancey wrote: :[...] : On recent thought though, I seem to recall having read in the 4.4BSD :Daemon book that having the kernel zero memory is not the preferred :practice, but present because when they tried to stop many progrems dies :which assumed memory

RE: RE: Overcommit and calloc()

1999-07-20 Thread Kelly Yancey
-Original Message- From: Matthew Dillon [mailto:[EMAIL PROTECTED]] Sent: Tuesday, July 20, 1999 1:53 PM To: Kelly Yancey Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: Re: RE: Overcommit and calloc() I think this would be a waste of time. As I have said, very few

Re: Overcommit and calloc()

1999-07-20 Thread Ville-Pertti Keinonen
d...@flood.ping.uio.no (Dag-Erling Smorgrav) writes: Kelly Yancey kby...@alcnet.com writes: Ahh...but wouldn't the bzero() touch all of the memory just allocated functionally making it non-overcommit? No. If it were an non-overcomitting malloc, it would return NULL and set errno to

Re: Overcommit and calloc()

1999-07-20 Thread Dag-Erling Smorgrav
Kelly Yancey kby...@alcnet.com writes: I don't know how many programs make use of calloc() but would not a more efficient algorithm be to better integrate it with malloc() such that if there is a fragment on the heap which can be used, bzero() it and return that, otherwise, simply call

Re: Overcommit and calloc()

1999-07-20 Thread John-Mark Gurney
Dag-Erling Smorgrav scribbled this message on Jul 20: When I allocate memory, I usually intend to put something in it. There's always the odd struct sockaddr_in which I bzero() before filling it in, but they're usually on the stack. and even then, I don't believe in filling sockaddr_in w/

Re: Overcommit and calloc()

1999-07-20 Thread Dag-Erling Smorgrav
John-Mark Gurney gurne...@efn.org writes: Dag-Erling Smorgrav scribbled this message on Jul 20: When I allocate memory, I usually intend to put something in it. There's always the odd struct sockaddr_in which I bzero() before filling it in, but they're usually on the stack. and even then,

Re: Overcommit and calloc()

1999-07-20 Thread Peter Dufault
Well, bzero could map all memory (outside the boundaries) to a single zeroed page marked copy on write. The statistics you could gather might then point out some grossly broken programs. Peter -- Peter Dufault (dufa...@hda.com) Realtime development, Machine control, HD Associates, Inc.

RE: Overcommit and calloc()

1999-07-20 Thread Kelly Yancey
From: Charles Randall I have another post on this list which begs the question: if memory given to us from sbrk() is already zeroed, why zero it again if we don't have too if we make calloc() smarter, we could save come clock cycles. Because the memory returned from malloc() might be

RE: Overcommit and calloc()

1999-07-20 Thread David Wolfskill
From: Kelly Yancey kby...@alcnet.com Date: Tue, 20 Jul 1999 13:28:21 -0400 On recent thought though, I seem to recall having read in the 4.4BSD Daemon book that having the kernel zero memory is not the preferred practice, but present because when they tried to stop many progrems dies which

RE: Overcommit and calloc()

1999-07-20 Thread Bob Bishop
Hi, At 1:28 pm -0400 20/7/99, Kelly Yancey wrote: [...] On recent thought though, I seem to recall having read in the 4.4BSD Daemon book that having the kernel zero memory is not the preferred practice, but present because when they tried to stop many progrems dies which assumed memory was

Re: RE: Overcommit and calloc()

1999-07-20 Thread Matthew Dillon
I think this would be a waste of time. As I have said, very few large allocations use calloc(). Nearly all small allocations come off the heap. The cost of adding the complexity to calloc to avoid zeroing the data is not going to be worth the minor (and unnoticeable)

Re: RE: Overcommit and calloc()

1999-07-20 Thread Matthew Dillon
:Hi, : :At 1:28 pm -0400 20/7/99, Kelly Yancey wrote: :[...] : On recent thought though, I seem to recall having read in the 4.4BSD :Daemon book that having the kernel zero memory is not the preferred :practice, but present because when they tried to stop many progrems dies :which assumed memory

RE: RE: Overcommit and calloc()

1999-07-20 Thread Kelly Yancey
-Original Message- From: Matthew Dillon [mailto:dil...@apollo.backplane.com] Sent: Tuesday, July 20, 1999 1:53 PM To: Kelly Yancey Cc: crand...@matchlogic.com; freebsd-hackers@FreeBSD.ORG Subject: Re: RE: Overcommit and calloc() I think this would be a waste of time. As I

Re: RE: Overcommit and calloc()

1999-07-20 Thread Bob Bishop
Hi again, At 10:54 am -0700 20/7/99, Matthew Dillon wrote: [...] It should also be noted that unless your system is entirely cpu-bound, there is no cost to the kernel to zero memory because it pre-zero's pages in its idle loop. Thanks to distributed.net, SETI. et al, idle cycles are

Re: RE: Overcommit and calloc()

1999-07-20 Thread Matthew Dillon
:Hi again, : :At 10:54 am -0700 20/7/99, Matthew Dillon wrote: :[...] :It should also be noted that unless your system is entirely cpu-bound, :there is no cost to the kernel to zero memory because it pre-zero's :pages in its idle loop. : :Thanks to distributed.net, SETI. et al, idle

Overcommit and calloc()

1999-07-19 Thread Kelly Yancey
On the other hand, I find the discussion about the merits of overcommit and the (albeit not always in-depth) explanations of the FreeBSD VM system educational. It would be nice if would could just extract the small amount of signal from this discussion and put it into documentation

Re: Overcommit and calloc()

1999-07-19 Thread Dag-Erling Smorgrav
"Kelly Yancey" [EMAIL PROTECTED] writes: I'm afraid my question got lost amongst the see of overcommit messages. :) I was curious if calloc() was overcommitted also? Here's our calloc() implementation: void * calloc(num, size) size_t num; register size_t size; {

RE: Overcommit and calloc()

1999-07-19 Thread Kelly Yancey
://www.freebsd.org/ Join Team FreeBSD - http://www.posi.net/freebsd/Team-FreeBSD -Original Message- From: Dag-Erling Smorgrav [mailto:[EMAIL PROTECTED]] Sent: Monday, July 19, 1999 12:07 PM To: Kelly Yancey Cc: [EMAIL PROTECTED] Subject: Re: Overcommit and calloc() "Kelly Y

Re: Overcommit and calloc()

1999-07-19 Thread Dag-Erling Smorgrav
"Kelly Yancey" [EMAIL PROTECTED] writes: Ahh...but wouldn't the bzero() touch all of the memory just allocated functionally making it non-overcommit? No. If it were an "non-overcomitting malloc", it would return NULL and set errno to ENOMEM, instead of dumping core. DES -- Dag-Erling

Re: Overcommit and calloc()

1999-07-19 Thread Dan Nelson
In the last episode (Jul 19), Dag-Erling Smorgrav said: "Kelly Yancey" [EMAIL PROTECTED] writes: Ahh...but wouldn't the bzero() touch all of the memory just allocated functionally making it non-overcommit? No. If it were an "non-overcomitting malloc", it would return NULL and set errno

RE: Overcommit and calloc()

1999-07-19 Thread Kelly Yancey
-Original Message- From: Dan Nelson [mailto:[EMAIL PROTECTED]] Sent: Monday, July 19, 1999 12:55 PM To: Dag-Erling Smorgrav Cc: Kelly Yancey; [EMAIL PROTECTED] Subject: Re: Overcommit and calloc() In the last episode (Jul 19), Dag-Erling Smorgrav said: "Kelly Yancey&qu

RE: Overcommit and calloc()

1999-07-19 Thread Charles Randall
From: Kelly Yancey [mailto:[EMAIL PROTECTED]] I have another post on this list which begs the question: if memory given to us fro sbrk() is already zeroed, why zero it again if we don't have too if we make calloc() smarter, we could save come clock cycles. Because the memory returned from

Re: RE: Overcommit and calloc()

1999-07-19 Thread Matthew Dillon
:From: Kelly Yancey [mailto:[EMAIL PROTECTED]] :I have another post on this list which begs the question: if memory given :to us fro sbrk() is already zeroed, why zero it again if we don't have :too if we make calloc() smarter, we could save come clock cycles. : :Because the memory returned

Overcommit and calloc()

1999-07-19 Thread Kelly Yancey
On the other hand, I find the discussion about the merits of overcommit and the (albeit not always in-depth) explanations of the FreeBSD VM system educational. It would be nice if would could just extract the small amount of signal from this discussion and put it into documentation

Re: Overcommit and calloc()

1999-07-19 Thread Dag-Erling Smorgrav
Kelly Yancey kby...@alcnet.com writes: I'm afraid my question got lost amongst the see of overcommit messages. :) I was curious if calloc() was overcommitted also? Here's our calloc() implementation: void * calloc(num, size) size_t num; register size_t size; {

RE: Overcommit and calloc()

1999-07-19 Thread Kelly Yancey
://www.freebsd.org/ Join Team FreeBSD - http://www.posi.net/freebsd/Team-FreeBSD -Original Message- From: Dag-Erling Smorgrav [mailto:d...@flood.ping.uio.no] Sent: Monday, July 19, 1999 12:07 PM To: Kelly Yancey Cc: hack...@freebsd.org Subject: Re: Overcommit and calloc() Kelly

Re: Overcommit and calloc()

1999-07-19 Thread Dag-Erling Smorgrav
Kelly Yancey kby...@alcnet.com writes: Ahh...but wouldn't the bzero() touch all of the memory just allocated functionally making it non-overcommit? No. If it were an non-overcomitting malloc, it would return NULL and set errno to ENOMEM, instead of dumping core. DES -- Dag-Erling Smorgrav -

Re: Overcommit and calloc()

1999-07-19 Thread Dan Nelson
In the last episode (Jul 19), Dag-Erling Smorgrav said: Kelly Yancey kby...@alcnet.com writes: Ahh...but wouldn't the bzero() touch all of the memory just allocated functionally making it non-overcommit? No. If it were an non-overcomitting malloc, it would return NULL and set errno to

RE: Overcommit and calloc()

1999-07-19 Thread Kelly Yancey
-Original Message- From: Dag-Erling Smorgrav [mailto:d...@flood.ping.uio.no] Sent: Monday, July 19, 1999 12:39 PM To: Kelly Yancey Cc: Dag-Erling Smorgrav; freebsd-hackers@freebsd.org Subject: Re: Overcommit and calloc() Kelly Yancey kby...@alcnet.com writes: Ahh

RE: Overcommit and calloc()

1999-07-19 Thread Kelly Yancey
-Original Message- From: Dan Nelson [mailto:dnel...@emsphone.com] Sent: Monday, July 19, 1999 12:55 PM To: Dag-Erling Smorgrav Cc: Kelly Yancey; freebsd-hackers@FreeBSD.ORG Subject: Re: Overcommit and calloc() In the last episode (Jul 19), Dag-Erling Smorgrav said: Kelly Yancey

RE: Overcommit and calloc()

1999-07-19 Thread Charles Randall
From: Kelly Yancey [mailto:kby...@alcnet.com] I have another post on this list which begs the question: if memory given to us fro sbrk() is already zeroed, why zero it again if we don't have too if we make calloc() smarter, we could save come clock cycles. Because the memory returned from

Re: RE: Overcommit and calloc()

1999-07-19 Thread Matthew Dillon
:From: Kelly Yancey [mailto:kby...@alcnet.com] :I have another post on this list which begs the question: if memory given :to us fro sbrk() is already zeroed, why zero it again if we don't have :too if we make calloc() smarter, we could save come clock cycles. : :Because the memory returned