From owner-freebsd-hackers@FreeBSD.ORG Thu Jun 30 13:00:06 2005 Return-Path: X-Original-To: hackers@FreeBSD.org Delivered-To: freebsd-hackers@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id DAF5A16A41C; Thu, 30 Jun 2005 13:00:06 +0000 (GMT) (envelope-from andrit@ukr.net) Received: from kitty.ukr.net (kitty.ukr.net [212.42.65.67]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7E09843D48; Thu, 30 Jun 2005 13:00:04 +0000 (GMT) (envelope-from andrit@ukr.net) Received: from dialup-146.209.sitel.com.ua ([217.27.146.209] helo=ertpc) by kitty.ukr.net with smtp ID 1Dnye9-000CAH-HL ; Thu, 30 Jun 2005 16:00:02 +0300 Message-ID: <007501c57d73$9ba574b0$d1921bd9@ertpc> From: "ant" To: "Jeff Roberson" , "Robert Watson" References: <000d01c57cf7$b9b6f9f0$29931bd9@ertpc> <20050629234429.A87930@fledge.watson.org> <20050629203638.V12343@10.0.0.1> Date: Thu, 30 Jun 2005 15:52:39 +0300 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2600.0000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 Cc: jeff@FreeBSD.org, hackers@FreeBSD.org, bmilekic@FreeBSD.org Subject: Re: hot path optimizations in uma_zalloc() & uma_zfree() X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Jun 2005 13:00:07 -0000 > Do you keep two buckets still? If so, this is something that I've always > intended to do, but never got around to. I'm glad someone has taken the > initiative. Will review the patch shortly. yes, shure. Linux keeps only one array, that is 2 times large of bucket and it copies half of this array from or to buckets. The positive effect of this, that in balanced allocs & frees (and when number of allocs or frees in one iteration is not larger than bucket size) they will deal only with one array without some switches. In our case, there may be balanced situations, when we will have continuousely switching between buckets. Anyway, the drawback of linux approach is the copy operation. In more general cases i suppose it will be slower. Anyway we still need 2 buckets, else insted of switching between them we will have thrashing in switching between our bucket and full or free zone's list, which must be made with zone's locking. -- Andriy Tkachuk.