Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp1488543pxv; Fri, 23 Jul 2021 09:28:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyy87/yMdRzc+JN73Va+2pSco+R2pJ89/FoqbhV4hAVawPg0FqPFbGyx9sIs6AXzeb8VOvP X-Received: by 2002:a05:6402:2789:: with SMTP id b9mr6494392ede.201.1627057688147; Fri, 23 Jul 2021 09:28:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627057688; cv=none; d=google.com; s=arc-20160816; b=FJy0aPdd10rGE8dqwFYUdWzKAaSwdUi49Jp+qvH1CjAagCe33NV1jqkFm74N+7d1Rq 8vd1TTwfapJYEzu7/SgizSgQk7XimNKOrVW54bl2ha+Zwfg1aKEarG/qenjyiZ22/DK6 UDAtQhBOPMGZw896FoMbWPHdkl28ehxc+AoND2LINZF9bt6C9jwmwQ1tV0Mx2UCjIZ+c S5Idfe4rIHlvghVhdDWupMeZErlZ4HX7llkmORqtJk7BE3nteVwEJndXx3ZWv7x2AsCZ qZ+E+/A1UpNcqeOkiU+ziLUq4AdP5cWIi2p9S5uo+KuJ7iKYmJK3b0siE+Vau14a2uWM Pcsw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:mail-followup-to:message-id:subject:cc:to:from:date; bh=ipuDABz7nPPv4eH7UcV0KuQiOethLOK3/ISu7xsk0FQ=; b=GADDpsPZ8o0dINGsk0ud1Jb4UraHCBQXD06l99HGthR4TVTVaxdar/8InWxe0ACeR5 C6DtjtL/ksxk6I+bNBZ1L73fkmjcRDiO3pIeDRef8V3/kGsvcQVewbtM6XZhdlzYSUfG m4S8UTSFqdiW8XttCCrokHb+kdLJXhnLWlvTCOUJsxZvOmb+OpGpFCiAHxB4p286R/I9 YovOHR5CTBfYtV2H/3F7SdRqlzGQS1fxZHtT3q7UGuRkyjKefD5J+nx2Uufh98KAfY0P sYleQz5+LC5fgeonpUGWZ/6pzjIcfj1GhvhiE3jzTodtWVIO3fg8C3NXSyK4vFejl7zZ ZYrQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id nb19si5847115ejc.87.2021.07.23.09.27.43; Fri, 23 Jul 2021 09:28:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229897AbhGWPng (ORCPT + 99 others); Fri, 23 Jul 2021 11:43:36 -0400 Received: from out30-42.freemail.mail.aliyun.com ([115.124.30.42]:53151 "EHLO out30-42.freemail.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229510AbhGWPnf (ORCPT ); Fri, 23 Jul 2021 11:43:35 -0400 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R151e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e04423;MF=hsiangkao@linux.alibaba.com;NM=1;PH=DS;RN=7;SR=0;TI=SMTPD_---0UgjV2MC_1627057445; Received: from B-P7TQMD6M-0146.local(mailfrom:hsiangkao@linux.alibaba.com fp:SMTPD_---0UgjV2MC_1627057445) by smtp.aliyun-inc.com(127.0.0.1); Sat, 24 Jul 2021 00:24:06 +0800 Date: Sat, 24 Jul 2021 00:24:04 +0800 From: Gao Xiang To: Matthew Wilcox Cc: Christoph Hellwig , linux-erofs@lists.ozlabs.org, linux-fsdevel@vger.kernel.org, LKML , "Darrick J . Wong" , Andreas Gruenbacher Subject: Re: [PATCH v6] iomap: support tail packing inline read Message-ID: Mail-Followup-To: Matthew Wilcox , Christoph Hellwig , linux-erofs@lists.ozlabs.org, linux-fsdevel@vger.kernel.org, LKML , "Darrick J . Wong" , Andreas Gruenbacher References: <20210722031729.51628-1-hsiangkao@linux.alibaba.com> <20210722053947.GA28594@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jul 23, 2021 at 04:56:35PM +0100, Matthew Wilcox wrote: > On Fri, Jul 23, 2021 at 11:23:38PM +0800, Gao Xiang wrote: > > Hi Matthew, > > > > On Fri, Jul 23, 2021 at 04:05:29PM +0100, Matthew Wilcox wrote: > > > On Thu, Jul 22, 2021 at 07:39:47AM +0200, Christoph Hellwig wrote: > > > > @@ -675,7 +676,7 @@ static size_t iomap_write_end_inline(struct inode *inode, struct page *page, > > > > > > > > flush_dcache_page(page); > > > > addr = kmap_atomic(page); > > > > - memcpy(iomap->inline_data + pos, addr + pos, copied); > > > > + memcpy(iomap_inline_buf(iomap, pos), addr + pos, copied); > > > > > > This is wrong; pos can be > PAGE_SIZE, so this needs to be > > > addr + offset_in_page(pos). > > > > Yeah, thanks for pointing out. It seems so, since EROFS cannot test > > such write path, previously it was disabled explicitly. I could > > update it in the next version as above. > > We're also missing a call to __set_page_dirty_nobuffers(). This > matters to nobody right now -- erofs is read-only and gfs2 only > supports inline data in the inode. I presume what is happening > for gfs2 is that at inode writeback time, it copies the ~60 bytes > from the page cache into the inode and then schedules the inode > for writeback. > > But logically, we should mark the page as dirty. It'll be marked > as dirty by ->mkwrite, should the page be mmaped, so gfs2 must > already cope with a dirty page for inline data. I'd suggest we still disable tail-packing inline for buffered write path until some real user for testing. I can see some (maybe) page writeback, inode writeback and inline converting cases which is somewhat complicated than just update like this. I suggest it could be implemented with some real users, at least it can provide the real write pattern and paths for testing. I will send the next version like my previous version to disable it until some real fs user cares and works out a real pattern. Thanks, Gao Xiang