From owner-freebsd-arch@FreeBSD.ORG Thu May 24 14:30:31 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 4CEF216A41F for ; Thu, 24 May 2007 14:30:31 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from ug-out-1314.google.com (ug-out-1314.google.com [66.249.92.169]) by mx1.freebsd.org (Postfix) with ESMTP id 9BDF313C458 for ; Thu, 24 May 2007 14:30:30 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: by ug-out-1314.google.com with SMTP id u2so53131uge for ; Thu, 24 May 2007 07:30:29 -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=JII7lSrENS/GB+BPTS93jO3jehHoMO3b9BQli98LnTIW9NTpZFEScYGSOZ0Vo33DLbKej9Y8yS4qU07yshOhdTtjZq77fppztztGRdQlRYJXI7ObrelDMXUelyEB/3s/DdbL+ibCGZYkQNx3f7JXXJnylRWKWGT5DBcLlg04F+E= 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=s/yjfdTKAy3pooprUJXNmFna/+XDMh+ObHx/0FU/vRDP+R+viynHRhFN9k30R/jjGsvv9izKRZEPGkZJ66E6N43+26Maua271n0Alg1q4CcRw71CTK8Koc+slCg8Qvaceo1rdE5uXYzH3axnRhOA6yZl3I1Q4Y/cntLmKGicd2I= Received: by 10.82.191.3 with SMTP id o3mr3390477buf.1180017027232; Thu, 24 May 2007 07:30:27 -0700 (PDT) Received: from ?172.31.5.25? ( [89.97.252.178]) by mx.google.com with ESMTP id b33sm2584703ika.2007.05.24.07.30.24; Thu, 24 May 2007 07:30:26 -0700 (PDT) Message-ID: <465612C4.3040400@FreeBSD.org> Date: Fri, 25 May 2007 00:33:40 +0200 From: Attilio Rao User-Agent: Thunderbird 1.5 (X11/20060526) MIME-Version: 1.0 To: Alan Cox References: <20070520155103.K632@10.0.0.1> <20070521113648.F86217@besplex.bde.org> <20070520213132.K632@10.0.0.1> <4651CAB8.8070007@FreeBSD.org> <4651CE2F.8080908@FreeBSD.org> <20070521022847.D679@10.0.0.1> <20070521195811.G56785@delplex.bde.org> <4651FCB5.7070604@FreeBSD.org> <20070521225032.C57233@delplex.bde.org> <20070522162819.N5249@besplex.bde.org> <20070522201336.C87981@besplex.bde.org> <46533CAD.8030104@FreeBSD.org> <4655C67A.9060000@FreeBSD.org> <46558E43.8040608@cs.rice.edu> In-Reply-To: <46558E43.8040608@cs.rice.edu> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Sender: Attilio Rao Cc: alc@freebsd.org, arch@freebsd.org, Jeff Roberson , 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: Thu, 24 May 2007 14:30:31 -0000 Alan Cox wrote: > Attilio Rao wrote: > >> Attilio Rao wrote: >> >>> Bruce Evans wrote: >>> >>>> 4 more translation errors breaking 8 counters altogether (v_vnodepgsin >>>> is broken twice): >>> >>> >>> Thanks a lot for the revision, there will be a pending patch in the >>> next hour. >> >> >> Hello, >> Let me know if this patch is right for you and if you have feedbacks, >> comments, etc: >> http://users.gufi.org/~rookie/works/patches/schedlock/vmmeter3.diff >> >> This should fix translation errors Bruce has found and switching the >> _SET() method in order to being a simple assignment (as Bruce has >> suggested). > > > Let me offer a simple rule of thumb for VMCNT_ADD() vs. PCPU_LAZY_INC(): > If the field is NOT under the section labeled "Distribution of page > usages." in vmmeter, then PCPU_LAZY_INC() is preferable to VMCNT_ADD() > implemented with an atomic op. Ok, I've updated the patch following your suggestion. I just left out that vmmeter fields which needs to be incremented not by one but by another value (since PCPU_LAZY_INC() just increments by 1). Do you think it is more appropriate to expand the PCPU_LAZY_*() interface and let it cover increments not by 1 too? It would let grow the patch notably since we need to touch all architectures for that however... Thanks, Attilio