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 X-Spam-Level: X-Spam-Status: No, score=-0.6 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E28A0C33C9E for ; Tue, 14 Jan 2020 18:47:19 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id ABA9C24658 for ; Tue, 14 Jan 2020 18:47:19 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="OVJUbcVF" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org ABA9C24658 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 311CC8E0005; Tue, 14 Jan 2020 13:47:19 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 274F38E0003; Tue, 14 Jan 2020 13:47:19 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 13D218E0005; Tue, 14 Jan 2020 13:47:19 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0091.hostedemail.com [216.40.44.91]) by kanga.kvack.org (Postfix) with ESMTP id F0C3E8E0003 for ; Tue, 14 Jan 2020 13:47:18 -0500 (EST) Received: from smtpin01.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id CAEF1824999B for ; Tue, 14 Jan 2020 18:47:18 +0000 (UTC) X-FDA: 76377122556.01.show84_5ce6c98b96c1c X-HE-Tag: show84_5ce6c98b96c1c X-Filterd-Recvd-Size: 3014 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) by imf21.hostedemail.com (Postfix) with ESMTP for ; Tue, 14 Jan 2020 18:47:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; 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=4Puk4Pgh+JhY8rl1OTT+GzFNEp0YuWY6wSf3flBS7Ow=; b=OVJUbcVFDftKB5Eo3F2KjOn/c eTVxMFe3bAKYYiMsJZC4Yu+o8V1cEc3oTyou++4dL3yqQzkTr0fqY3uCgydpp0xhnS34GDKpYPPdB J2TZMMYEWcn1XQR2Xjrn/UeOPjrNVLlBokSa22SxrQPQGeWNXW8bgiueP94uPIwXcBtn2mlfl4zvU psdND3rkQqFxgSup4Uphqkehw+zeDMkzfpEJytWJSSPwy5ehu26ZS06+63HhzlDc29Y+1NAjkd5jC BG+XXj4w257y2aYtcuSsXEQ3VYr2FTHDQ/5BwAVvthAg0HM+L0ryMcn36U3a37N2tHlEFX6ObooKf Bw4p2nuKA==; Received: from willy by bombadil.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1irRDX-0006t8-Mm; Tue, 14 Jan 2020 18:47:07 +0000 Date: Tue, 14 Jan 2020 10:47:07 -0800 From: Matthew Wilcox To: Christoph Hellwig Cc: linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, Waiman Long , Peter Zijlstra , Thomas Gleixner , Ingo Molnar , Will Deacon , Andrew Morton , linux-ext4@vger.kernel.org, cluster-devel@redhat.com, linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: Re: RFC: hold i_rwsem until aio completes Message-ID: <20200114184707.GA10467@bombadil.infradead.org> References: <20200114161225.309792-1-hch@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200114161225.309792-1-hch@lst.de> X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Tue, Jan 14, 2020 at 05:12:13PM +0100, Christoph Hellwig wrote: > Second I/O > completions often come from interrupt context, which means the re-acquire > is recorded as from irq context, leading to warnings about incorrect > contexts. I wonder if we could just have a bit in lockdep that says > returning to userspace is ok for this particular lock? That would also > clean up the fsfreeze situation a lot. It would be helpful if we could also use the same lockdep logic for PageLocked. Again, it's a case where returning to userspace with PageLock held is fine, because we're expecting an interrupt to come in and drop the lock for us. Perhaps the right answer is, from lockdep's point of view, to mark the lock as being released at the point where we submit the I/O. Then in the completion path release the lock without telling lockdep we released it. That would catch cases where we inadvertently returned to userspace without submitting the I/O, for example.