Re: user malloc from kernel

From: Brian O'Shea (b_oshea_at_yahoo.com)
Date: 09/30/03

  • Next message: Sergey Babkin: "Re: has anyone installed 5.1 from a SCSI CD?"
    Date: Mon, 29 Sep 2003 17:04:05 -0700 (PDT)
    To: Peter Pentchev <roam@ringlet.net>, Pawel Jakub Dawidek <nick@garage.freebsd.pl>
    
    

    --- Peter Pentchev <roam@ringlet.net> wrote:
    > > Here you got sample kernel module which do this:
    > >
    > > http://garage.freebsd.pl/usmalloc.tgz
    > > http://garage.freebsd.pl/usmalloc.README
    >
    > Errrr... but won't this interfere *badly* with userland programs
    > which attempt to allocate memory after making the syscall in question?

    Couldn't the user library interface to this new system call just
    malloc() the memory first in the process, and then pass the pointer
    and size to the kernel via the system call interface? This would
    ensure that malloc() doesn't touch the desired range of memory until
    it is freed by the user. You'd just have to be careful not to free
    it until the kernel is done with it.

    -brian

    __________________________________
    Do you Yahoo!?
    Yahoo! SiteBuilder - Free, easy-to-use web site design software
    http://sitebuilder.yahoo.com
    _______________________________________________
    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: Sergey Babkin: "Re: has anyone installed 5.1 from a SCSI CD?"

    Relevant Pages

    • Thank You -- Thomas J. Gritzan
      ... Thomas -- Your suggestion to malloc() out a block of memory was the ... Below are some details of my memory issues ... ... As a work around solution I guessed a ram disk would solve the ... persistence will frustrate the off topic police and give them a target ...
      (comp.lang.c)
    • Re: Simple question about headers and malloc!
      ... Therefore I am making all of its declarations ... memory (using malloc) and then exit back to main. ... allocation, I get data strored from the second allocation... ...
      (microsoft.public.vc.language)
    • Re: ten thousand small processes
      ... Stack needs to be executable for the current signal trampoline ... the use of malloc() that is causing your primary ... if there is any heap memory in use at all, no matter what you do, ... either directly, as a 4M page mapping (not used for user processes, ...
      (freebsd-performance)
    • Re: xmalloc string functions
      ... caller that fact like I do when malloc() fails to delever me the ... amount of memory I ask it for. ... There is nothing that requires an abort() or exit() abnormally. ...
      (comp.lang.c)
    • Re: Review: My C FAQ Page
      ... the definition of memory leak is good but the information on ... this is not the most efficient way to allocate the 2-d array. ... You have ROW+1 calls to malloc. ... Allocate ROW pointers. ...
      (comp.lang.c)