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=-2.3 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 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 BE70BC33CB3 for ; Wed, 15 Jan 2020 19:07:48 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 904FE2465A for ; Wed, 15 Jan 2020 19:07:48 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 904FE2465A Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=lst.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 2C14A8E0005; Wed, 15 Jan 2020 14:07:48 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 273358E0003; Wed, 15 Jan 2020 14:07:48 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 162118E0005; Wed, 15 Jan 2020 14:07:48 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0052.hostedemail.com [216.40.44.52]) by kanga.kvack.org (Postfix) with ESMTP id 025268E0003 for ; Wed, 15 Jan 2020 14:07:47 -0500 (EST) Received: from smtpin13.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with SMTP id BA7AF181AEF09 for ; Wed, 15 Jan 2020 19:07:47 +0000 (UTC) X-FDA: 76380802974.13.range41_26e5dd799cd47 X-HE-Tag: range41_26e5dd799cd47 X-Filterd-Recvd-Size: 2098 Received: from verein.lst.de (verein.lst.de [213.95.11.211]) by imf05.hostedemail.com (Postfix) with ESMTP for ; Wed, 15 Jan 2020 19:07:47 +0000 (UTC) Received: by verein.lst.de (Postfix, from userid 2407) id 9783D68B20; Wed, 15 Jan 2020 20:07:44 +0100 (CET) Date: Wed, 15 Jan 2020 20:07:44 +0100 From: Christoph Hellwig To: Waiman Long Cc: Jason Gunthorpe , Peter Zijlstra , Christoph Hellwig , linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, 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: <20200115190744.GA2628@lst.de> References: <20200114161225.309792-1-hch@lst.de> <20200114192700.GC22037@ziepe.ca> <20200115065614.GC21219@lst.de> <20200115132428.GA25201@ziepe.ca> <20200115143347.GL2827@hirez.programming.kicks-ass.net> <20200115144948.GB25201@ziepe.ca> <849239ff-d2d1-4048-da58-b4347e0aa2bd@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <849239ff-d2d1-4048-da58-b4347e0aa2bd@redhat.com> User-Agent: Mutt/1.5.17 (2007-11-01) 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 Wed, Jan 15, 2020 at 02:03:22PM -0500, Waiman Long wrote: > >> (1) no unlocking by another process than the one that acquired it > >> (2) no return to userspace with locks held > > As an example flow: obtain the read side lock, schedual a work queue, > > return to user space, and unlock the read side from the work queue. > > We currently have down_read_non_owner() and up_read_non_owner() that > perform the lock and unlock without lockdep tracking. Of course, that is > a hack and their use must be carefully scrutinized to make sure that > there is no deadlock or other potentially locking issues. That doesn't help with returning to userspace while the lock is held.