Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp4631960pxb; Tue, 25 Jan 2022 15:02:26 -0800 (PST) X-Google-Smtp-Source: ABdhPJw5v02brdxJ6jGYEiuOUBnzot4qaN0r+o7IPhgio4S5UI9ZFVpD5Soz2XWLqFcQtokrzTKV X-Received: by 2002:a17:907:9720:: with SMTP id jg32mr11075082ejc.121.1643151746354; Tue, 25 Jan 2022 15:02:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643151746; cv=none; d=google.com; s=arc-20160816; b=xVsUbinDeq60P28g4wxzgQRy/RZ18MtZEMRcc7f8CFKiliKRymBeBLCKpsxvfT0bXG lp9A3bMJrUoGnHiG62gi5m3+20jZsAYxatX/KzzjVcNrbTHZj8WCvdcZ9wR7ARgg4Tld jy+q6VPRiu+LUc6W4+OuayFzFnBGpNpf84ryUeZCTHCNPbGnqCa/QZhkUf0Mceu3/jPG dlPLp1KzIt+PvoxHQBS+emIRhQ8Cqev3pha+bJT5ia5/Jlf8urZuJkmFJCxR3K5+MMHr REsfFXLFa2RAxQt+wGj365sedNRJVADK1P9bxTuB24lv5OAm11AMccOYlHJshjMBheMO l8Cw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:content-transfer-encoding :content-id:mime-version:subject:cc:to:references:in-reply-to:from :organization:dkim-signature; bh=BgT1E20ri3cxt8CbRBVfeIbwdx60ZOrpnL5xCfuxcBk=; b=cltXy7ZKtSuZGylNPsv0KJlKjCn1hzgV4q3nmSSWyxBxeT35W8q8lV620uF+00VpiV TCKy2QAiyWU9+fNy7Hm2raMbnet8bCLJHoNwgui7NVxf/AE0i4W+9VZA533yXYYMjPWQ xv0gAb4o18DZ5o/XS296ibdIsU6bMbKK94vDlXq+qNJzAl7xOTkXdXS/YPiFtu8BWEEa rdJ8C76AvFgkK0cnkso7SX2bg6RZNlkJzffaMHfP47oF0lXzPQ31KfiqppOmfhtmVlZj +u/VZ04Vh12DOS1D09QjgmvhzOF/1TrEAC12E45opVrFtHIV2CVUMJ5UmNVBWWQHlhOc kb5Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=UzoPVfyk; 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=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id jg3si4285321ejc.30.2022.01.25.15.02.02; Tue, 25 Jan 2022 15:02:26 -0800 (PST) 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; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=UzoPVfyk; 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=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236417AbiAYQUj (ORCPT + 99 others); Tue, 25 Jan 2022 11:20:39 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:29267 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1583039AbiAYQQi (ORCPT ); Tue, 25 Jan 2022 11:16:38 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1643127384; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=BgT1E20ri3cxt8CbRBVfeIbwdx60ZOrpnL5xCfuxcBk=; b=UzoPVfykBMwMUildr4uCFagYeMqfxglf3lTvi0bDKJ0GoBwr8oZPQvkhpgN/y7mvjsxkIA PQtFxCbQOeioeL+ST4JWePAbNgId6fcZeg9Mfxk7/yfepC28Wkn/3Z1qi2VqooySiekFkS y2m1x+K1KjiKzkg6gUhkRe0Kjqtixlc= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-597-tiOAcsb0MG29xsEXCYTEQg-1; Tue, 25 Jan 2022 11:16:22 -0500 X-MC-Unique: tiOAcsb0MG29xsEXCYTEQg-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id C913639385; Tue, 25 Jan 2022 16:16:19 +0000 (UTC) Received: from warthog.procyon.org.uk (unknown [10.33.36.5]) by smtp.corp.redhat.com (Postfix) with ESMTP id 62E6484D08; Tue, 25 Jan 2022 16:15:31 +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: <20220118131216.85338-1-jefflexu@linux.alibaba.com> References: <20220118131216.85338-1-jefflexu@linux.alibaba.com> To: Jeffle Xu Cc: dhowells@redhat.com, linux-cachefs@redhat.com, xiang@kernel.org, chao@kernel.org, linux-erofs@lists.ozlabs.org, linux-fsdevel@vger.kernel.org, joseph.qi@linux.alibaba.com, bo.liu@linux.alibaba.com, tao.peng@linux.alibaba.com, gerry@linux.alibaba.com, eguan@linux.alibaba.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 00/20] fscache,erofs: fscache-based demand-read semantics MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <2815557.1643127330.1@warthog.procyon.org.uk> Content-Transfer-Encoding: quoted-printable Date: Tue, 25 Jan 2022 16:15:30 +0000 Message-ID: <2815558.1643127330@warthog.procyon.org.uk> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Jeffle Xu wrote: > The following issues still need further discussion. Thanks for your time > and patience. > = > 1. I noticed that there's refactoring of netfs library[1], > ... > [1] https://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs.gi= t/log/?h=3Dnetfs-lib Yes. I'm working towards getting netfslib to do handling writes and dio a= s well as reads, along with content crypto/compression, and the idea I'm aim= ing towards is that you just point your address_space_ops at netfs directly if possible - but it's going to require its own context now to manage pending writes. See my netfs-experimental branch for more of that - it's still a work in progress, though. Btw, you could set rreq->netfs_priv in ->init_rreq() rather than passing i= t in to netfs_readpage(). > 2. The current implementation will severely conflict with the > refactoring of netfs library[1][2]. The assumption of 'struct > netfs_i_context' [2] is that, every file in the upper netfs will > correspond to only one backing file. While in our scenario, one file in > erofs can correspond to multiple backing files. That is, the content of > one file can be divided into multiple chunks, and are distrubuted over > multiple blob files, i.e. multiple backing files. Currently I have no > good idea solving this conflic. I can think of a couple of options to explore: (1) Duplicate the cachefiles backend. You can discard a lot of it, since= a much of it is concerned with managing local modifications - which you= 're not going to do since you have a R/O filesystem and you're looking at importing files into the cache externally to the kernel. I would suggest looking to see if you can do the blob mapping in the backend rather than passing the offset down. Maybe make the cookie i= ndex key hold the index too, e.g. "/path/to/file+offset". Btw, do you still need cachefilesd for its culling duties? (2) Do you actually need to go through netfslib? Might it be easier to c= all fscache_read() directly? Have a look at fs/nfs/fscache.c > Besides there are still two quetions: > - What's the plan of [1]? When is it planned to be merged? Hopefully next merge window, but that's going to depend on a number of thi= ngs. > - It seems that all upper fs using fscache is going to use netfs API, > while the APIs like fscache_read_or_alloc_page() are deprecated. Is > that true? fscache_read_or_alloc_page() is gone completely. You don't have to use the netfs API. You can talk to fscache directly, doing DIO from the cache to an xarray-class iov_iter constructed from your inode's pagecache. netfslib provides/will provide a number of services, such as multipage folios, transparent caching, crypto, compression and hiding the existence = of pages/folios from the filesystem as entirely as possible. However, you already have some of these implemented on top of iomap for the blockdev interface, it would appear. David