Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp243285pxb; Thu, 26 Aug 2021 02:00:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyh2fNWrewXGBZBC92T7zX7gPMU+WNu7uXyEmQRH8faOOOne+XUv3sxUwFOdWPTd8RnlrZz X-Received: by 2002:aa7:cc83:: with SMTP id p3mr3112715edt.365.1629968459051; Thu, 26 Aug 2021 02:00:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629968459; cv=none; d=google.com; s=arc-20160816; b=o4lDM1zB9bns/+zjGkqZ53lx/fE//M2IdsNTPgM/oUyGdkHa+yt2iI6v58O9Zgz7pb Pg7ohOXtN8Fw6qsF+8etMFNjHalnOOsm5EPxODzeonyTrBgCYRN18jBE0BXBtQ8Ub3Jt QBvfsb8bwyfx1pbAaTdkUrQhtddhLvREYY6dlulhGS7Gy4m3HcLqFo0iC1N06mpjUMYv hL4eUKwOG45n4JbD8eHKQXRTavXt09c+JYJ5eJDRyQhh2YyA707d3DU/X7nDtUllx0Lr EuB9LauZBy3UvAWoiQv92NGUnM96kR8H+Ty9gJu4EUZykJ6RJWUZsbYtIZ9EOhkDkYYc Pw2g== 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-id:mime-version:subject :cc:to:references:in-reply-to:from:organization:dkim-signature; bh=cIdwTiP0NVTGucL/JR43xH/9VntQvDYubEEe+Wyv8Nc=; b=oIX+2Yam0xAt9D4e+FWGumNJaKi93kdjiuBTPCF6I4Y5apHnXUKWT0X2SzP2azAqti oBDQwoqJ3rNjpp14OlXseNfgAzupDMdjAF7Mz12jLa7k0kSFo4kkVojJ0e9qJ28owW54 uxgF74oX8SKlV/Uqxg4YKnFyyA8BTErLt40QHXqOLukYxWhT8fd2f/sbQGLc7ezt9P4d 42sLVr+IKdewvr3efUIqgI+7tRifgv5rNWSNrr3WfsoPymFiXVObrOsPmhJI4plnIfSp BUwZkFKaSuiz5hwNERfGT58vS44ZZ7LyB8dOKLtd7qeuV/Ra0iLcAdp/pOm4cD/7XZy1 ifxg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=V+GzbGYs; 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 z11si2242109ejo.318.2021.08.26.02.00.23; Thu, 26 Aug 2021 02:00:59 -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; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=V+GzbGYs; 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 S240737AbhHZI7A (ORCPT + 99 others); Thu, 26 Aug 2021 04:59:00 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:41888 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229785AbhHZI67 (ORCPT ); Thu, 26 Aug 2021 04:58:59 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1629968292; 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: in-reply-to:in-reply-to:references:references; bh=cIdwTiP0NVTGucL/JR43xH/9VntQvDYubEEe+Wyv8Nc=; b=V+GzbGYsdcSyCwKAk2QfCnK+UGjL1D0WU5oKGR9KxPjLkjNfZxbuN4Db8LfyuDShGBMsNu b4hsDkiLHYZgzenZ/I45JA8VjbZvPXkHNILDZoc3ONdnV2wCqT1cfTPi1UfvbvkAHEIFeP qYFvzlPChmMw0Y2ZeAKrbrJVQ0K5tdo= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-500-hF47ieCuMg-5hNZcWFij9A-1; Thu, 26 Aug 2021 04:58:11 -0400 X-MC-Unique: hF47ieCuMg-5hNZcWFij9A-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 7C19180292B; Thu, 26 Aug 2021 08:58:09 +0000 (UTC) Received: from warthog.procyon.org.uk (unknown [10.33.36.36]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5A92D60936; Thu, 26 Aug 2021 08:58:07 +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: References: To: Johannes Weiner Cc: dhowells@redhat.com, Matthew Wilcox , Linus Torvalds , linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, Andrew Morton Subject: Re: [GIT PULL] Memory folios for v5.15 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <2101396.1629968286.1@warthog.procyon.org.uk> Date: Thu, 26 Aug 2021 09:58:06 +0100 Message-ID: <2101397.1629968286@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 Johannes Weiner wrote: > But we're here in part because the filesystems have been too exposed > to the backing memory implementation details. So all I'm saying is, if > you're touching all the file cache interface now anyway, why not use > the opportunity to properly disconnect it from the reality of pages, > instead of making the compound page the new interface for filesystems. > > What's wrong with the idea of a struct cache_entry Well, the name's already taken, though only in cifs. And we have a *lot* of caches so just calling it "cache_entry" is kind of unspecific. > which can be > embedded wherever we want: in a page, a folio or a pageset. Or in the > future allocated on demand for actually have it be just a cache entry for the fs to read and write, > not also a compound page and an anon page etc. all at the same time. > > Even today that would IMO delineate more clearly between the file > cache data plane and the backing memory plane. It doesn't get in the > way of also fixing the base-or-compound mess inside MM code with > folio/pageset, either. One thing I like about Willy's folio concept is that, as long as everyone uses the proper accessor functions and macros, we can mostly ignore the fact that they're 2^N sized/aligned and they're composed of exact multiples of pages. What really matters are the correspondences between folio size/alignment and medium/IO size/alignment, so you could look on the folio as being a tool to disconnect the filesystem from the concept of pages. We could, in the future, in theory, allow the internal implementation of a folio to shift from being a page array to being a kmalloc'd page list or allow higher order units to be mixed in. The main thing we have to stop people from doing is directly accessing the members of the struct. There are some tricky bits: kmap and mmapped page handling, for example. Some of this can be mitigated by making iov_iters handle folios (the ITER_XARRAY type does, for example) and providing utilities to populate scatterlists. David