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=-8.8 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable 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 2C909C433E0 for ; Tue, 28 Jul 2020 09:23:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0A43A207E8 for ; Tue, 28 Jul 2020 09:23:09 +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="FlKygivA" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728254AbgG1JXF (ORCPT ); Tue, 28 Jul 2020 05:23:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44758 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728072AbgG1JXF (ORCPT ); Tue, 28 Jul 2020 05:23:05 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2565BC061794; Tue, 28 Jul 2020 02:23:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.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; bh=4UCo16YZAgo21iB1/5TNNcfQzePmrfQa/TCIlwmqQMw=; b=FlKygivAItuT2wHUokA1ITYibF wDLTCx3Jy8n1jR9eiAu1S8KOcJaTue2PCQRreXwNhzbUZ+xz1y3Js2FwQ6fJOF/g5WhKk3g8QUe1p QAt5WHGjP7xvK/S9gvVOHHeIKRQcL3bjMNBMuTNL+uDloOxJUyz9h+RV5xkhdEChPnzs8UvuNBEr6 OIs4BLl1kzrSi8ETKyjIc32l4MSpwvEm8CU3Qkn8GO7Czgg4pH7/Yabc5psLJsQtL8NO/gqvuY76s Y9BuaM0RR/TFpRMLES6Sjwmh/2P+rzsNdy8Yy3BtH/OR4P1eAMiDdsKoNIW4aEbp/hwThxIrBSoBo FOIeZmmA==; Received: from hch by casper.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1k0Lp7-0000ER-2w; Tue, 28 Jul 2020 09:23:01 +0000 Date: Tue, 28 Jul 2020 10:23:01 +0100 From: Christoph Hellwig To: Dave Chinner Cc: Matthew Wilcox , Christoph Hellwig , "Darrick J. Wong" , linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, Brian Foster , linux-kernel@vger.kernel.org Subject: Re: [PATCH] iomap: Ensure iop->uptodate matches PageUptodate Message-ID: <20200728092301.GA32142@infradead.org> References: <20200726091052.30576-1-willy@infradead.org> <20200726230657.GT2005@dread.disaster.area> <20200726232022.GH23808@casper.infradead.org> <20200726235335.GU2005@dread.disaster.area> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200726235335.GU2005@dread.disaster.area> X-SRS-Rewrite: SMTP reverse-path rewritten from by casper.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-xfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org On Mon, Jul 27, 2020 at 09:53:35AM +1000, Dave Chinner wrote: > Yes, I understand the code accepts it can happen; what I dislike is > code that asserts subtle behaviour can happen, then doesn't describe > that exactly why/how that condition can occur. And then, because we > don't know exactly how something happens, we add work arounds to > hide issues we can't reason through fully. That's .... suboptimal. > > Christoph might know off the top of his head how we get into this > state. Once we work it out, then we need to add comments... Unfortunately I don't know offhand. I'll need to spend some more quality time with this code first. > > Way ahead of you > > http://git.infradead.org/users/willy/pagecache.git/commitdiff/5a1de6fc4f815797caa4a2f37c208c67afd7c20b > > *nod* > > I would suggest breaking that out as a separate cleanup patch and > not hide is in a patch that contains both THP modifications and bug > fixes. It stands alone as a valid cleanup. I'm pretty sure I already suggested that when it first showed up. That being said I have another somewhat related thing in this area that I really want to get done before THP support, and maybe I can offload it to willy: Currently we always allocate the iomap_page structure for blocksize < PAGE_SIZE. While this was easy to implement and a major improvement over the buffer heads it actually is quite silly, as we only actually need it if we either have sub-page uptodate state, or have extents boundaries in the page. So what I'd like to do is to only actually allocate it in that case. By doing the allocation lazy it should also help to never allocate one that is marked all uptodate from the start.