From owner-cvs-all@FreeBSD.ORG Sat Apr 30 01:54:25 2005 Return-Path: Delivered-To: cvs-all@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5128A16A4CE; Sat, 30 Apr 2005 01:54:25 +0000 (GMT) Received: from mail.chesapeake.net (chesapeake.net [208.142.252.6]) by mx1.FreeBSD.org (Postfix) with ESMTP id BDA9B43D1F; Sat, 30 Apr 2005 01:54:24 +0000 (GMT) (envelope-from jroberson@chesapeake.net) Received: from mail.chesapeake.net (localhost [127.0.0.1]) by mail.chesapeake.net (8.12.10/8.12.10) with ESMTP id j3U1sN1h083606; Fri, 29 Apr 2005 21:54:23 -0400 (EDT) (envelope-from jroberson@chesapeake.net) Received: from localhost (jroberson@localhost)j3U1sN2X083602; Fri, 29 Apr 2005 21:54:23 -0400 (EDT) (envelope-from jroberson@chesapeake.net) X-Authentication-Warning: mail.chesapeake.net: jroberson owned process doing -bs Date: Fri, 29 Apr 2005 21:54:23 -0400 (EDT) From: Jeff Roberson To: Robert Watson In-Reply-To: <200504291856.j3TIuapc077941@repoman.freebsd.org> Message-ID: <20050429215256.E5127@mail.chesapeake.net> References: <200504291856.j3TIuapc077941@repoman.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: cvs-src@FreeBSD.org cc: src-committers@FreeBSD.org cc: cvs-all@FreeBSD.org Subject: Re: cvs commit: src/sys/vm uma_core.c uma_int.h X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Apr 2005 01:54:25 -0000 On Fri, 29 Apr 2005, Robert Watson wrote: > rwatson 2005-04-29 18:56:36 UTC > > FreeBSD src repository > > Modified files: > sys/vm uma_core.c uma_int.h > Log: > Modify UMA to use critical sections to protect per-CPU caches, rather than > mutexes, which offers lower overhead on both UP and SMP. When allocating > from or freeing to the per-cpu cache, without INVARIANTS enabled, we now > no longer perform any mutex operations, which offers a 1%-3% performance > improvement in a variety of micro-benchmarks. We rely on critical > sections to prevent (a) preemption resulting in reentrant access to UMA on > a single CPU, and (b) migration of the thread during access. In the event > we need to go back to the zone for a new bucket, we release the critical > section to acquire the global zone mutex, and must re-acquire the critical > section and re-evaluate which cache we are accessing in case migration has > occured, or circumstances have changed in the current cache. Excellent work. thanks. You could also use sched_pin() in uma_zalloc to prevent migration so you can be certain that you're still accessing the same cache. You wont be able to trust the state of that cache. I'm not sure whether or not this would make a difference, but it could be beneificial if we decide to do per-cpu slab lists for locality on NUMA machines. > > Per-CPU cache statistics are now gathered lock-free by the sysctl, which > can result in small races in statistics reporting for caches. > > Reviewed by: bmilekic, jeff (somewhat) > Tested by: rwatson, kris, gnn, scottl, mike at sentex dot net, others > > Revision Changes Path > 1.119 +120 -103 src/sys/vm/uma_core.c > 1.30 +0 -10 src/sys/vm/uma_int.h >