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=-2.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=no 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 4F265C43214 for ; Thu, 26 Aug 2021 06:32:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2DA0860551 for ; Thu, 26 Aug 2021 06:32:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239510AbhHZGd3 (ORCPT ); Thu, 26 Aug 2021 02:33:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34118 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238082AbhHZGd2 (ORCPT ); Thu, 26 Aug 2021 02:33:28 -0400 Received: from mail-io1-xd2e.google.com (mail-io1-xd2e.google.com [IPv6:2607:f8b0:4864:20::d2e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 07A72C061757; Wed, 25 Aug 2021 23:32:41 -0700 (PDT) Received: by mail-io1-xd2e.google.com with SMTP id a21so2372538ioq.6; Wed, 25 Aug 2021 23:32:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=pIwUqES0KjF4tM/DUynoGjEfY9vOS2sW1S6XuW00tG4=; b=TSFlmcYGPwVV3W4+2ErCsSHNh6wlzQp4FgnmaFis1r3/gkp74EXyDetcQZ6Pisp40/ i5a08/rUYKh/Yzx3xUsRcdwzurUSYAbvmYxlKX2Q+L4WajEz4PfBGXv1kYo7sTAUm/m9 Vd6Dc4Yh/PF6AAQ+L4hAbePLuNq+AzlCg6HRj31SeUfiPbLqiCQad9IAHkbhHZ7pncfA AJ0f+cJAD9Sa6JZ3/Z+GrL0ZCwWm2LX69WrjhQci46sYsDL1odW01B4pKE2wJr+YMD7i YmOnG8wcJdCr7XN9urEs/rwAUvzXqSpoQVdOFZHYTB7LeIJH1UzcDD1EQQbncN334Jfz GRNQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=pIwUqES0KjF4tM/DUynoGjEfY9vOS2sW1S6XuW00tG4=; b=KZqLphU7Fc9GYTVo2XO167vd4Wtta95QKf/zfxCW5woxWCnctvOQgIR+OzQLhgbRaa muj07aUC+7VE/8exJV45I9MUcfIlykBcmrMn1GG4iFW7PKPtDxTH2NHbvUgeqbPnZJIJ cRDOCq+isTYmzrnMI/2zcu6ak0AlcjsT+AOsRX+p0ADiYtSApcBnLOSEe7rdaGP35H+3 2L8cxhjjVVUkW0dMFtWRb52lZnbkBfb9Jcd9BV9jaAwR8kRovDehRPCyvJGJnE9Jjtd9 UHNJ8UWt74Hk5py6BiSJjvnAhFSdKwIylHggy2HEeKG7QRDCGHYZ1ZTDVMZ9lso5W30T v1CQ== X-Gm-Message-State: AOAM532Ashbq+x0Nck9V457ZDIzPTV9HhJS5xvgvSrQhKJWgIkoVNmYj PiAmVbqO1dgj6D1K9stnIwMLYx1fIC62Qg+5z9M= X-Google-Smtp-Source: ABdhPJxa1fbod7eShy2ojEpRZwrFd+0pNfPFx7oe6YmtF1RYOLKdfUUG+HqbHDUwOn7hZW+KxQ5wONL838ljkbGRPIk= X-Received: by 2002:a5d:8b03:: with SMTP id k3mr1757843ion.203.1629959560394; Wed, 25 Aug 2021 23:32:40 -0700 (PDT) MIME-Version: 1.0 References: <1957060.1629820467@warthog.procyon.org.uk> <92cbfb8f-7418-15d5-c469-d7861e860589@rasmusvillemoes.dk> In-Reply-To: <92cbfb8f-7418-15d5-c469-d7861e860589@rasmusvillemoes.dk> From: Amir Goldstein Date: Thu, 26 Aug 2021 09:32:28 +0300 Message-ID: Subject: Re: [GIT PULL] Memory folios for v5.15 To: Rasmus Villemoes Cc: Christoph Hellwig , "Theodore Ts'o" , Matthew Wilcox , Linus Torvalds , David Howells , Johannes Weiner , Linux-MM , linux-fsdevel , Linux Kernel Mailing List , Andrew Morton Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Aug 25, 2021 at 12:02 PM Rasmus Villemoes wrote: > > On 25/08/2021 08.32, Christoph Hellwig wrote: > > On Tue, Aug 24, 2021 at 03:44:48PM -0400, Theodore Ts'o wrote: > >> The problem is whether we use struct head_page, or folio, or mempages, > >> we're going to be subsystem users' faces. And people who are using it > >> every day will eventually get used to anything, whether it's "folio" > >> or "xmoqax", we sould give a thought to newcomers to Linux file system > >> code. If they see things like "read_folio()", they are going to be > >> far more confused than "read_pages()" or "read_mempages()". > > > > Are they? It's not like page isn't some randomly made up term > > as well, just one that had a lot more time to spread. > > > >> So if someone sees "kmem_cache_alloc()", they can probably make a > >> guess what it means, and it's memorable once they learn it. > >> Similarly, something like "head_page", or "mempages" is going to a bit > >> more obvious to a kernel newbie. So if we can make a tiny gesture > >> towards comprehensibility, it would be good to do so while it's still > >> easier to change the name. > > > > All this sounds really weird to me. I doubt there is any name that > > nicely explains "structure used to manage arbitrary power of two > > units of memory in the kernel" very well. So I agree with willy here, > > let's pick something short and not clumsy. I initially found the folio > > name a little strange, but working with it I got used to it quickly. > > And all the other uggestions I've seen s far are significantly worse, > > especially all the odd compounds with page in it. > > > > A comment from the peanut gallery: I find the name folio completely > appropriate and easy to understand. Our vocabulary is already strongly > inspired by words used in the world of printed text: the smallest unit > of information is a char(acter) [ok, we usually call them bytes], a few > characters make up a word, there's a number of words to each (cache) > line, and a number of those is what makes up a page. So obviously a > folio is something consisting of a few pages. > > Are the analogies perfect? Of course not. But they are actually quite > apt; words, lines and pages don't universally have one size, but they do > form a natural hierarchy describing how we organize information. > > Splitting a word across lines can slow down the reader so should be > avoided... [sorry, couldn't resist]. > And if we ever want to manage page cache using an arbitrary number of contiguous filios, we can always saw them into a scroll ;-) Thanks, Amir. 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=-2.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=no 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 17CCEC432BE for ; Thu, 26 Aug 2021 06:32:43 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 8AA1660551 for ; Thu, 26 Aug 2021 06:32:42 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 8AA1660551 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 03D258D0002; Thu, 26 Aug 2021 02:32:42 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id F08A88D0001; Thu, 26 Aug 2021 02:32:41 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id DD0128D0002; Thu, 26 Aug 2021 02:32:41 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id BF3E78D0001 for ; Thu, 26 Aug 2021 02:32:41 -0400 (EDT) Received: from smtpin29.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 56E088249980 for ; Thu, 26 Aug 2021 06:32:41 +0000 (UTC) X-FDA: 78516263322.29.2F0881A Received: from mail-io1-f45.google.com (mail-io1-f45.google.com [209.85.166.45]) by imf26.hostedemail.com (Postfix) with ESMTP id 1616720019DE for ; Thu, 26 Aug 2021 06:32:40 +0000 (UTC) Received: by mail-io1-f45.google.com with SMTP id a15so2386880iot.2 for ; Wed, 25 Aug 2021 23:32:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=pIwUqES0KjF4tM/DUynoGjEfY9vOS2sW1S6XuW00tG4=; b=TSFlmcYGPwVV3W4+2ErCsSHNh6wlzQp4FgnmaFis1r3/gkp74EXyDetcQZ6Pisp40/ i5a08/rUYKh/Yzx3xUsRcdwzurUSYAbvmYxlKX2Q+L4WajEz4PfBGXv1kYo7sTAUm/m9 Vd6Dc4Yh/PF6AAQ+L4hAbePLuNq+AzlCg6HRj31SeUfiPbLqiCQad9IAHkbhHZ7pncfA AJ0f+cJAD9Sa6JZ3/Z+GrL0ZCwWm2LX69WrjhQci46sYsDL1odW01B4pKE2wJr+YMD7i YmOnG8wcJdCr7XN9urEs/rwAUvzXqSpoQVdOFZHYTB7LeIJH1UzcDD1EQQbncN334Jfz GRNQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=pIwUqES0KjF4tM/DUynoGjEfY9vOS2sW1S6XuW00tG4=; b=l3qwxTYWYe7bqqKh3PnMoiy2/hWI8HDB6dnUcqGf4dNJEwB2hdASMTP5j34i/7mtO6 x/2ZP0/UKlmoaFr02X4vG1G6d7RUNn00JTiLJvSOBL6QEzuYNUJ6ZUZOSQl+0qbAv3ax ubeh0UWGIkYagyf1L7zAWo5sEeVN7+CBPu1qfrkG8hGEqY3Eugg6Nn6h96MQ9hXPtu7r 0aapBXjpbL4MeJUrLNIeWb4N7jAUojCK503oHJNSPqorUc/ekEsqLCRMBhAPe8nnTCCP i7JEBSdfek7qrkli9zR+8jJVuB9kHMhfUOCJMpc0Oc4KFtAK3a3qhoAaJyfttcjdAEqE LOVA== X-Gm-Message-State: AOAM533DVADQIViWbek5nkSdsvkSApxLJeJiiyzMlhFEdt6ZxwtvWdNQ 1QfhLk5XMgLB76EOleWk6REojQP6kHlm9cwAfOI= X-Google-Smtp-Source: ABdhPJxa1fbod7eShy2ojEpRZwrFd+0pNfPFx7oe6YmtF1RYOLKdfUUG+HqbHDUwOn7hZW+KxQ5wONL838ljkbGRPIk= X-Received: by 2002:a5d:8b03:: with SMTP id k3mr1757843ion.203.1629959560394; Wed, 25 Aug 2021 23:32:40 -0700 (PDT) MIME-Version: 1.0 References: <1957060.1629820467@warthog.procyon.org.uk> <92cbfb8f-7418-15d5-c469-d7861e860589@rasmusvillemoes.dk> In-Reply-To: <92cbfb8f-7418-15d5-c469-d7861e860589@rasmusvillemoes.dk> From: Amir Goldstein Date: Thu, 26 Aug 2021 09:32:28 +0300 Message-ID: Subject: Re: [GIT PULL] Memory folios for v5.15 To: Rasmus Villemoes Cc: Christoph Hellwig , "Theodore Ts'o" , Matthew Wilcox , Linus Torvalds , David Howells , Johannes Weiner , Linux-MM , linux-fsdevel , Linux Kernel Mailing List , Andrew Morton Content-Type: text/plain; charset="UTF-8" Authentication-Results: imf26.hostedemail.com; dkim=pass header.d=gmail.com header.s=20161025 header.b=TSFlmcYG; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf26.hostedemail.com: domain of amir73il@gmail.com designates 209.85.166.45 as permitted sender) smtp.mailfrom=amir73il@gmail.com X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: 1616720019DE X-Stat-Signature: 5cbe69ogj4cu5dh7rjfmjysd7rr4mizm X-HE-Tag: 1629959560-476111 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Wed, Aug 25, 2021 at 12:02 PM Rasmus Villemoes wrote: > > On 25/08/2021 08.32, Christoph Hellwig wrote: > > On Tue, Aug 24, 2021 at 03:44:48PM -0400, Theodore Ts'o wrote: > >> The problem is whether we use struct head_page, or folio, or mempages, > >> we're going to be subsystem users' faces. And people who are using it > >> every day will eventually get used to anything, whether it's "folio" > >> or "xmoqax", we sould give a thought to newcomers to Linux file system > >> code. If they see things like "read_folio()", they are going to be > >> far more confused than "read_pages()" or "read_mempages()". > > > > Are they? It's not like page isn't some randomly made up term > > as well, just one that had a lot more time to spread. > > > >> So if someone sees "kmem_cache_alloc()", they can probably make a > >> guess what it means, and it's memorable once they learn it. > >> Similarly, something like "head_page", or "mempages" is going to a bit > >> more obvious to a kernel newbie. So if we can make a tiny gesture > >> towards comprehensibility, it would be good to do so while it's still > >> easier to change the name. > > > > All this sounds really weird to me. I doubt there is any name that > > nicely explains "structure used to manage arbitrary power of two > > units of memory in the kernel" very well. So I agree with willy here, > > let's pick something short and not clumsy. I initially found the folio > > name a little strange, but working with it I got used to it quickly. > > And all the other uggestions I've seen s far are significantly worse, > > especially all the odd compounds with page in it. > > > > A comment from the peanut gallery: I find the name folio completely > appropriate and easy to understand. Our vocabulary is already strongly > inspired by words used in the world of printed text: the smallest unit > of information is a char(acter) [ok, we usually call them bytes], a few > characters make up a word, there's a number of words to each (cache) > line, and a number of those is what makes up a page. So obviously a > folio is something consisting of a few pages. > > Are the analogies perfect? Of course not. But they are actually quite > apt; words, lines and pages don't universally have one size, but they do > form a natural hierarchy describing how we organize information. > > Splitting a word across lines can slow down the reader so should be > avoided... [sorry, couldn't resist]. > And if we ever want to manage page cache using an arbitrary number of contiguous filios, we can always saw them into a scroll ;-) Thanks, Amir.