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.7 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING, SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY 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 BCD9AC07E9D for ; Mon, 19 Jul 2021 13:45:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 96771610A5 for ; Mon, 19 Jul 2021 13:45:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240348AbhGSNFS (ORCPT ); Mon, 19 Jul 2021 09:05:18 -0400 Received: from out30-133.freemail.mail.aliyun.com ([115.124.30.133]:51621 "EHLO out30-133.freemail.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240279AbhGSNFR (ORCPT ); Mon, 19 Jul 2021 09:05:17 -0400 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R971e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=alimailimapcm10staff010182156082;MF=hsiangkao@linux.alibaba.com;NM=1;PH=DS;RN=11;SR=0;TI=SMTPD_---0UgH5Ozl_1626702353; Received: from B-P7TQMD6M-0146.local(mailfrom:hsiangkao@linux.alibaba.com fp:SMTPD_---0UgH5Ozl_1626702353) by smtp.aliyun-inc.com(127.0.0.1); Mon, 19 Jul 2021 21:45:55 +0800 Date: Mon, 19 Jul 2021 21:45:53 +0800 From: Gao Xiang To: Christoph Hellwig Cc: Matthew Wilcox , Andreas Gr?nbacher , linux-erofs@lists.ozlabs.org, Linux FS-devel Mailing List , LKML , "Darrick J. Wong" , Chao Yu , Liu Bo , Joseph Qi , Liu Jiang Subject: Re: [PATCH 1/2] iomap: support tail packing inline read Message-ID: Mail-Followup-To: Christoph Hellwig , Matthew Wilcox , Andreas Gr?nbacher , linux-erofs@lists.ozlabs.org, Linux FS-devel Mailing List , LKML , "Darrick J. Wong" , Chao Yu , Liu Bo , Joseph Qi , Liu Jiang References: 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 Mon, Jul 19, 2021 at 12:19:34PM +0100, Christoph Hellwig wrote: > On Sat, Jul 17, 2021 at 07:40:41PM +0100, Matthew Wilcox wrote: > > Well, either sense of a WARN_ON is wrong. > > > > For a file which is PAGE_SIZE + 3 bytes in size, to_iomap_page() will > > be NULL. For a file which is PAGE_SIZE/2 + 3 bytes in size, > > to_iomap_page() will not be NULL. (assuming the block size is <= > > PAGE_SIZE / 2). > > > > I think we need a prep patch that looks something like this: > > Something like this is where we should eventually end up, but it > also affects the read from disk case so we need to be careful. I also think it'd be better to leave this hunk as it-is (don't touch it in this patch), I mean just iop = iomap_page_create(inode, page); as https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/fs/iomap/buffered-io.c?id=229adf3c64dbeae4e2f45fb561907ada9fcc0d0c#n256 since iomap_read_inline_data() now calls iomap_set_range_uptodate() to set blocks uptodate rather than SetPageUptodate() directly and we also have iomap_page_release() as well. Some follow-up optimized patch can be raised up independently since it's somewhat out of current topic for now. Thanks, Gao Xiang 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.7 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING, SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY 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 75E5EC07E9B for ; Mon, 19 Jul 2021 13:46:06 +0000 (UTC) Received: from lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 12FFF610A5 for ; Mon, 19 Jul 2021 13:46:05 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 12FFF610A5 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.alibaba.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=linux-erofs-bounces+linux-erofs=archiver.kernel.org@lists.ozlabs.org Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4GT35m4F2Mz30Dl for ; Mon, 19 Jul 2021 23:46:04 +1000 (AEST) Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=linux.alibaba.com (client-ip=115.124.30.132; helo=out30-132.freemail.mail.aliyun.com; envelope-from=hsiangkao@linux.alibaba.com; receiver=) Received: from out30-132.freemail.mail.aliyun.com (out30-132.freemail.mail.aliyun.com [115.124.30.132]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4GT35h1f7kz2yMk for ; Mon, 19 Jul 2021 23:45:59 +1000 (AEST) X-Alimail-AntiSpam: AC=PASS; BC=-1|-1; BR=01201311R971e4; CH=green; DM=||false|; DS=||; FP=0|-1|-1|-1|0|-1|-1|-1; HT=alimailimapcm10staff010182156082; MF=hsiangkao@linux.alibaba.com; NM=1; PH=DS; RN=11; SR=0; TI=SMTPD_---0UgH5Ozl_1626702353; Received: from B-P7TQMD6M-0146.local(mailfrom:hsiangkao@linux.alibaba.com fp:SMTPD_---0UgH5Ozl_1626702353) by smtp.aliyun-inc.com(127.0.0.1); Mon, 19 Jul 2021 21:45:55 +0800 Date: Mon, 19 Jul 2021 21:45:53 +0800 From: Gao Xiang To: Christoph Hellwig Subject: Re: [PATCH 1/2] iomap: support tail packing inline read Message-ID: Mail-Followup-To: Christoph Hellwig , Matthew Wilcox , Andreas Gr?nbacher , linux-erofs@lists.ozlabs.org, Linux FS-devel Mailing List , LKML , "Darrick J. Wong" , Chao Yu , Liu Bo , Joseph Qi , Liu Jiang References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: X-BeenThere: linux-erofs@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development of Linux EROFS file system List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "Darrick J. Wong" , Andreas Gr?nbacher , LKML , Matthew Wilcox , Joseph Qi , Liu Bo , Linux FS-devel Mailing List , Liu Jiang , linux-erofs@lists.ozlabs.org Errors-To: linux-erofs-bounces+linux-erofs=archiver.kernel.org@lists.ozlabs.org Sender: "Linux-erofs" On Mon, Jul 19, 2021 at 12:19:34PM +0100, Christoph Hellwig wrote: > On Sat, Jul 17, 2021 at 07:40:41PM +0100, Matthew Wilcox wrote: > > Well, either sense of a WARN_ON is wrong. > > > > For a file which is PAGE_SIZE + 3 bytes in size, to_iomap_page() will > > be NULL. For a file which is PAGE_SIZE/2 + 3 bytes in size, > > to_iomap_page() will not be NULL. (assuming the block size is <= > > PAGE_SIZE / 2). > > > > I think we need a prep patch that looks something like this: > > Something like this is where we should eventually end up, but it > also affects the read from disk case so we need to be careful. I also think it'd be better to leave this hunk as it-is (don't touch it in this patch), I mean just iop = iomap_page_create(inode, page); as https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/fs/iomap/buffered-io.c?id=229adf3c64dbeae4e2f45fb561907ada9fcc0d0c#n256 since iomap_read_inline_data() now calls iomap_set_range_uptodate() to set blocks uptodate rather than SetPageUptodate() directly and we also have iomap_page_release() as well. Some follow-up optimized patch can be raised up independently since it's somewhat out of current topic for now. Thanks, Gao Xiang