From owner-freebsd-arch Sat Feb 16 17: 0:33 2002 Delivered-To: freebsd-arch@freebsd.org Received: from rwcrmhc51.attbi.com (rwcrmhc51.attbi.com [204.127.198.38]) by hub.freebsd.org (Postfix) with ESMTP id 8110337B421; Sat, 16 Feb 2002 17:00:14 -0800 (PST) Received: from InterJet.elischer.org ([12.232.206.8]) by rwcrmhc51.attbi.com (InterMail vM.4.01.03.27 201-229-121-127-20010626) with ESMTP id <20020217010013.KMAT2626.rwcrmhc51.attbi.com@InterJet.elischer.org>; Sun, 17 Feb 2002 01:00:13 +0000 Received: from localhost (localhost.elischer.org [127.0.0.1]) by InterJet.elischer.org (8.9.1a/8.9.1) with ESMTP id QAA43282; Sat, 16 Feb 2002 16:49:47 -0800 (PST) Date: Sat, 16 Feb 2002 16:49:45 -0800 (PST) From: Julian Elischer To: Matthew Dillon Cc: Alfred Perlstein , Poul-Henning Kamp , arch@FreeBSD.ORG, jhb@FreeBSD.ORG, peter@wemm.org, jake@locore.ca Subject: Re: gettimeofday() and crhold()/crfree() (was Re: gettimeofday() and copyout(). Is copyout() MPSAFE on non-i386 archs? ) In-Reply-To: <200202162200.g1GM04F39752@apollo.backplane.com> Message-ID: MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="0-1508433265-1013906985=:39539" Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. Send mail to mime@docserver.cac.washington.edu for more info. --0-1508433265-1013906985=:39539 Content-Type: TEXT/PLAIN; charset=US-ASCII the whole point is moot.. you don't need to get or drop the creds at all.. see the attached patch I'm about to commit a version of.. On Sat, 16 Feb 2002, Matthew Dillon wrote: > > :Go ahead with using mutex pools for creds, I thought I'd done it > :already but it looks like I only got to struct file and struct > :uidinfo. :) > : > :I do sort of think that keeping your own cred freelist is probably > :a bad idea especially with what Jeff R has coming down the pipe for > :us. But we can take that out later if something better comes along. > : > :-Alfred > > Well, I dunno... I'm warming to the idea if it in fact eases the job > of pushing Giant down. It seems so easy to do for the ucred, though > of course I am not trying to proactively trim down the size of the > freelist (yet)... but even that would be fairly simple to do in the > allocation code by adding a count of the number of items in the freelist. > > It would be another ten lines of code relative to the patch > I just posted. int cr_free_count; .. in allocation code do > while (cr_free_count > HYSTERESIS) { ... free ... } > > -Matt > Matthew Dillon > > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-arch" in the body of the message > --0-1508433265-1013906985=:39539 Content-Type: TEXT/PLAIN; charset=US-ASCII; name=thediff Content-Transfer-Encoding: BASE64 Content-ID: Content-Description: Content-Disposition: attachment; filename=thediff PyBpMzg2L2NvbmYvTElOVA0KPyBtb2R1bGVzL25ldGdyYXBoL2tzb2NrZXQv bmdfa3NvY2tldC5rbGQNCj8gbW9kdWxlcy9uZXRncmFwaC9rc29ja2V0L25n X2tzb2NrZXQua28NCkluZGV4OiBpMzg2L2kzODYvdHJhcC5jDQo9PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09DQpSQ1MgZmlsZTogL2hvbWUvbmN2cy9zcmMvc3lz L2kzODYvaTM4Ni90cmFwLmMsdg0KcmV0cmlldmluZyByZXZpc2lvbiAxLjIx MQ0KZGlmZiAtdSAtcjEuMjExIHRyYXAuYw0KLS0tIGkzODYvaTM4Ni90cmFw LmMJMTAgSmFuIDIwMDIgMTE6NDk6NTQgLTAwMDAJMS4yMTENCisrKyBpMzg2 L2kzODYvdHJhcC5jCTEzIEZlYiAyMDAyIDAxOjA3OjA3IC0wMDAwDQpAQCAt MjU2LDkgKzI1Niw4IEBADQogCQlzdGlja3MgPSB0ZC0+dGRfa3NlLT5rZV9z dGlja3M7DQogCQl0ZC0+dGRfZnJhbWUgPSAmZnJhbWU7DQogCQlLQVNTRVJU KHRkLT50ZF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