From owner-freebsd-arch@FreeBSD.ORG Mon May 21 08:48:43 2007 Return-Path: X-Original-To: arch@freebsd.org Delivered-To: freebsd-arch@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5F6BF16A469 for ; Mon, 21 May 2007 08:48:43 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from mu-out-0910.google.com (mu-out-0910.google.com [209.85.134.188]) by mx1.freebsd.org (Postfix) with ESMTP id E26B113C4B0 for ; Mon, 21 May 2007 08:48:42 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: by mu-out-0910.google.com with SMTP id w8so960096mue for ; Mon, 21 May 2007 01:48:39 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:reply-to:user-agent:mime-version:to:cc:subject:references:in-reply-to:content-type:content-transfer-encoding:sender; b=Ic6sVlWtlqOUMb7LkdAFbtr3tdzuhdxXvYuloTPBEBzatzQ3e+aD8WQmxPcYn19yJUKAiKKWpdFymu1kBD9jlkIuYKmt8UfkB5aJE8fGKlgYqCQGqfr+iJ93QOO/Oqi40TFzTS9E6RkbI4y4485dAR1acDVVW9LlG/RhSATgDIw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:reply-to:user-agent:mime-version:to:cc:subject:references:in-reply-to:content-type:content-transfer-encoding:sender; b=iQnJEKfpspFf+lz9HGKBJqpFRmJujipmmRxvGwpAYYTBwAuzWxB3A/fzk0nEhDgOXt6M9CQozfrkOZdVAYr3//H5MD5YTORH1DRIpzTNW06LWsoRgSa7r3xr+myVJOQwCWABU3QIUyD1L7AWd/c4ARkFzM5B6fGIrdEDIJkSGps= Received: by 10.82.176.3 with SMTP id y3mr8126383bue.1179737319234; Mon, 21 May 2007 01:48:39 -0700 (PDT) Received: from ?172.31.5.25? ( [89.97.252.178]) by mx.google.com with ESMTP id z34sm133543ikz.2007.05.21.01.48.37; Mon, 21 May 2007 01:48:38 -0700 (PDT) Message-ID: <4651CE2F.8080908@FreeBSD.org> Date: Mon, 21 May 2007 18:51:59 +0200 From: Attilio Rao User-Agent: Thunderbird 1.5 (X11/20060526) MIME-Version: 1.0 To: attilio@FreeBSD.org References: <20070520155103.K632@10.0.0.1> <20070521113648.F86217@besplex.bde.org> <20070520213132.K632@10.0.0.1> <4651CAB8.8070007@FreeBSD.org> In-Reply-To: <4651CAB8.8070007@FreeBSD.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Sender: Attilio Rao Cc: arch@freebsd.org, Bruce Evans Subject: Re: sched_lock && thread_lock() X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: attilio@FreeBSD.org List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 May 2007 08:48:43 -0000 Attilio Rao wrote: > Jeff Roberson wrote: >> >> On Mon, 21 May 2007, Bruce Evans wrote: >> >>> On Sun, 20 May 2007, Jeff Roberson wrote: >>> >>>> Attilio and I have been working on addressing the increasing problem >>>> of sched_lock contention on -CURRENT. Attilio has been addressing >>>> the parts of the kernel which do not need to fall under the >>>> scheduler lock and moving them into seperate locks. For example, >>>> the ldt/gdt lock and clock lock which were committed earlier. Also, >>>> using atomics for the vmcnt structure. >>> >>> Using atomics in the vmmeter struct is mostly just a pessimization and >>> and obfuscation, since locks are still needed for accesses to more >>> than one variable at a time. For these cases, locks are needed for >> >> You are right, there are some cases which this pessimized. I wanted >> to make sure the cnt members that previously were protected by the >> sched_lock were still correct. However, I overlooked some of these >> which were accessed many at a time. What should happen is we should >> find out if any locks do protect the remaining members and if so, >> don't use VMCNT*, but mark the header describing how they are protected. > > Sorry, but I strongly disagree. Ah, and about consistency of functions your previously described, I assume nothing vital is linked to it. vmmeter is just a statistics collector and nothing else, so I don't expect nothing critical/vital happens from its fields (I'm sure a lot of variables are just bumped up and never decreased, for example). If that really happens we should fix that behaviour really, instead than making things a lot heavier. Thanks, Attilio