Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp6246124ybl; Wed, 15 Jan 2020 01:09:23 -0800 (PST) X-Google-Smtp-Source: APXvYqzi5lbTNkZ1rXTLMY4J6zFV+Kc0wsSpxuWJBwAi6DM4wEB8BfDLbmQ9ffLtSu4l2EcF9mte X-Received: by 2002:aca:5582:: with SMTP id j124mr19185953oib.20.1579079363569; Wed, 15 Jan 2020 01:09:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579079363; cv=none; d=google.com; s=arc-20160816; b=0Ndu/OPr4Qia+vMCKda4idewylkZJhv680vgApjqTbJuyJDgoo1MMa2QdFjpulLEdL 1LBiyUgvPcE7wkyHp6y4gzWnmvC2IFBShB4qvKazAznvpONdPou+hH6y8VeSebzki5wt kBuMjbyUIUrUh0xhsUBLJzfv/tX+nFBQjO+ZIk64QkyM7jCd/k8nafv+3280CLGa3PV4 5jVf101brVuA28XncGhar/KWd0CsUkDWzXsWQ7UAu0IswBqzzGz0fEuK4g2eCmkoftwH iIALm0S4Qk5kzUOaoV0IdWuDsLu7cb+A89GjURZx2Lt56m/madtkPVg+r2E/FzK1Gmhb mwaA== 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=ILSD0c7HoF3BmNoREhEcQOGBrexaHuznHnIoT5iOmtY=; b=RvBJv5mSKTN7FHD8YeEEEEZ7XDvacjAT3x/vOJLWyv+rW1tRl22cI0xuAEWFGAAJ2z smLkr5aJVO43DWjOHPivoIhaOJOKX0lHI256hod0kvhqbAApEs5a0+pU0CWrCtS5KdlL MltdQG+CEThfhT16j1muycezKvJvZnow+jAecOiObozJLQ60szHmBmRCmvW0qGO1h1cE zqBgrWy8Z0bDzzGhF+Zaj8yUL6HyLVJ5N4tZoZPbHtxjBAbbIuxqoU31n+0+t8iwwGIr HyaSwF5lJuBlj6xdI0nREmy2x9wct/J2bcqTSGLtY9VAdUoOSUQDCEgYV/ZPRtTmF/aB Uj/A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-ext4-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z22si10523940otq.94.2020.01.15.01.09.05; Wed, 15 Jan 2020 01:09:23 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-ext4-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-ext4-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729399AbgAOJIt (ORCPT + 99 others); Wed, 15 Jan 2020 04:08:49 -0500 Received: from mx2.suse.de ([195.135.220.15]:36348 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729267AbgAOJIt (ORCPT ); Wed, 15 Jan 2020 04:08:49 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 52515AC4B; Wed, 15 Jan 2020 09:08:48 +0000 (UTC) Received: by quack2.suse.cz (Postfix, from userid 1000) id 359871E0CBC; Wed, 15 Jan 2020 10:08:46 +0100 (CET) Date: Wed, 15 Jan 2020 10:08:46 +0100 From: Jan Kara To: Christoph Hellwig Cc: Jan Kara , Ritesh Harjani , linux-ext4@vger.kernel.org, tytso@mit.edu Subject: Re: [RFC 1/2] iomap: direct-io: Move inode_dio_begin before filemap_write_and_wait_range Message-ID: <20200115090846.GB31450@quack2.suse.cz> References: <27607a16327fe9664f32d09abe565af0d1ae56c9.1578907891.git.riteshh@linux.ibm.com> <20200114163702.GA7127@infradead.org> <20200114171934.GB22081@quack2.suse.cz> <20200114182736.GA27370@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200114182736.GA27370@infradead.org> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Tue 14-01-20 10:27:36, Christoph Hellwig wrote: > On Tue, Jan 14, 2020 at 06:19:34PM +0100, Jan Kara wrote: > > We want to detect in the writeback path whether there's direct IO (read) > > currently running for the inode. Not for the writeback issued from > > iomap_dio_rw() but for any arbitrary writeback that iomap_dio_rw() can be > > racing with - so struct writeback_control won't help. Now if you want to > > see the ugly details why this hack is needed, see my other email to Ritesh > > in this thread with details of the race. > > How do we get other writeback after iomap_dio_rw wrote everything out? You create dirty page using mmap in the range read by iomap_dio_rw() and then background writeback happens at unfortunate time... Email [1] has the exact traces. > Either way I'm trying to kill i_dio_count as it has all kinds of > problems, see the patch sent out earlier today. OK, I'll see that patch. Honza [1] https://lore.kernel.org/linux-ext4/20200114094741.GC6466@quack2.suse.cz -- Jan Kara SUSE Labs, CR