From owner-svn-src-user@FreeBSD.ORG Tue Oct 30 22:59:11 2012 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id CEC736F0; Tue, 30 Oct 2012 22:59:11 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from mail-lb0-f182.google.com (mail-lb0-f182.google.com [209.85.217.182]) by mx1.freebsd.org (Postfix) with ESMTP id 38E368FC0C; Tue, 30 Oct 2012 22:59:09 +0000 (UTC) Received: by mail-lb0-f182.google.com with SMTP id b5so793305lbd.13 for ; Tue, 30 Oct 2012 15:59:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:reply-to:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=YmmG4loKjbpnI4othZnJrizeFrJaZp2oX+8Q1iqkOms=; b=PZDcLD1ZV+teJOwDpfAaqwOVv1Y3tekggFEHmQ6U7IkqSJy9+zmxwxLkAKUbijryvj qyHA6zEItfQlhXKj16mCui+SnaJBy3TqM1OJXMSOgd3AKW4h8nsaFq+y2B1/ebK1vN9N sUgujOFNC5YySMMqZPmwGyAJzgy7KEoplLpeqv1Ughkj+4m6feXzkq0USlB+2mzeNHXu t12Z7M+7JvFfxetr9NIMNT+NDkd2macZa0Y+1BPbmgSDLvxc1+fZ0jFArigzz8xH2hc0 Zx/67xwKa2gYkkDqHAaLXbFv5rg0oyYEajYaNbKz32At/VaHMH511TZe48fS0QcNcuEO 9ebA== MIME-Version: 1.0 Received: by 10.112.26.67 with SMTP id j3mr14147190lbg.39.1351637948573; Tue, 30 Oct 2012 15:59:08 -0700 (PDT) Sender: asmrookie@gmail.com Received: by 10.112.30.37 with HTTP; Tue, 30 Oct 2012 15:59:08 -0700 (PDT) In-Reply-To: <508F9C94.7080703@freebsd.org> References: <201210221418.q9MEINkr026751@svn.freebsd.org> <201210241136.06154.jhb@freebsd.org> <201210241414.30723.jhb@freebsd.org> <508965B3.2020705@freebsd.org> <5089A913.2040603@freebsd.org> <508A89EF.5070805@freebsd.org> <508F9C94.7080703@freebsd.org> Date: Tue, 30 Oct 2012 22:59:08 +0000 X-Google-Sender-Auth: nITuBrsBh8uiJmziyWKIGl4nKzg Message-ID: Subject: Re: svn commit: r241889 - in user/andre/tcp_workqueue/sys: arm/arm cddl/compat/opensolaris/kern cddl/contrib/opensolaris/uts/common/dtrace cddl/contrib/opensolaris/uts/common/fs/zfs ddb dev/acpica dev/... From: Attilio Rao To: Jeff Roberson Content-Type: text/plain; charset=UTF-8 Cc: mdf@freebsd.org, src-committers@freebsd.org, Andre Oppermann , John Baldwin , svn-src-user@freebsd.org, Bruce Evans X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: attilio@FreeBSD.org List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Oct 2012 22:59:12 -0000 On Tue, Oct 30, 2012 at 9:23 AM, Andre Oppermann wrote: > On 30.10.2012 03:25, Attilio Rao wrote: >> >> On Tue, Oct 30, 2012 at 1:38 AM, Attilio Rao wrote: >>> >>> On Sun, Oct 28, 2012 at 5:42 PM, Attilio Rao wrote: >> >> >> [ trimm ] >> >>>> >>>> BTW, the mtx_sysuninit() introduction can be avoided by using this other >>>> trick: >>>> #define MTX_SYSINIT(name, mtx, desc, opts) >>>> \ >>>> static struct mtx_args name##_args = { >>>> \ >>>> (mtx), >>>> \ >>>> (desc), >>>> \ >>>> (opts) >>>> \ >>>> }; >>>> \ >>>> SYSINIT(name##_mtx_sysinit, SI_SUB_LOCK, SI_ORDER_MIDDLE, >>>> \ >>>> mtx_sysinit, &name##_args); >>>> \ >>>> SYSUNINIT(name##_mtx_sysuninit, SI_SUB_LOCK, SI_ORDER_MIDDLE, >>>> \ >>>> _mtx_destroy, __DEVOLATILE(void *, &(mtx)->mtx_lock)) >>>> >>>> I'm just not sure that I would like the use of __DEVOLATILE() even if >>>> it would help in this case when introducing MTX_SYSINIT_UNSHARE() >>>> because we will just need to reuse the same code. >>>> >>>> Also, the more I think about this the more I feel convinced that >>>> mtxlock2mtx() should be static in kern_mutex.c. I can simply add a >>>> note to _mutex.h as a reminder for it. >>> >>> >>> Here is the patch that does both things and the one I would like to >>> commit: >>> http://www.freebsd.org/~attilio/mtx_decoupled3.patch >> >> >> BTW, I've updated the patch in order to make use of __containerof() >> rather than the manual frobbing. I had no idea that this method was >> existing, many thanks to andre@ and mdf@ for signaling it. >> Please refresh the patch. > > > Thank you for the updated patch. I have no objections to the patch, > though I'm not really qualified to have a final say on changes to the > mutex code. Jeff has replied privately to me saying that he would have preferred to see altogether also the implementation of padded mutexes along with the mtx decoupling interface. The following patch, does what expected: http://www.freebsd.org/~attilio/mtx_decoupled_padalign.patch I converted a bunch of locks and they work fine even with MTX_SYSINIT() with the small change contained in this patchset, so that doesn't require a separate KPI in the end. The patch is being tested right now and I will commit as soon as I will receive positive feedbacks. Thanks, Attilio -- Peace can only be achieved by understanding - A. Einstein