Received: by 2002:a05:6a10:6006:0:0:0:0 with SMTP id w6csp249912pxa; Thu, 27 Aug 2020 00:49:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwF7KUhgRe8zRmCrZHezy4r4L+LWRh9rx6/lPxPHP69DwyiQ2CTOQdrZpE0Ro/6Uu+oL8Je X-Received: by 2002:a17:906:54d3:: with SMTP id c19mr20823917ejp.408.1598514581572; Thu, 27 Aug 2020 00:49:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598514581; cv=none; d=google.com; s=arc-20160816; b=oBhzvsYC0LowG2V/7O6976nnpdHjAmvlC1GnOaMLfUQU5Uc5KrQ+/iahHQ/9RD3Bk3 cK321EmqaqEU/KYXZbY4XiO78XEMLOmr+OyNm8AWJ0TWLPMzaesIG59RgANx/URccdOE iP8CuvcE1uRz3z76rxvQv1ORDJj5lgVKFMlQtZp5zeAcBtSdg/GmMbh6BiaU4a5R+Mxb /YWHZgqb+Rbc1dD2bAYY+Tvs89vFjWd37Uv9K/mkKH80/i1ZZVqvlZ6re6mvLxBaDrns jHo9V/EavXDK7w/PqjyByuZMSjwATj1MSWj881Wgo6IP5RA50/nnpOebqDHS9zZ3UnnD rStw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=fp15CVlMAqz9O6weWBCKzsHdG8ZXZDfQqqilECwyOhM=; b=yFtTUhaeKs++6ESkyxaGyVOItlaRf67tTW9rJbkkeO7M2wHQGqI6+70t8qAnasTmGj rIXSs4LW9grEuvh7Mr+PRRQ8NFoBB+aR0yluwP3E5KIAlm/1vwNCChn6IkBY9wAp6lUm fdr9aOBx18aO/rLA/2a9qjvjLScuT8TVut2ME0Zpn8y8egqLDI2pLYC7RRLcQRF7xwcG mYUKm3qkbHgUU1OF4rcqzmQhHwmNVYrBxaaUF8Rmk5cynlSNk35n094KWtSSI0JcSGpM lywBScZ1olayMs/sOjMujbI5wIWTcIfPDUEpX6wTVsroHT5Jflvk4FvhD9NcmYAMg481 1QWw== ARC-Authentication-Results: i=1; mx.google.com; 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 sb29si863451ejb.43.2020.08.27.00.49.19; Thu, 27 Aug 2020 00:49:41 -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; 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 S1728367AbgH0HsE (ORCPT + 99 others); Thu, 27 Aug 2020 03:48:04 -0400 Received: from verein.lst.de ([213.95.11.211]:37012 "EHLO verein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726851AbgH0HsD (ORCPT ); Thu, 27 Aug 2020 03:48:03 -0400 Received: by verein.lst.de (Postfix, from userid 2407) id EC6DB68C65; Thu, 27 Aug 2020 09:47:58 +0200 (CEST) Date: Thu, 27 Aug 2020 09:47:58 +0200 From: Christoph Hellwig To: Jens Axboe Cc: Justin Sanders , Josef Bacik , Xianting Tian , linux-block@vger.kernel.org, dm-devel@redhat.com, Stefan Haberland , Jan Hoeppner , linux-kernel@vger.kernel.org, nbd@other.debian.org, linux-nvme@lists.infradead.org, linux-s390@vger.kernel.org Subject: Re: fix block device size update serialization v2 Message-ID: <20200827074758.GA8009@lst.de> References: <20200823091043.2600261-1-hch@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200823091043.2600261-1-hch@lst.de> User-Agent: Mutt/1.5.17 (2007-11-01) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Jens, can you consider this for 5.9? It reliably fixes the reported hangs with nvme hotremoval that we've had for a few releases. On Sun, Aug 23, 2020 at 11:10:40AM +0200, Christoph Hellwig wrote: > Hi Jens, > > this series fixes how we update i_size for the block device inodes (and > thus the block device). Different helpers use two different locks > (bd_mutex and i_rwsem) to protect the update, and it appears device > mapper uses yet another internal lock. A lot of the drivers do the > update handcrafted in often crufty ways. And in addition to that mess > it turns out that the "main" lock, bd_mutex is pretty dead lock prone > vs other spots in the block layer that acquire it during revalidation > operations, as reported by Xianting. > > Fix all that by adding a dedicated spinlock just for the size updates. > > Changes since v1: > - don't call __invalidate_device under the new spinlock > - don't call into the file system code from the nvme removal code ---end quoted text---