From owner-freebsd-hackers@FreeBSD.ORG Sat Mar 14 01:03:46 2015 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 92A7441D for ; Sat, 14 Mar 2015 01:03:46 +0000 (UTC) Received: from ustc.edu.cn (email6.ustc.edu.cn [IPv6:2001:da8:d800::8]) by mx1.freebsd.org (Postfix) with ESMTP id 8C02E171 for ; Sat, 14 Mar 2015 01:03:45 +0000 (UTC) Received: from freebsd (unknown [58.211.218.74]) by newmailweb.ustc.edu.cn (Coremail) with SMTP id LkAmygB3JzzniANVUmOUAw--.47941S2; Sat, 14 Mar 2015 09:03:41 +0800 (CST) Date: Sat, 14 Mar 2015 09:03:29 +0800 From: Tiwei Bie To: Mateusz Guzik Subject: Re: [PATCH] Finish the task 'Convert mountlist_mtx to rwlock' Message-ID: <20150314010329.GA2559@freebsd> References: <1426079434-51568-1-git-send-email-btw@mail.ustc.edu.cn> <20150312132338.GA57932@freebsd> <20150313200705.GA32157@dft-labs.eu> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20150313200705.GA32157@dft-labs.eu> User-Agent: Mutt/1.5.23 (2014-03-12) X-CM-TRANSID: LkAmygB3JzzniANVUmOUAw--.47941S2 X-Coremail-Antispam: 1UD129KBjvJXoW7ur1xKF43tryUGFyDury8Krg_yoW8Gw4DpF WftFy0kr4vv3y8Z347tw15XryFvw1kJF17Xw1rXr1kA3sYvw1Skr1UtF45KFW7WryIkrsF vFWj93saq3Z8AaDanT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDU0xBIdaVrnRJUUUkFb7Iv0xC_KF4lb4IE77IF4wAFF20E14v26r1j6r4UM7CY07I2 0VC2zVCF04k26cxKx2IYs7xG6rWj6s0DM7CIcVAFz4kK6r1j6r18M28lY4IEw2IIxxk0rw A2F7IY1VAKz4vEj48ve4kI8wA2z4x0Y4vE2Ix0cI8IcVAFwI0_Xr0_Ar1l84ACjcxK6xII jxv20xvEc7CjxVAFwI0_Cr0_Gr1UM28EF7xvwVC2z280aVAFwI0_Gr1j6F4UJwA2z4x0Y4 vEx4A2jsIEc7CjxVAFwI0_Gr1j6F4UJwAS0I0E0xvYzxvE52x082IY62kv0487Mc02F40E FcxC0VAKzVAqx4xG6I80ewAv7VC0I7IYx2IY67AKxVWUJVWUGwAv7VC2z280aVAFwI0_Jr 0_Gr1lOx8S6xCaFVCjc4AY6r1j6r4UM4x0Y48IcVAKI48JMxkIecxEwVAFwVWkMxAIw28I cxkI7VAKI48JMxC20s026xCaFVCjc4AY6r1j6r4UMI8I3I0E5I8CrVAFwI0_Jr0_Jr4lx2 IqxVCjr7xvwVAFwI0_JrI_JrWlx4CE17CEb7AF67AKxVWUAVWUtwCIc40Y0x0EwIxGrwCI 42IY6xIIjxv20xvE14v26r1j6r1xMIIF0xvE2Ix0cI8IcVCY1x0267AKxVWUJVW8JwCI42 IY6xAIw20EY4v20xvaj40_WFyUJVCq3wCI42IY6I8E87Iv67AKxVWUJVW8JwCI42IY6I8E 87Iv6xkF7I0E14v26r1j6r4UYxBIdaVFxhVjvjDU0xZFpf9x07jO6p9UUUUU= X-CM-SenderInfo: xewzqzxdloh3xvwfhvlgxou0/1tbiAQUHAVQhl-enIQAPse Cc: "freebsd-hackers@freebsd.org" , Ryan Stone , wca@freebsd.org X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Mar 2015 01:03:46 -0000 On Fri, Mar 13, 2015 at 09:07:05PM +0100, Mateusz Guzik wrote: > On Thu, Mar 12, 2015 at 09:26:00PM +0800, Tiwei Bie wrote: > > On Thu, Mar 12, 2015 at 12:06:02AM -0400, Ryan Stone wrote: > > > On Wed, Mar 11, 2015 at 9:10 AM, Tiwei Bie wrote: > > > > Hi, Mateusz! > > > > > > > > I have finished the task: Convert mountlist_mtx to rwlock [1]. > > > > > > My first comment is, are we sure that we actually want an rwlock here > > > instead of an rmlock? An rmlock will offer much better performance in > > > workloads that mostly only take read locks, and rmlocks do not suffer > > > the priority inversion problems that rwlocks do. From the description > > > on the wiki page, it sounds like an rmlock would be ideal here: > > > > > > > Interested person can upgrade this task to non-junior by coming up with a > > > > solution exploiting rare need to modify the list. Example approaches include > > > > designing a locking primitive with cheap shared locking (think: per-cpu) at > > > > the expense of exclusive locking. > > > > > > > I think rmlock is okay. But one more argument needs to be added > > to vfs_busy(), that is 'struct rm_priotracker *tracker' which is > > used to track read owners of mountlist_lock in vfs_busy(). > > So, this is not a simple s/rw_lock/rm_rlock and the like after all, sorry. :) > > I'll have to go over this and possibly gather some ACKs before > committing. > Never mind, just do whatever necessary and make the best choice! ^_^ Tiwei Bie