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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 829C3C77B7F for ; Fri, 19 May 2023 15:53:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232277AbjESPxo (ORCPT ); Fri, 19 May 2023 11:53:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33578 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231124AbjESPxn (ORCPT ); Fri, 19 May 2023 11:53:43 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 61000B2; Fri, 19 May 2023 08:53:42 -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=USlAGqydtnLM3TYHWN6L8pKx67GkcR3rUcBpLI3d92s=; b=G/ydLPvEq3QNDQSGLbVpkoPsd8 i3AjboE9lWpFNQxzRYZ7AssvFe7g4D6JXMP5pXRIs5YmKrt0kOB+8P0sYAcJzlG7obOQ69lYNwmH1 DfsYTD2AZB5jm16Q/SdZVPMQqBpUik//d8s8sFtveSWTbCJGoRk713TVux7kNCOFe2TDybWdp9dGg 92Nr0+busVJh8lmT6Dw+5pp8mvvW5naYEz+NyFLDTfM1llhnEMq5Xd/Z+btwQKhwmMWiJYJ5HuBE4 C6NPjKZCV1KcvoUT0Ut1brnAp7COVvFa37m27HJlIGzmuNnrN6CXcUrh9xipGceSnxy+i+D2eaZiG TFcjlosw==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1q02QD-006eus-GU; Fri, 19 May 2023 15:53:37 +0000 Date: Fri, 19 May 2023 16:53:37 +0100 From: Matthew Wilcox To: Ritesh Harjani Cc: Christoph Hellwig , linux-xfs@vger.kernel.org, linux-fsdevel@vger.kernel.org, Dave Chinner , Brian Foster , Ojaswin Mujoo , Disha Goel Subject: Re: [RFCv5 4/5] iomap: Allocate iop in ->write_begin() early Message-ID: References: <875y8owdrm.fsf@doe.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <875y8owdrm.fsf@doe.com> Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org On Fri, May 19, 2023 at 08:48:37PM +0530, Ritesh Harjani wrote: > Christoph Hellwig writes: > > > On Mon, May 08, 2023 at 12:57:59AM +0530, Ritesh Harjani (IBM) wrote: > >> Earlier when the folio is uptodate, we only allocate iop at writeback > > > > s/Earlier/Currently/ ? > > > >> time (in iomap_writepage_map()). This is ok until now, but when we are > >> going to add support for per-block dirty state bitmap in iop, this > >> could cause some performance degradation. The reason is that if we don't > >> allocate iop during ->write_begin(), then we will never mark the > >> necessary dirty bits in ->write_end() call. And we will have to mark all > >> the bits as dirty at the writeback time, that could cause the same write > >> amplification and performance problems as it is now. > >> > >> However, for all the writes with (pos, len) which completely overlaps > >> the given folio, there is no need to allocate an iop during > >> ->write_begin(). So skip those cases. > > > > This reads a bit backwards, I'd suggest to mention early > > allocation only happens for sub-page writes before going into the > > details. > > > > sub-page is a bit confusing here. Because we can have a large folio too > with blocks within that folio. So we decided to go with per-block > terminology [1]. > > [1]: https://lore.kernel.org/linux-xfs/ZFR%2FGuVca5nFlLYF@casper.infradead.org/ > > I am guessing you would like to me to re-write the above para. Is this better? > > "We dont need to allocate an iop in ->write_begin() for writes where the > position and length completely overlap with the given folio. > Therefore, such cases are skipped." ... and reorder that paragraph to be first.