From owner-cvs-all@FreeBSD.ORG Mon Dec 17 13:29:45 2007 Return-Path: Delivered-To: cvs-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EFED516A46B for ; Mon, 17 Dec 2007 13:29:45 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from mu-out-0910.google.com (mu-out-0910.google.com [209.85.134.189]) by mx1.freebsd.org (Postfix) with ESMTP id 4FB0F13C458 for ; Mon, 17 Dec 2007 13:29:45 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: by mu-out-0910.google.com with SMTP id i10so3333025mue.3 for ; Mon, 17 Dec 2007 05:29:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:sender:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references:x-google-sender-auth; bh=8EoJtgutQyQyPx2SX3JSafNKib0QpuhPEGRIVYZo5z8=; b=gJgxfqVMqO+1Uins4vivS+he7BOljmDtFLw1vg0xA9Oj1rf2feAqK37KscMagkEIUoJH+xx4VoPfYsopCR/H+DvGJ0WnUe6TRm8uWpte9XP64shUbQ5y6IBbrG/e6zemiy8dsnE2uMGVw7Vhb2PtJ2rSvvMbqCmigdF1v4DLGDk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:sender:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references:x-google-sender-auth; b=HgKWFXqvFja+eh1u39L3+QD0DMm0IiotOQU+FudTGzT1sS90pIEdu0OWhJcM/I481qYp3ZxtK2Ipr3Yb/c8lMM1uzA+KN8rMJSwNOapjD3NORP7Q61+iPInf/ZiEH2vmtSehuhaSe6Za76RI6Mej/cINZM4qvrEAhrlitq+Sitw= Received: by 10.86.84.5 with SMTP id h5mr6407837fgb.53.1197898183443; Mon, 17 Dec 2007 05:29:43 -0800 (PST) Received: by 10.86.28.19 with HTTP; Mon, 17 Dec 2007 05:29:43 -0800 (PST) Message-ID: <3bbf2fe10712170529h4a383d0eodf460203fa52aba3@mail.gmail.com> Date: Mon, 17 Dec 2007 14:29:43 +0100 From: "Attilio Rao" Sender: asmrookie@gmail.com To: "Jeff Roberson" In-Reply-To: <20071215132041.D922@desktop> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <200712152313.lBFNDWWR060641@repoman.freebsd.org> <20071215132041.D922@desktop> X-Google-Sender-Auth: 2afc0f2f742fe32f Cc: cvs-src@freebsd.org, Jeff Roberson , src-committers@freebsd.org, cvs-all@freebsd.org Subject: Re: cvs commit: src/sys/conf options src/sys/kern kern_mutex.c kern_rwlock.c kern_sx.c kern_thread.c sched_4bsd.c sched_ule.c subr_lock.c src/sys/sys _lock.h lock_profile.h proc.h sx.h X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.5 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: Mon, 17 Dec 2007 13:29:46 -0000 2007/12/16, Jeff Roberson : > On Sat, 15 Dec 2007, Jeff Roberson wrote: > > > jeff 2007-12-15 23:13:32 UTC > > > > FreeBSD src repository > > > > Modified files: > > sys/conf options > > sys/kern kern_mutex.c kern_rwlock.c kern_sx.c > > kern_thread.c sched_4bsd.c sched_ule.c > > subr_lock.c > > sys/sys _lock.h lock_profile.h proc.h sx.h > > Some of you may complain about the inclusion of lock_profile.h in > sys/proc.h. I hope you will forgive this since lock profiling now no > longer disturbs the ABI and will work with binary modules as well. Hello, +void +lock_profile_obtain_lock_success(struct lock_object *lo, int contested, + uint64_t waittime, const char *file, int line) +{ + static int lock_prof_count; + struct lock_profile_object *l; + int spin; + + /* don't reset the timer when/if recursing */ + if (!lock_prof_enable || (lo->lo_flags & LO_NOPROFILE)) + return; + if (lock_prof_skipcount && + (++lock_prof_count % lock_prof_skipcount) == 0) + return; + spin = LOCK_CLASS(lo) == &lock_class_mtx_spin; + if (spin && lock_prof_skipspin == 1) + return; I would really like to get ride of this kind of checks against lock_class_* objects. The correct thing to do here is to check for the LC_SPINLOCK in the class flags (this is exactly why they have been introduced I think). I have a question though. Does this new implementation track adaptive spinning in locks? I would have expected a different function for something like that as "lock_profile_obtain_lock_spinning()" or similar in order to track both spinning and sleeping times about the same locks, but looking at function prototypes, at consumers and looking at members of struct lock_prof I don't see any obvious evidence of it. Thanks for this work, I really like that our ABI is no longer broken :) Attilio -- Peace can only be achieved by understanding - A. Einstein