[haiku-development] Re: Writing Device Drivers - CRAM - Problem Malloc()

  • From: Earl Pottinger <earl_colby_pottinger@xxxxxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Mon, 22 Aug 2011 13:06:41 -0700 (PDT)

My reply to you got cut off, I hope this goes thru.


> Ingo Weinhold wrote:
> Assuming that the question was referring to a driver context, I have to add 
> that it is not advisable to do allocations of that order of magnitude.

This is not what my base design is expected to use. 64-256MB is my usual size 
for the internal array.  But to test the code for faults I was pushing the 
limits to find my mistakes in coding this driver.  I already found other bugs 
to fix from pushing beyond reasonable parameters in the past.
 
> Exhausting the kernel address space can lead to the kernel no longer being 
> able to allocate memory for essential tasks, which will cause the system to 
> go down the drain.

Noted.

> To prevent that all caches implemented in kernelland (at 
> least all caches of relevant size) should register as low resource handlers 
> and free up resources, when requested.

Sorry, I don't know how to do this properly .  Could you give me a hint or two 
as to where to find sample code please?


Other related posts: