From owner-freebsd-current Mon Jul 1 0:20:15 2002 Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 13AFC37B400 for ; Mon, 1 Jul 2002 00:20:08 -0700 (PDT) Received: from rwcrmhc52.attbi.com (rwcrmhc52.attbi.com [216.148.227.88]) by mx1.FreeBSD.org (Postfix) with ESMTP id BE0B943E09 for ; Mon, 1 Jul 2002 00:20:07 -0700 (PDT) (envelope-from julian@elischer.org) Received: from InterJet.elischer.org ([12.232.206.8]) by rwcrmhc52.attbi.com (InterMail vM.4.01.03.27 201-229-121-127-20010626) with ESMTP id <20020701072007.NYFD8262.rwcrmhc52.attbi.com@InterJet.elischer.org> for ; Mon, 1 Jul 2002 07:20:07 +0000 Received: from localhost (localhost.elischer.org [127.0.0.1]) by InterJet.elischer.org (8.9.1a/8.9.1) with ESMTP id AAA89195 for ; Mon, 1 Jul 2002 00:09:20 -0700 (PDT) Date: Mon, 1 Jul 2002 00:09:19 -0700 (PDT) From: Julian Elischer To: FreeBSD current users Subject: UMA question.. Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG 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