From owner-freebsd-current@FreeBSD.ORG Sat Aug 24 19:27:44 2013 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 45D8DF43; Sat, 24 Aug 2013 19:27:44 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-we0-x233.google.com (mail-we0-x233.google.com [IPv6:2a00:1450:400c:c03::233]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 7D1402EDF; Sat, 24 Aug 2013 19:27:43 +0000 (UTC) Received: by mail-we0-f179.google.com with SMTP id t58so1550860wes.24 for ; Sat, 24 Aug 2013 12:27:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=oASVWtpePHxaRW5wolnyoKaADXSvTcRcQpdhHiMvE9I=; b=DZrimS/IHtUbxqDEiswgKnX43Z8AszekQqi6s63ngOhMarTUJqNEbRMJ8i9A76EfrU 1rvVo16i7MtsIR5ITL2pvd8pA62vQ9w91hlYt8WBwbGbya745WcHCIvpNsHN4gSJ9EEY SKIO2fmEOqKEIJJhrh0jIw93StsLXBi//3nYJwaYuDXaDpWV4X/iJQ9LE2DSoH0DHF5S 7pbqnrs86r6pWBEbvwDjBzuXb4gN5Wsv2rAWAyQEN7EzB7xLV+9rtAgCfpOXUPdDUDHq 9SuTzbMMWkT3QcX8IsL6Nb8h1bkEUK5Jbg7zpspyxxjllY3+KfKcgaNvfU9Jzbk+7/kH yhyw== MIME-Version: 1.0 X-Received: by 10.180.37.164 with SMTP id z4mr2280515wij.30.1377372461371; Sat, 24 Aug 2013 12:27:41 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.217.116.136 with HTTP; Sat, 24 Aug 2013 12:27:41 -0700 (PDT) In-Reply-To: References: <5218AA36.1080807@ipfw.ru> <5218E108.6090901@mu.org> <5218F803.7000405@mu.org> Date: Sat, 24 Aug 2013 12:27:41 -0700 X-Google-Sender-Auth: 8Si-Hdt8VCA9yYgPAARhc5SYsiI Message-ID: Subject: Re: [rfc] migrate lagg to an rmlock From: Adrian Chadd To: Scott Long Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.14 Cc: FreeBSD Net , Alfred Perlstein , "Robert N. M. Watson" , "Alexander V. Chernikov" , freebsd-current X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.14 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: Sat, 24 Aug 2013 19:27:44 -0000 Hihi, There's two parts to my patch: * one is migrating the rwlock to rmlock - not because of counters, but because the lock is protecting consistency when changing the lagg config * one is adding a new lock specifically to ensure that the callout is atomically created/called/destroyed The latter has nothing to do with the actual counters - they're already using the atomic counter API, so the lock doesn't need to be held just to read them for _counter_ consistency. It's just held to make sure the callout is never called parallel to the destruction of the lagg interface. -adrian