Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp1097202ybl; Fri, 30 Aug 2019 11:48:30 -0700 (PDT) X-Google-Smtp-Source: APXvYqxk5R144TyxXRtsFDeVMcsPf9IBkvviXV3xT90GJPAD+X5SlHJenDz0ANDoEAJTZBs4tzHn X-Received: by 2002:a62:e50f:: with SMTP id n15mr17056194pff.208.1567190910638; Fri, 30 Aug 2019 11:48:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567190910; cv=none; d=google.com; s=arc-20160816; b=kTonMsNABwIkVq6LnCE4RTbqoEnTxI8JfzFfOigT6bBWtuIaTpXSaGBB7ZhRcJkVQA Aca+GZJAATIcw+QIv7X19qnmgj0wJvAc9E9z5Ol4XtBgeRBYMfRyOLvWro+oLluoCil8 PB8eeIOC8/w0YBdAondCvFi/0jL+IyEeIRSErUtUJaYKBqHo1ZrG3GdSCyWH7HZF90tg c3Nm7F2aFAhP6sGEiUIi/HAuy+VJybA9bwYVNZju3FE7ePMX6HKJGKp5a8ZeaFaqCv5F 2YWtEXUynLPYQKGukDfKOLx4LzBAWd+MqdQUNj9EfbK3abQUB5BoFLdhY32DhPcGN5Lj qNRA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=5+pF8cEmYpCXsyTuv/IKjaU9Z046PPinGvzR3UdQ0ic=; b=LzBbujqU4VF5G/WIU/a2slfgwNBB4ktU8kgXXQMGAjiuAmKRAkZucRS02YmhRj++g0 0/GAK93HlG+EZa4o112L2014gXg8QOUxzFRKSR4FBQFF/tWe/1SokeqCPI38Z/ocIxvI 9s2sxM31s3BlFrQgh/QAmpDh1m7gVAQ1ETs3IJTqIfljVam6Pgc2EMMwIyCd3vOq1iE0 85fumoBwQjkek0zMcJbRW7MJAZDnDP4JSqQ1uFiNeFf9jlj0c07n/qk7ngtybatGAjdY 77mVfDJCku/W2qSUF5bRpWCj8FQF6sMuakczOZZQ3OuoGB6YMFipOtzAZk/t3st6ezzs Hkxg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x18si6254039pff.208.2019.08.30.11.48.15; Fri, 30 Aug 2019 11:48:30 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728145AbfH3Sq7 (ORCPT + 99 others); Fri, 30 Aug 2019 14:46:59 -0400 Received: from szxga08-in.huawei.com ([45.249.212.255]:42968 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727304AbfH3Sq7 (ORCPT ); Fri, 30 Aug 2019 14:46:59 -0400 Received: from DGGEMM404-HUB.china.huawei.com (unknown [172.30.72.55]) by Forcepoint Email with ESMTP id 6A8539DBA69EB7AA3A3A; Sat, 31 Aug 2019 02:46:56 +0800 (CST) Received: from dggeme762-chm.china.huawei.com (10.3.19.108) by DGGEMM404-HUB.china.huawei.com (10.3.20.212) with Microsoft SMTP Server (TLS) id 14.3.439.0; Sat, 31 Aug 2019 02:46:55 +0800 Received: from architecture4 (10.140.130.215) by dggeme762-chm.china.huawei.com (10.3.19.108) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1591.10; Sat, 31 Aug 2019 02:46:54 +0800 Date: Sat, 31 Aug 2019 02:46:06 +0800 From: Gao Xiang To: Christoph Hellwig CC: Alexander Viro , Greg Kroah-Hartman , Andrew Morton , Stephen Rothwell , Theodore Ts'o , "Pavel Machek" , David Sterba , Amir Goldstein , "Darrick J . Wong" , "Dave Chinner" , Jaegeuk Kim , Jan Kara , Linus Torvalds , , , LKML , , Chao Yu , Miao Xie , Li Guifu , Fang Wei Subject: Re: [PATCH v6 05/24] erofs: add inode operations Message-ID: <20190830184606.GA175612@architecture4> References: <20190802125347.166018-1-gaoxiang25@huawei.com> <20190802125347.166018-6-gaoxiang25@huawei.com> <20190829102426.GE20598@infradead.org> <20190829115922.GG64893@architecture4> <20190830164205.GD29603@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20190830164205.GD29603@infradead.org> User-Agent: Mutt/1.9.4 (2018-02-28) X-Originating-IP: [10.140.130.215] X-ClientProxiedBy: dggeme708-chm.china.huawei.com (10.1.199.104) To dggeme762-chm.china.huawei.com (10.3.19.108) X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Christoph, On Fri, Aug 30, 2019 at 09:42:05AM -0700, Christoph Hellwig wrote: > On Thu, Aug 29, 2019 at 07:59:22PM +0800, Gao Xiang wrote: > > On Thu, Aug 29, 2019 at 03:24:26AM -0700, Christoph Hellwig wrote: > > > > [] > > > > > > > > > + > > > > + /* fill last page if inline data is available */ > > > > + err = fill_inline_data(inode, data, ofs); > > > > > > Well, I think you should move the is_inode_flat_inline and > > > (S_ISLNK(inode->i_mode) && inode->i_size < PAGE_SIZE) checks from that > > > helper here, as otherwise you make everyone wonder why you'd always > > > fill out the inline data. > > > > Currently, fill_inline_data() only fills for fast symlink, > > later we can fill any tail-end block (such as dir block) > > for our requirements. > > So change it when that later changes actually come in. And even then > having the checks outside the function is a lot more obvious. Okay. > > > And I think that is minor. > > The problem is that each of these issues might appear minor on their > own. But combined a lot of the coding style choices lead to code that > is more suitable an obsfucated code contest than the Linux kernel as > trying to understand even just a few places requires jumping through > tons of helpers with misleading names and spread over various files. > > > The consideration is simply because iget_locked performs better > > than iget5_locked. > > In what benchmark do the differences show up? In a word, no benchmark here, just because "unsigned long on 32-bit platforms is 4 bytes." but erofs nid is a 64-bit number. iget_locked will do find_inode_fast (no callback at all) rather than iget5_locked --> find_inode (test callback) -> inode_insert5(set callback) for each new inode. For most 64-bit platforms, iget_locked is enough, 32-bit platforms become rare... Thanks, Gao Xiang