Re: Fw: Priority Increasing

From: Coleman Kane (zombyfork_at_gmail.com)
Date: 02/28/05

  • Next message: David Schultz: "Re: function prototype of fdrop() and fdrop_locked() in kern_descrip.c"
    Date: Mon, 28 Feb 2005 08:13:48 -0500
    To: Ashwin Chandra <ashcs@ucla.edu>
    
    

    On Sun, 27 Feb 2005 20:56:03 -0800, Ashwin Chandra <ashcs@ucla.edu> wrote:
    > The forkbomb program I wrote is just one parent that forks 750 or so
    > children that each malloc around 40 MB's of memory and do a mem traversal
    > through it. The children do not fork. I see the overhead of forking could
    > be
    > causing this, but shouldn't there be some difference in the load of the
    > system when each forkbomb process is set to the lowest priority? To fork
    > 750
    > processes would incur overhead until those processes are created (Which
    > shouldnt take much of real time) and once they are running, if they other
    > processes that have already been created are running "nicely", I don't see
    > why there is so much overhead too.
    >

    You are talking about malloc'ing almost 30GB of memory and having 750
    readers paw through it to search for something. That is a lot of
    swap-backed memory. You are probably experiencing swap thrashing from
    all of this memory access/usage. Might I ask why this needs to be done
    750 times in parallel? If you are trying to be efficient, try only
    forking off readers for each CPU, and waiting until they finish before
    you start anew. You also won't be swapping so much information to
    disk, which will make your program run alot faster than the method you
    are using.

    That is, of course, unless you actually do have > 30GB RAM. In that
    case, I am way off, but you may want to reduce the number of procs
    anyhow.

    > Do you recommend anotoher way to solve this forkbomb problem and keep the
    > system DoS free for others?
    > Ash
    >

    Also, this isn't really a forkbomb, as you seem to have a limit
    instituted on the number of forks. In a traditional fork-bomb, the
    forkers fork themselves, and so on, and so on, ....

    --
    coleman kane
    _______________________________________________
    freebsd-hackers@freebsd.org mailing list
    http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
    To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org"
    

  • Next message: David Schultz: "Re: function prototype of fdrop() and fdrop_locked() in kern_descrip.c"

    Relevant Pages

    • Re: New Patch Fixes 43 Flaws In OS X, Many Serious
      ... Windows does not also do. ... You cannot handle all errors from fork(); ... swap space, forkwill not signal an error, but instead your Unix ... will start terminating processes to free memory. ...
      (comp.sys.mac.advocacy)
    • Re: [rfc] balance-on-fork NUMA placement
      ... course will leave the memory behind...), but it does give a bit more ... We certainly used to copy all page tables on fork. ... the NUMA scheduler, and every time we decide it's a bad idea. ... cycle slower, not faster, so exec is generally a much better time to do ...
      (Linux-Kernel)
    • Re: New Patch Fixes 43 Flaws In OS X, Many Serious
      ... so I demand you disprove them". ... You cannot handle all errors from fork(); ... swap space, forkwill not signal an error, but instead your Unix ... will start terminating processes to free memory. ...
      (comp.sys.mac.advocacy)
    • Re: SCO spending lots of time in spin locks
      ... At this point I have seen same effect within scall/s, ... Explanation below from man pages (as you have ... Application memory pages has paged to disk and now the ... Fork uses COW: When application calls forkdata pages are actually ...
      (comp.unix.sco.programmer)
    • Re: Two Console Communication (again)
      ... > Frank Kotler wrote: ... An execed process gets a whole new memory space, ... Most implementations of fork use copy-on-write ... > tell the kernel not to make that copy even when memory is ...
      (alt.lang.asm)