From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 4E08BC71153 for ; Mon, 28 Aug 2023 12:10:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1693224619; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=w9JzPrPoT7dea1oyiWYEUAuB3tp+tidMMh7YcdRuYoE=; b=DhjFKxkNw36W1r0lRlGUQ+3tWxXk6kdcLfYT27iwaCbgGbgv0XaduBjS/xH5+i452fSeUA x7Bu8RYJb5SF1VErw8vJSxcr5HMLU4ZJbPH+mCAmZVxfJQ3KVZE9FSO31ynsRPZsDoEvUn A1AZ5+BXhd/4b5G0rQEps1ib7CwNOfE= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-290-kknRCNXENVOONOgugzo1cQ-1; Mon, 28 Aug 2023 08:10:17 -0400 X-MC-Unique: kknRCNXENVOONOgugzo1cQ-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id E95A4185A7A4; Mon, 28 Aug 2023 12:10:10 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 458FB2026D4B; Mon, 28 Aug 2023 12:10:07 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 121981946587; Mon, 28 Aug 2023 12:09:57 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 5AFDE1946587 for ; Mon, 28 Aug 2023 12:09:51 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 432492166B28; Mon, 28 Aug 2023 12:09:51 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast01.extmail.prod.ext.rdu2.redhat.com [10.11.55.17]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 3BA792166B25 for ; Mon, 28 Aug 2023 12:09:51 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 113118061D4 for ; Mon, 28 Aug 2023 12:09:51 +0000 (UTC) Received: from verein.lst.de (verein.lst.de [213.95.11.211]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-434-5N1p_F6xOBGqtvqVd4iIXQ-1; Mon, 28 Aug 2023 08:09:45 -0400 X-MC-Unique: 5N1p_F6xOBGqtvqVd4iIXQ-1 Received: by verein.lst.de (Postfix, from userid 2407) id CFEA56732A; Mon, 28 Aug 2023 14:09:40 +0200 (CEST) Date: Mon, 28 Aug 2023 14:09:40 +0200 From: Christoph Hellwig To: Al Viro Message-ID: <20230828120940.GB10552@lst.de> References: <20230608110258.189493-1-hch@lst.de> <20230608110258.189493-2-hch@lst.de> <20230825024457.GD95084@ZenIV> MIME-Version: 1.0 In-Reply-To: <20230825024457.GD95084@ZenIV> User-Agent: Mutt/1.5.17 (2007-11-01) X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 3.1 on 10.11.54.6 Subject: Re: [dm-devel] [PATCH 01/30] block: also call ->open for incremental partition opens X-BeenThere: dm-devel@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: device-mapper development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Vignesh Raghavendra , "Rafael J. Wysocki" , linux-nvme@lists.infradead.org, Phillip Potter , Chris Mason , dm-devel@redhat.com, "Md. Haris Iqbal" , Pavel Machek , Miquel Raynal , Jack Wang , Christoph Hellwig , linux-nilfs@vger.kernel.org, linux-scsi@vger.kernel.org, Richard Weinberger , linux-pm@vger.kernel.org, linux-um@lists.infradead.org, Josef Bacik , Coly Li , linux-block@vger.kernel.org, linux-bcache@vger.kernel.org, David Sterba , Jens Axboe , Christian Brauner , "Martin K. Petersen" , linux-f2fs-devel@lists.sourceforge.net, linux-fsdevel@vger.kernel.org, linux-mtd@lists.infradead.org, linux-btrfs@vger.kernel.org Errors-To: dm-devel-bounces@redhat.com Sender: "dm-devel" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.4 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: lst.de Content-Disposition: inline Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit On Fri, Aug 25, 2023 at 03:44:57AM +0100, Al Viro wrote: > That got me curious about the ->bd_openers - do we need it atomic? > Most of the users (and all places that do modifications) are > under ->open_mutex; the only exceptions are > * early sync logics in blkdev_put(); it's explicitly racy - > see the comment there. > * callers of disk_openers() in loop and nbd (the ones in > zram are under ->open_mutex). There's driver-private exclusion > around those, but in any case - READ_ONCE() is no worse than > atomic_read() in those cases. > > Is there something subtle I'm missing here? No. When I had to add unlocked readers I did the READ_ONCE initially, but reviewers though the atomic_t would be better. I didn't really feel like arguing so went with this version. -- dm-devel mailing list dm-devel@redhat.com https://listman.redhat.com/mailman/listinfo/dm-devel From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3AB1EC83F18 for ; Mon, 28 Aug 2023 12:10:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229989AbjH1MJy (ORCPT ); Mon, 28 Aug 2023 08:09:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57160 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230333AbjH1MJs (ORCPT ); Mon, 28 Aug 2023 08:09:48 -0400 Received: from verein.lst.de (verein.lst.de [213.95.11.211]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5F89BA9; Mon, 28 Aug 2023 05:09:46 -0700 (PDT) Received: by verein.lst.de (Postfix, from userid 2407) id CFEA56732A; Mon, 28 Aug 2023 14:09:40 +0200 (CEST) Date: Mon, 28 Aug 2023 14:09:40 +0200 From: Christoph Hellwig To: Al Viro Cc: Christoph Hellwig , Jens Axboe , Richard Weinberger , Josef Bacik , "Md. Haris Iqbal" , Jack Wang , Phillip Potter , Coly Li , Miquel Raynal , Vignesh Raghavendra , "Martin K. Petersen" , Chris Mason , David Sterba , Christian Brauner , "Rafael J. Wysocki" , Pavel Machek , dm-devel@redhat.com, linux-block@vger.kernel.org, linux-um@lists.infradead.org, linux-scsi@vger.kernel.org, linux-bcache@vger.kernel.org, linux-mtd@lists.infradead.org, linux-nvme@lists.infradead.org, linux-btrfs@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, linux-nilfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-pm@vger.kernel.org, Hannes Reinecke Subject: Re: [PATCH 01/30] block: also call ->open for incremental partition opens Message-ID: <20230828120940.GB10552@lst.de> References: <20230608110258.189493-1-hch@lst.de> <20230608110258.189493-2-hch@lst.de> <20230825024457.GD95084@ZenIV> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230825024457.GD95084@ZenIV> User-Agent: Mutt/1.5.17 (2007-11-01) Precedence: bulk List-ID: X-Mailing-List: linux-bcache@vger.kernel.org On Fri, Aug 25, 2023 at 03:44:57AM +0100, Al Viro wrote: > That got me curious about the ->bd_openers - do we need it atomic? > Most of the users (and all places that do modifications) are > under ->open_mutex; the only exceptions are > * early sync logics in blkdev_put(); it's explicitly racy - > see the comment there. > * callers of disk_openers() in loop and nbd (the ones in > zram are under ->open_mutex). There's driver-private exclusion > around those, but in any case - READ_ONCE() is no worse than > atomic_read() in those cases. > > Is there something subtle I'm missing here? No. When I had to add unlocked readers I did the READ_ONCE initially, but reviewers though the atomic_t would be better. I didn't really feel like arguing so went with this version. From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.sourceforge.net (lists.sourceforge.net [216.105.38.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 55D16C71153 for ; Mon, 28 Aug 2023 12:10:07 +0000 (UTC) Received: from [127.0.0.1] (helo=sfs-ml-2.v29.lw.sourceforge.com) by sfs-ml-2.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1qab4H-0000sm-8s; Mon, 28 Aug 2023 12:10:04 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-2.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1qab47-0000ru-Rg for linux-f2fs-devel@lists.sourceforge.net; Mon, 28 Aug 2023 12:09:54 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; 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:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=ubhxOKVUHL8/5bm3fUBH0jxyHNpaixPV0ONYDl+ytLo=; b=WQXkNM3OmCQ2XHQIkRs/ETNCyT Mn6iTlB0CbSrQb5pfV8KMmjhvFcL1FlwJNjRv5/XF5B+l5E1B/jbgz0sjbMCMVJdOttIw9GB4vfPF +sMwuJSRQYPeWF/IWKkwpg3y7FKLk5OYlrCtg+ho6zPh/M2BuoJWU6QUaQG8wZAOl0VU=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; 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:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=ubhxOKVUHL8/5bm3fUBH0jxyHNpaixPV0ONYDl+ytLo=; b=fD80+fsTKpogvSKtPvhZCm4lcH tQZGee7aL2Jbt7baXAWpmmAtPE9buqnOqZMy4OReO5SSqcFuLkcllUAaDScxEK5rruq7x7jtou8eN YIixuHGeSIoXDjrTStZ1919Ol8fF2FIz4ixOcs64YqNayGqB58A/wwHdlaHc/xkLNcLI=; Received: from verein.lst.de ([213.95.11.211]) by sfi-mx-1.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95) id 1qab45-000ibQ-BA for linux-f2fs-devel@lists.sourceforge.net; Mon, 28 Aug 2023 12:09:54 +0000 Received: by verein.lst.de (Postfix, from userid 2407) id CFEA56732A; Mon, 28 Aug 2023 14:09:40 +0200 (CEST) Date: Mon, 28 Aug 2023 14:09:40 +0200 From: Christoph Hellwig To: Al Viro Message-ID: <20230828120940.GB10552@lst.de> References: <20230608110258.189493-1-hch@lst.de> <20230608110258.189493-2-hch@lst.de> <20230825024457.GD95084@ZenIV> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20230825024457.GD95084@ZenIV> User-Agent: Mutt/1.5.17 (2007-11-01) X-Headers-End: 1qab45-000ibQ-BA Subject: Re: [f2fs-dev] [PATCH 01/30] block: also call ->open for incremental partition opens X-BeenThere: linux-f2fs-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Vignesh Raghavendra , "Rafael J. Wysocki" , linux-nvme@lists.infradead.org, Phillip Potter , Chris Mason , dm-devel@redhat.com, "Md. Haris Iqbal" , Pavel Machek , Miquel Raynal , Jack Wang , Christoph Hellwig , linux-nilfs@vger.kernel.org, linux-scsi@vger.kernel.org, Richard Weinberger , linux-pm@vger.kernel.org, linux-um@lists.infradead.org, Josef Bacik , Coly Li , linux-block@vger.kernel.org, linux-bcache@vger.kernel.org, Hannes Reinecke , David Sterba , Jens Axboe , Christian Brauner , "Martin K. Petersen" , linux-f2fs-devel@lists.sourceforge.net, linux-fsdevel@vger.kernel.org, linux-mtd@lists.infradead.org, linux-btrfs@vger.kernel.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: linux-f2fs-devel-bounces@lists.sourceforge.net On Fri, Aug 25, 2023 at 03:44:57AM +0100, Al Viro wrote: > That got me curious about the ->bd_openers - do we need it atomic? > Most of the users (and all places that do modifications) are > under ->open_mutex; the only exceptions are > * early sync logics in blkdev_put(); it's explicitly racy - > see the comment there. > * callers of disk_openers() in loop and nbd (the ones in > zram are under ->open_mutex). There's driver-private exclusion > around those, but in any case - READ_ONCE() is no worse than > atomic_read() in those cases. > > Is there something subtle I'm missing here? No. When I had to add unlocked readers I did the READ_ONCE initially, but reviewers though the atomic_t would be better. I didn't really feel like arguing so went with this version. _______________________________________________ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christoph Hellwig Subject: Re: [PATCH 01/30] block: also call ->open for incremental partition opens Date: Mon, 28 Aug 2023 14:09:40 +0200 Message-ID: <20230828120940.GB10552@lst.de> References: <20230608110258.189493-1-hch@lst.de> <20230608110258.189493-2-hch@lst.de> <20230825024457.GD95084@ZenIV> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=zPTpIdXfaVdwmiCVg4v8U9XdCPc/NV9nuRnAhZUD6XY=; b=dS+Kze7b8oO7Ti NENi8uNxKfNMR4SV3G8cDyjmg9b7nKsr2g84SyCxqslfTu+5E1vNKw3birtg6OJRUiQWQkL7o2zFi RsXMHCLIbn2hMuvFQo3Nxrd1hcpMeBbV3jgHuYXas8Phn+J02yJ4InLmyiYAM2ANdMHNcXwJZIlVT 9NYsQFyZHwJYBbf/DBBSxFTVTcITohVP47C1OKTFQjroHaRLMjIBfn8GVv/KiTd0yx3fzrxLEf6PY 5YIzlhuKCkW7Lq1rlzb0S16ajDo2rDrTaHYfg+SLAVTJmy4qquHdlF+yF1Y/iXGUvJ31yfjDMvZfe z3k/rCyKfnZBxoQ30xDA==; Content-Disposition: inline In-Reply-To: <20230825024457.GD95084@ZenIV> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-um" Errors-To: linux-um-bounces+glud-user-mode-linux-devel=m.gmane-mx.org@lists.infradead.org To: Al Viro Cc: Christoph Hellwig , Jens Axboe , Richard Weinberger , Josef Bacik , "Md. Haris Iqbal" , Jack Wang , Phillip Potter , Coly Li , Miquel Raynal , Vignesh Raghavendra , "Martin K. Petersen" , Chris Mason , David Sterba , Christian Brauner , "Rafael J. Wysocki" , Pavel Machek , dm-devel@redhat.com, linux-block@vger.kernel.org, linux-um@lists.infradead.org, linux-scsi@vger.kernel.org, linux-bcache@vger.kernel.org, linux-mtd@lists.infradead.org, linux-nvme@lists.infradead.org, linux-btrfs@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, linux-nilfs@vger.kernel.org On Fri, Aug 25, 2023 at 03:44:57AM +0100, Al Viro wrote: > That got me curious about the ->bd_openers - do we need it atomic? > Most of the users (and all places that do modifications) are > under ->open_mutex; the only exceptions are > * early sync logics in blkdev_put(); it's explicitly racy - > see the comment there. > * callers of disk_openers() in loop and nbd (the ones in > zram are under ->open_mutex). There's driver-private exclusion > around those, but in any case - READ_ONCE() is no worse than > atomic_read() in those cases. > > Is there something subtle I'm missing here? No. When I had to add unlocked readers I did the READ_ONCE initially, but reviewers though the atomic_t would be better. I didn't really feel like arguing so went with this version. From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 5428CC83F12 for ; Mon, 28 Aug 2023 12:10:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=JGTxjYygrajXuzlU9rbBGin9z1UtuOolkHA5zEsmCbs=; b=0+SqgJsk2N+lKa Sumlq6LyD0bPMMVh+EiyEP797Oq146J8sMMlAeNakMViN2P1lGnL3ohXc9/SF8yRN1TyncCTVAqKN u9bMJgPpXRYeLUK5A24b1cHTOYYUFlNsldY48LFbmynd4X/czvwRIJgPIrAmGr3DhREI88iTYibN3 OF/hzwC4CaZWqCOc6LaevRdCadlqMFUJvcMKErP8ys56oziD6dNd6VJGbkKinI4vGTXLSDlUFoep7 5kfNBdHWCXrJwOqveXOJdQz4zMv62eD+kNlfPf2+BTdOYSLd+IJUvVZrmk/EscawxjLzxKNH6hkxD Dzzo0MUmqhH2OOz9e5sw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qab43-009XFM-0y; Mon, 28 Aug 2023 12:09:51 +0000 Received: from verein.lst.de ([213.95.11.211]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qab3z-009XEn-35; Mon, 28 Aug 2023 12:09:49 +0000 Received: by verein.lst.de (Postfix, from userid 2407) id CFEA56732A; Mon, 28 Aug 2023 14:09:40 +0200 (CEST) Date: Mon, 28 Aug 2023 14:09:40 +0200 From: Christoph Hellwig To: Al Viro Cc: Christoph Hellwig , Jens Axboe , Richard Weinberger , Josef Bacik , "Md. Haris Iqbal" , Jack Wang , Phillip Potter , Coly Li , Miquel Raynal , Vignesh Raghavendra , "Martin K. Petersen" , Chris Mason , David Sterba , Christian Brauner , "Rafael J. Wysocki" , Pavel Machek , dm-devel@redhat.com, linux-block@vger.kernel.org, linux-um@lists.infradead.org, linux-scsi@vger.kernel.org, linux-bcache@vger.kernel.org, linux-mtd@lists.infradead.org, linux-nvme@lists.infradead.org, linux-btrfs@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, linux-nilfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-pm@vger.kernel.org, Hannes Reinecke Subject: Re: [PATCH 01/30] block: also call ->open for incremental partition opens Message-ID: <20230828120940.GB10552@lst.de> References: <20230608110258.189493-1-hch@lst.de> <20230608110258.189493-2-hch@lst.de> <20230825024457.GD95084@ZenIV> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20230825024457.GD95084@ZenIV> User-Agent: Mutt/1.5.17 (2007-11-01) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230828_050948_161263_507EAC56 X-CRM114-Status: GOOD ( 14.18 ) X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-mtd" Errors-To: linux-mtd-bounces+linux-mtd=archiver.kernel.org@lists.infradead.org On Fri, Aug 25, 2023 at 03:44:57AM +0100, Al Viro wrote: > That got me curious about the ->bd_openers - do we need it atomic? > Most of the users (and all places that do modifications) are > under ->open_mutex; the only exceptions are > * early sync logics in blkdev_put(); it's explicitly racy - > see the comment there. > * callers of disk_openers() in loop and nbd (the ones in > zram are under ->open_mutex). There's driver-private exclusion > around those, but in any case - READ_ONCE() is no worse than > atomic_read() in those cases. > > Is there something subtle I'm missing here? No. When I had to add unlocked readers I did the READ_ONCE initially, but reviewers though the atomic_t would be better. I didn't really feel like arguing so went with this version. ______________________________________________________ Linux MTD discussion mailing list http://lists.infradead.org/mailman/listinfo/linux-mtd/ From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id EF52EC83F15 for ; Mon, 28 Aug 2023 12:09:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=zPTpIdXfaVdwmiCVg4v8U9XdCPc/NV9nuRnAhZUD6XY=; b=dS+Kze7b8oO7Ti NENi8uNxKfNMR4SV3G8cDyjmg9b7nKsr2g84SyCxqslfTu+5E1vNKw3birtg6OJRUiQWQkL7o2zFi RsXMHCLIbn2hMuvFQo3Nxrd1hcpMeBbV3jgHuYXas8Phn+J02yJ4InLmyiYAM2ANdMHNcXwJZIlVT 9NYsQFyZHwJYBbf/DBBSxFTVTcITohVP47C1OKTFQjroHaRLMjIBfn8GVv/KiTd0yx3fzrxLEf6PY 5YIzlhuKCkW7Lq1rlzb0S16ajDo2rDrTaHYfg+SLAVTJmy4qquHdlF+yF1Y/iXGUvJ31yfjDMvZfe z3k/rCyKfnZBxoQ30xDA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qab43-009XFR-2X; Mon, 28 Aug 2023 12:09:51 +0000 Received: from verein.lst.de ([213.95.11.211]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qab3z-009XEn-35; Mon, 28 Aug 2023 12:09:49 +0000 Received: by verein.lst.de (Postfix, from userid 2407) id CFEA56732A; Mon, 28 Aug 2023 14:09:40 +0200 (CEST) Date: Mon, 28 Aug 2023 14:09:40 +0200 From: Christoph Hellwig To: Al Viro Cc: Christoph Hellwig , Jens Axboe , Richard Weinberger , Josef Bacik , "Md. Haris Iqbal" , Jack Wang , Phillip Potter , Coly Li , Miquel Raynal , Vignesh Raghavendra , "Martin K. Petersen" , Chris Mason , David Sterba , Christian Brauner , "Rafael J. Wysocki" , Pavel Machek , dm-devel@redhat.com, linux-block@vger.kernel.org, linux-um@lists.infradead.org, linux-scsi@vger.kernel.org, linux-bcache@vger.kernel.org, linux-mtd@lists.infradead.org, linux-nvme@lists.infradead.org, linux-btrfs@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, linux-nilfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-pm@vger.kernel.org, Hannes Reinecke Subject: Re: [PATCH 01/30] block: also call ->open for incremental partition opens Message-ID: <20230828120940.GB10552@lst.de> References: <20230608110258.189493-1-hch@lst.de> <20230608110258.189493-2-hch@lst.de> <20230825024457.GD95084@ZenIV> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20230825024457.GD95084@ZenIV> User-Agent: Mutt/1.5.17 (2007-11-01) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230828_050948_161263_507EAC56 X-CRM114-Status: GOOD ( 14.18 ) X-BeenThere: linux-um@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-um" Errors-To: linux-um-bounces+linux-um=archiver.kernel.org@lists.infradead.org On Fri, Aug 25, 2023 at 03:44:57AM +0100, Al Viro wrote: > That got me curious about the ->bd_openers - do we need it atomic? > Most of the users (and all places that do modifications) are > under ->open_mutex; the only exceptions are > * early sync logics in blkdev_put(); it's explicitly racy - > see the comment there. > * callers of disk_openers() in loop and nbd (the ones in > zram are under ->open_mutex). There's driver-private exclusion > around those, but in any case - READ_ONCE() is no worse than > atomic_read() in those cases. > > Is there something subtle I'm missing here? No. When I had to add unlocked readers I did the READ_ONCE initially, but reviewers though the atomic_t would be better. I didn't really feel like arguing so went with this version. _______________________________________________ linux-um mailing list linux-um@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-um