Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 80DA5C433FE for ; Mon, 7 Nov 2022 13:04:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231643AbiKGNEW (ORCPT ); Mon, 7 Nov 2022 08:04:22 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45750 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229518AbiKGNEV (ORCPT ); Mon, 7 Nov 2022 08:04:21 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BFF0FB96 for ; Mon, 7 Nov 2022 05:03:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1667826202; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=+cEiL9IFBvjHgRX8A9E1dFy3V6d+XvdXPIdvJQshRw0=; b=b7aoMnGv/mGee9VvR6AkUD8WhNrsF+fCwXf8Prrhje11kv3fNwEty+KWPdImKyjLU+AbBK 4FLSl62v9bl/6r3YbQwHHVjRtsICK9zter0ErG+agWDrvUChhW9LktbWJ9yeR4SYAiaeI2 Adv1Vzny/lo3V387WDngsZdEMSfp9Bk= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-612-wgZRUeZBOxe-M3M_KuO2gA-1; Mon, 07 Nov 2022 08:03:17 -0500 X-MC-Unique: wgZRUeZBOxe-M3M_KuO2gA-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 68A9529ABA35; Mon, 7 Nov 2022 13:03:17 +0000 (UTC) Received: from warthog.procyon.org.uk (unknown [10.33.37.22]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5F1A140C6EC2; Mon, 7 Nov 2022 13:03:16 +0000 (UTC) Organization: Red Hat UK Ltd. Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 3798903 From: David Howells In-Reply-To: References: <886076cfa6f547d22765c522177d33cf621013d2.1666928993.git.ritesh.list@gmail.com> <20221028210422.GC3600936@dread.disaster.area> <7699.1667487070@warthog.procyon.org.uk> To: Christoph Hellwig Cc: dhowells@redhat.com, Matthew Wilcox , Dave Chinner , "Ritesh Harjani (IBM)" , linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, "Darrick J . Wong" , Aravinda Herle Subject: Re: [RFC 2/2] iomap: Support subpage size dirty tracking to improve write performance MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1530986.1667826195.1@warthog.procyon.org.uk> Date: Mon, 07 Nov 2022 13:03:15 +0000 Message-ID: <1530987.1667826195@warthog.procyon.org.uk> X-Scanned-By: MIMEDefang 3.1 on 10.11.54.2 Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org Christoph Hellwig wrote: > The core iomap code (fs/iomap/iter.c) does not. Most users of it > are block device centric right now, but for example the dax.c uses > iomap for byte level DAX accesses without ever looking at a bdev, > and seek.c and fiemap.c do not make any assumptions on the backend > implementation. Whilst that is true, what's in iter.c is extremely minimal and most definitely not sufficient. There's no retry logic, for example: what happens when we try poking the cache and the cache says "no data"? We have to go back and redivide the missing bits of the request as the netfs granularity may not match that of the cache. Also, how to deal with writes that have to be duplicated to multiple servers that don't all have the same wsize? Then functions like iomap_read_folio(), iomap_readahead(), etc. *do* use submit_bio(). These would seem like they're meant to be the main entry points into iomap. Add to that struct iomap_iter has two bdev pointers and two dax pointers and the iomap_ioend struct assumes bio structs are going to be involved. Also, there's struct iomap_page - I'm hoping to avoid the need for a dangly struct on each page. I *think* I only need an extra couple of bits per page to discriminate between pages that need writing to the cache, pages that need writing to the server, and pages that need to go to both - but I think it might be possible to keep track of that in a separate list. The vast majority of write patterns are {open,write,write,...,write,close} and for such I just need a single tracking struct. David