Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp294572pxb; Fri, 15 Oct 2021 05:49:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy3DgMwzjuWNeymbrPywMO8OwE8rMyKAnsrmGE3HI/FYhJBhsIvFEtJB0xdVCpLp/nPj/qU X-Received: by 2002:a17:90b:23c8:: with SMTP id md8mr28075249pjb.210.1634302186373; Fri, 15 Oct 2021 05:49:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634302186; cv=none; d=google.com; s=arc-20160816; b=HKUM4T491PP5SProcW0Jaf2aGo+odANBdEqFgBXZoHSvufIBIqyloLdGFfIqWNlFc/ UKpXcWvxjHuhYlsdBnyYoAo5lS3fBZYtmG8SUnysfG+H97ghk5vTXgWp8E2zWLRYZI8M bdaIuMg2SWJ0EiqL07f/qX8pGHFjIFt1w3Eabm69SyUPJjuiW+BviJTdc60STJGTkHZw FrvMU0d+xJY/X5/t/Y8RkFDgg2Go8K6FxPyB4cpr/xQ9dxLufr8uSiED9qTwL5BXDpxo 0y3sFuZDpst0nRglfq56cCPBs72sb/PPlQayVVwM+EyfW4WZPYFMyouwE/w6rspyWUE3 ze2A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=Nv5FQ/6vTqDP+uvH/XRZgii5X0jrEJS0CQSXWJp5LYY=; b=vMXRHx0VXVte9bcj2RZ8rmmZnklshzH8tC4olg2JmfQoVCe15zh5sw+W6Op0fnDVX+ HySOxyQh/sq23cdMNcbUynlg9XbScao4qTPjVCwD1Gf1ak+dCVEmB1mOVXPwq3t5CE9J L5+gTZ1t7yzFUGNco095v8/hlMCVlzj2NirlKYPZawgecW/g1a5Am1rFFG+yKrp40jIG AxnRl56HyUfWTXVmdWTFqueRip40jS3fBGuksZ18qrcK0ZOM9Fc55qDoRQK28jHbot3M 58RdmeXor0UPiD6fAjOguu0GWZ+sx+k0hdzdtomZjhbdEv09XDYtBc/lJIKwxVgdKd8m My5g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=AgLYGCmR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p15si8658933plw.13.2021.10.15.05.49.31; Fri, 15 Oct 2021 05:49:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=AgLYGCmR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234544AbhJOGcO (ORCPT + 99 others); Fri, 15 Oct 2021 02:32:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57424 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232562AbhJOGcM (ORCPT ); Fri, 15 Oct 2021 02:32:12 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1D66BC061570; Thu, 14 Oct 2021 23:30:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=Nv5FQ/6vTqDP+uvH/XRZgii5X0jrEJS0CQSXWJp5LYY=; b=AgLYGCmRq2PJF2LjCKSd3i9+8e dHwI13PRvpN84mnLWiuxm2DChcEhVcL2j5+G1MpSJir3s0No/Qfr1Rc8t6UEqhTNN8Yl8OhMq9idC OUkFJTOu8aJEH16iajD3jt8dTV51n6PDAj57s5WW6B+W+QaO8+c+gGeHVuwm4Lmk/DSqA7AEi81Cl UncMAun5PjoNTSZUZzmqUtS8j8fowmcifrwLlRcsWWfNhYX+YuGfzYVV+e/Kri4YxoQewkvDHMDGv Lm0Hnnnj3TVXzQyCyBTnNCY6cTlzXqxT1AGI3g+zWo6TmUYKE045vQecRQ5rjR3xUGmEWkdrRSJfn tAXfOAvQ==; Received: from hch by bombadil.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1mbGjD-005WWo-Bs; Fri, 15 Oct 2021 06:30:03 +0000 Date: Thu, 14 Oct 2021 23:30:03 -0700 From: Christoph Hellwig To: Shiyang Ruan Cc: linux-kernel@vger.kernel.org, linux-xfs@vger.kernel.org, nvdimm@lists.linux.dev, linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, djwong@kernel.org, dan.j.williams@intel.com, david@fromorbit.com, hch@infradead.org, jane.chu@oracle.com Subject: Re: [PATCH v7 1/8] dax: Use rwsem for dax_{read,write}_lock() Message-ID: References: <20210924130959.2695749-1-ruansy.fnst@fujitsu.com> <20210924130959.2695749-2-ruansy.fnst@fujitsu.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210924130959.2695749-2-ruansy.fnst@fujitsu.com> X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Sep 24, 2021 at 09:09:52PM +0800, Shiyang Ruan wrote: > In order to introduce dax holder registration, we need a write lock for > dax. Because of the rarity of notification failures and the infrequency > of registration events, it would be better to be a global lock rather > than per-device. So, change the current lock to rwsem and introduce a > write lock for registration. I don't think taking the rw_semaphore everywhere will scale, as basically any DAX based I/O will take it (in read mode). So at a minimum we'd need a per-device percpu_rw_semaphore if we want to go there.