From owner-freebsd-current@FreeBSD.ORG Fri Nov 18 13:51:31 2011 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7F303106566B; Fri, 18 Nov 2011 13:51:31 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from mail-ey0-f182.google.com (mail-ey0-f182.google.com [209.85.215.182]) by mx1.freebsd.org (Postfix) with ESMTP id 7179D8FC08; Fri, 18 Nov 2011 13:51:30 +0000 (UTC) Received: by eyd10 with SMTP id 10so4742922eyd.13 for ; Fri, 18 Nov 2011 05:51:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=Thoi2ZrHlQGgs2CJ4fusDoGwpaAS1ht7IZtaOttUUuI=; b=qgFg5/ByLgpq/xXdN3qz4g28W+mDfYCeTBdGzyg1+1sRl4yCXSwnGU8XUFy09aKYC2 eNAUrk2wPBtkIsq8XUUmzkdG/jrVD/6cl5SFr8uVz8fPuc+VLe46ZCfcP2tmcstOn0lW TBZFQKtFflqSfghHDfOSY1ZHBLq7Czw5aUCQw= MIME-Version: 1.0 Received: by 10.180.109.106 with SMTP id hr10mr4277431wib.9.1321624289015; Fri, 18 Nov 2011 05:51:29 -0800 (PST) Sender: asmrookie@gmail.com Received: by 10.216.85.8 with HTTP; Fri, 18 Nov 2011 05:51:28 -0800 (PST) In-Reply-To: References: <20111105141306.GW50300@deviant.kiev.zoral.com.ua> <20111105151530.GX50300@deviant.kiev.zoral.com.ua> <4EB595FA.4020500@rice.edu> <20111106124331.GP50300@deviant.kiev.zoral.com.ua> <4EB81942.70501@rice.edu> <20111107193516.GA50300@deviant.kiev.zoral.com.ua> <20111116084542.GY50300@deviant.kiev.zoral.com.ua> <20111118105224.GB50300@deviant.kiev.zoral.com.ua> Date: Fri, 18 Nov 2011 14:51:28 +0100 X-Google-Sender-Auth: rNJ_m3f2i2bLYkDrt9AI_g3It_k Message-ID: From: Attilio Rao To: Kostik Belousov Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: mdf@freebsd.org, "K. Macy" , Alan Cox , Andriy Gapon , freebsd-current@freebsd.org, Benjamin Kaduk , Penta Upa Subject: Re: vm_page_t related KBI [Was: Re: panic at vm_page_wire with FreeBSD 9.0 Beta 3] X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Nov 2011 13:51:31 -0000 2011/11/18 Attilio Rao : > 2011/11/18 Kostik Belousov : >> On Fri, Nov 18, 2011 at 11:40:28AM +0100, Attilio Rao wrote: >>> 2011/11/16 Kostik Belousov : >>> > On Tue, Nov 15, 2011 at 07:15:01PM +0100, Attilio Rao wrote: >>> >> 2011/11/7 Kostik Belousov : >>> >> > On Mon, Nov 07, 2011 at 11:45:38AM -0600, Alan Cox wrote: >>> >> >> Ok. =C2=A0I'll offer one final suggestion. =C2=A0Please consider = an alternative >>> >> >> suffix to "func". =C2=A0Perhaps, "kbi" or "KBI". =C2=A0In other w= ords, something >>> >> >> that hints at the function's reason for existing. >>> >> > >>> >> > Sure. Below is the extraction of only vm_page_lock() bits, togethe= r >>> >> > with the suggested rename. When Attilio provides the promised simp= lification >>> >> > of the mutex KPI, this can be reduced. >>> >> >>> >> My tentative patch is here: >>> >> http://www.freebsd.org/~attilio/mutexfileline.patch >>> >> >>> >> I need to make more compile testing later, but it already compiles >>> >> GENERIC + modules fine on HEAD. >>> >> >>> >> The patch provides a common entrypoint, option independent, for both >>> >> fast case and debug/compat case. >>> >> Additively, it almost entirely fixes the standard violation of the >>> >> reserved namespace, as you described (the notable exception being th= e >>> >> macro used in the fast path, that I want to fix as well, but in a >>> >> separate commit). >>> >> >>> >> Now the file/line couplet can be passed to the "_" suffix variant of >>> >> the flag functions. >>> > Yes, this is exactly KPI that I would use when available for the >>> > vm_page_lock() patch. >>> > >>> >> >>> >> eadler@ reviewed the mutex.h comment. >>> >> >>> >> Please let me know what you think about it, as long as we agree on t= he >>> >> patch I'll commit it. >>> > But I also agree with John that imposing large churn due to the elimi= nation >>> > of the '__' prefix is too late now. At least it will make the change >>> > non-MFCable. Besides, we already lived with the names for 10+ years. >>> > >>> > I will be happy to have the part of the patch that exports the mtx_XX= X_(mtx, >>> > file, line) defines which can be used without taking care of LOCK_DEB= UG >>> > or MUTEX_NOINLINE in the consumer code. >>> >>> Ok, this patch should just add the compat stub: >>> http://www.freebsd.org/~attilio/mutexfileline2.patch >> Am I right that I would use mtx_lock_(mtx, file, line) etc ? >> If yes, I am fine with it. > > Yes that is correct. > > However, I'm a bit confused on one aspect: would you mind using > _mtx_lock_flags() instead? > If you don't mind the "underscore namespace violation" I think I can > make a much smaller patch against HEAD for it. > > Otherwise, the one now posted should be ok. After thinking more about it, I think that is basically the shorter version I can came up with. Please consider: http://www.freebsd.org/~attilio/mutexfileline2.patch as a possible commit candidate for me. Attilio --=20 Peace can only be achieved by understanding - A. Einstein