Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 1 Jul 2002 00:09:19 -0700 (PDT)
From:      Julian Elischer <julian@elischer.org>
To:        FreeBSD current users <current@FreeBSD.ORG>
Subject:   UMA question..
Message-ID:  <Pine.BSF.4.21.0206302359290.88707-100000@InterJet.elischer.org>

next in thread | raw e-mail | index | archive | help

Jeff , (current included because it may  be an interesting answer)


As you know I'm using UMA to allocate threads and cache them.
The 'constructor methods allow me to allocated threads that have been
pre-set up with thread stacks and other special items.


When they are being cached they still have their stacks etc. attached to
them. These are only splitt off when the UMA decides to stop caching an
item and actualy return it's memory to the system.
In this regard the UMA allocator is not a memory alocator but a 'complex
object allocator'... Very cool.

Now my question..

I ant to allocate proc structures the same way...
in other words, I want a cached proc structure to already have a thread
attached to it and a stack attached to the thread..
Is it legal for teh init function which is called by UMA to in turn 
call UMA to allocate a sub element..

so if I do uma_zalloc(proc args)
that in turn should do a  uma_zalloc(thread args).
would this work? is it legal?

I need to allocate extra threads independantly of processes, but I could
work it so that freed process structures always  had a single thread left
on them, which would save on allocations..
In the future I need to do teh same for KSEs and KSEGRPS. sp having
UMA cache pre-constructed complex items made up of groups of separatly
UMA-allocated objects would be a great saving..

the question is.. will it work? can I call UMA from withing a UMA
constructor?



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.21.0206302359290.88707-100000>