problems with new the "contigmalloc" routine

Peter Jeremy PeterJeremy at optushome.com.au
Fri May 20 22:49:46 GMT 2005


On Fri, 2005-May-20 21:51:34 +0200, Hans Petter Selasky wrote:
>Non-blocking mode has got to be supported. Else you get a nightmare rewriting 
>the code to support blocking mode.

Your code either has to block somewhere or fail.  contigmalloc() only
blocks if it couldn't satisfy the request immediately.  If it returns
to your code, you still have the problem of needing the memory and
not being able to allocate it without blocking.

>Can anyone explain why "uiomove()" has to sleep, and why there is no 
>non-blocking "uiomove()"?

As far as I can see, uiomove() only sleeps if it is asked to do a
kernel<->userland move that takes more than twice a scheduler quantum.
As long as you don't uiomove() ridiculous amounts of data, it should
never sleep.

>Will M_NOWAIT support will be added to "contigmalloc()"?

When someone writes the code to do it.  It's non-trivial to do properly
because the blocking occurs several levels down from contigmalloc() in
routines that themselves don't support M_NOWAIT.  If it's that important
to you, maybe you need to write the code :-).

-- 
Peter Jeremy


More information about the freebsd-hackers mailing list