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 2DC07C33CB2 for ; Wed, 15 Jan 2020 09:08:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 01B9F2081E for ; Wed, 15 Jan 2020 09:08:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729400AbgAOJIt (ORCPT ); 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