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 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0AA14CDB46E for ; Thu, 12 Oct 2023 15:03:02 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 8B17A8D012F; Thu, 12 Oct 2023 11:03:02 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 861A48D0002; Thu, 12 Oct 2023 11:03:02 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 7023A8D012F; Thu, 12 Oct 2023 11:03:02 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 61F278D0002 for ; Thu, 12 Oct 2023 11:03:02 -0400 (EDT) Received: from smtpin06.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 1C2E81206AC for ; Thu, 12 Oct 2023 15:03:02 +0000 (UTC) X-FDA: 81337127004.06.7652FD5 Received: from out-201.mta0.migadu.com (out-201.mta0.migadu.com [91.218.175.201]) by imf13.hostedemail.com (Postfix) with ESMTP id 3A141200B2 for ; Thu, 12 Oct 2023 15:02:38 +0000 (UTC) Authentication-Results: imf13.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=qh+sQi2+; spf=pass (imf13.hostedemail.com: domain of naoya.horiguchi@linux.dev designates 91.218.175.201 as permitted sender) smtp.mailfrom=naoya.horiguchi@linux.dev; dmarc=pass (policy=none) header.from=linux.dev ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1697122959; h=from:from:sender: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: in-reply-to:in-reply-to:references:references:dkim-signature; bh=RjcViyd2Fhk9iMtsIB4L9gySKen/F6NsFGsZ37IiSaI=; b=F/AG/Xo4YxvGZ10O0MZdwUicqcx4baJwH2WlszDGUMbnvYtY3Yy1QfzgnoqMl+68iDsI15 KUS0VGzO+3/w+mv+OWIh3UA4RMgripszo7Fc+gbWgodaKBDcA0GBKNYegrNCAUeCBD6GhU TwvXlm9JZ2cR82DtZ5kxOZ40A35NN+I= ARC-Authentication-Results: i=1; imf13.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=qh+sQi2+; spf=pass (imf13.hostedemail.com: domain of naoya.horiguchi@linux.dev designates 91.218.175.201 as permitted sender) smtp.mailfrom=naoya.horiguchi@linux.dev; dmarc=pass (policy=none) header.from=linux.dev ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1697122959; a=rsa-sha256; cv=none; b=APzIogvZF1HXkroV2fDAxM3EarNm2nNAbffb9LV+Qop+SviaKRhgdqH2KXQOG3/3XsYz+P zriVBr/zau+8WdTPhxmN1n4M1nBOoQHsplUHSlFrVCxnzsKg/5taPxrFr2mTtdyPROHbM1 gQ/uRZzIkgLLMqyldqjBqc68/E6A7Cs= Date: Fri, 13 Oct 2023 00:02:26 +0900 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1697122956; 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=RjcViyd2Fhk9iMtsIB4L9gySKen/F6NsFGsZ37IiSaI=; b=qh+sQi2+AwZtf3yb3TP3gZd3g09JYVCgAhKSM0xfGCLiCjjbUT1m8mW0IXi82EI3en1N5y 662DXTq/zsHoGArFquLa7xUi8nhZWazc5X+jWaJzY330XkHMienfF6P23UKc3/lVGIgLgc LoYahsX5YZ2pV4nsunvhAg/CM0Ks1AY= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Naoya Horiguchi To: David Hildenbrand Cc: linux-mm@kvack.org, Andrew Morton , Matthew Wilcox , "Kirill A. Shutemov" , Mike Kravetz , Miaohe Lin , Vlastimil Babka , Muchun Song , Naoya Horiguchi , linux-kernel@vger.kernel.org Subject: Re: [PATCH v1 0/5] mm, kpageflags: support folio and fix output for compound pages Message-ID: <20231012150226.GA473412@u2004> References: <20231010142801.3780917-1-naoya.horiguchi@linux.dev> <63d119f7-5adb-861a-00c2-69a92b19ef9b@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <63d119f7-5adb-861a-00c2-69a92b19ef9b@redhat.com> X-Migadu-Flow: FLOW_OUT X-Rspamd-Queue-Id: 3A141200B2 X-Rspam-User: X-Stat-Signature: x56mdrc1q79j8r14ej4tjgpg639kte7s X-Rspamd-Server: rspam01 X-HE-Tag: 1697122958-580289 X-HE-Meta: U2FsdGVkX19Do0CjBpRO8+sW09blbE/yH/KnsaQdkFQHJf7ms4WrVF6+audeKH00tB83CHkr7JFeDB000YbymCaJCAckDbEflnAdpi38tqS3HgfzyEzdO7K0XSi0FK1iYUdrt0DhIvhj/UgqEcrngMHkOrRdwfCN48IS3kMWUrbQ7DaPlS4E3EuiWWqEnZ9+yvb5FR8gO63Eni6d2EFCEM1O7ByIpUm6eOH0BXh7cZR3K6/Qvr5vGH6APJCr9yi6sGEoBSgciL7bobEw6krVaYlQU0RC7TtAcxsZ5N+6AiLN55nleIjm4889ORAUQDmPks2lmxAMHGdLfCBFhRnZxDxeYfYv2Az9yP/97LZEv2k0KW1DW0ESAAVTSTWgjC54Cndj2Fh5TrtBD6uX415Np0Me8EkuTskEKq48X3ZfmHxiF3ET/pDrxsw3VFul001mNlk3dvB7dMEXaxMppGAr2YaGlOaMQ6XyMJT+20QD056XDDvtTFJeTISt9K+8Cba7fYBok1tjtsK32kd3KajK64hhz1kq8rUuAwIx+aoTYtV78f0lepaevwlssE9uXy8kTLSiyky/xDAz9rYR0wClkbrsME+O92n0uztZsAe5VvK4GwXhz7GUNKTRq20jpr1O4ZAqXbH6KJj1Kx08YHpJKmLXxn7LobRugJZATwNzXDHJm0roc7J62P6MercMQIEp/kPsorhcbm5JMlx4nO5uM5I222fQW04lu+rngxbJF/6y0RbZ82JFzqfzhprtBjseiqTrGfjJbj6BrJ1LojMD3RL7mQZKD3R/tYp8Fl/LG+in5Qm8EDeGj55bb+deqWEfBJZ8/+8t8W6/+kW4P5lC7qNwcIhm9DL02Gs0SyVrY3iI2A/JRJusgVUSNqzSmo7gUl4rG3YhWGEXx96dgGYzb2JSjsjRGlLblVtoh+UlH+JELw2g0Uyv2ZWciCWwDtJiloU5He+kpX2RBgsJB/b B54hAhMi gka6pWTxqj7lPn6DFMxPIICyfBhU6bbQuhLPNFbaGYh+mVgjJKnrShV9za7GPGBUwZrC7XEJ8bAzESyFRwP+nHuQ70g== 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 Thu, Oct 12, 2023 at 10:33:04AM +0200, David Hildenbrand wrote: > On 10.10.23 16:27, Naoya Horiguchi wrote: > > Hi everyone, > > > > This patchset addresses 2 issues in /proc/kpageflags. > > > > 1. We can't easily tell folio from thp, because currently both pages are > > judged as thp, and > > 2. we see some garbage data in records of compound tail pages because > > we use tail pages to store some internal data. > > > > These issues require userspace programs to do additional work to understand > > the page status, which makes situation more complicated. > > > > This patchset tries to solve these by defining KPF_FOLIO for issue 1., and > > by hiding part of page flag info on tail pages of compound pages for issue 2. > > > > I think that technically some compound pages like thp/hugetlb/slab could be > > considered as folio, but in this version KPF_FOLIO is set only on folios > > At least thp+hugetlb are most certainly folios. Regarding slab, I suspect we > no longer call them folios (cannot be mapped to user space). But Im not sure > about the type hierarchy. I'm not sure about the exact definition of "folio", and I think it's better to make KPF_FOLIO set based on the definition. "being mapped to userspace" can be one possible criteria for the definition. But reading source code, folio_slab() and slab_folio() convert between struct slab and struct folio, so I feel that someone might think a slab is a kind of folio. > > > in pagecache (so "folios in narrower meaning"). I'm not confident about > > this choice, so if you have any idea about this, please let me know. > > It does sound inconsistent. What exactly do you want to tell user space with > the new flag? The current most problematic behavior is to report folio as thp (order-2 pagecache page is definitely a folio but not a thp), and this is what the new flag is intended to tell. Thanks, Naoya Horiguchi