Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp371173rdg; Thu, 12 Oct 2023 08:03:01 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEznIIegx4957TDEOlDTNAoP02V/LkJ+BeQqzQk0bK5Z6N7a9Fb72vIy/cHH7hJmnCdRFZB X-Received: by 2002:a05:6a20:2447:b0:160:57a6:7eea with SMTP id t7-20020a056a20244700b0016057a67eeamr27890183pzc.37.1697122981632; Thu, 12 Oct 2023 08:03:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697122981; cv=none; d=google.com; s=arc-20160816; b=LW5Gk4T1lPnYbKpihqfGUAGsx/vVqrmGnzQxnN8MxxaCg9HgOmNN+gg/A2MxaI116K wiQox9n3fqIzb1DU7wBB7AWohe0458pgRiabg+mNBSmqDckOZohvxc46YSKDMEIey8bV K/7D75mKcFa7o5yQMSF/ZFDVXBYraNDShoVwdylonPCjUX67QJA7pqGL0QVHgjtbGpqW diGeF9OHTi+o5NJNC3pmZkq04pK9QxYqfMTUZSxgtj/dkGHJlBGuE/UgEd3mktx6QX6Q 1iN79BFQdRi3oFbaFff73YudRKwAFPuqjbQeRThx43YWub7ZChm+gdVFu++ETBEW5eq6 9c8A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:dkim-signature:date; bh=RjcViyd2Fhk9iMtsIB4L9gySKen/F6NsFGsZ37IiSaI=; fh=MC1adj/HXzjrEBbEPqE4PBVsTZqhbRQeg8LbsLlQiqo=; b=CuNNZlHV/5INVz2UNB1b4A5bRrQhXSuk1BCLNmCq908X3xRDiF2pMOTt6U+oK4N+hy wPZipe8NE+PeX404I86BuvtEX7suEI4b6c0aFXsqWrdqiCOnyP06X2FoN25xpLMSLgqP pA/REPpxqNpdH5JhuJDoprfSLuQxTJyJmu9PURejgRAD8kN7ICK35LHJRLb0iCOqb85t jSUANvHQp4sWrtjC6XE8nDo+jmdM5e/nlO2wlaOnNLmm2G2wEeD5hfBdem/BN/354g9y 9gkyJQV1AUk49GXPjAujSzK4Y4Uhx87Pla8brjTvaWAlZSTpNMzAZumLzzStdW7rTZ1i LEUw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=qh+sQi2+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Return-Path: Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id t191-20020a6381c8000000b00573efae0ee1si2376607pgd.515.2023.10.12.08.02.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Oct 2023 08:03:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=qh+sQi2+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id C88F6822D14A; Thu, 12 Oct 2023 08:02:52 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1379149AbjJLPCs (ORCPT + 99 others); Thu, 12 Oct 2023 11:02:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59060 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346817AbjJLPCp (ORCPT ); Thu, 12 Oct 2023 11:02:45 -0400 Received: from out-194.mta0.migadu.com (out-194.mta0.migadu.com [IPv6:2001:41d0:1004:224b::c2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 06865E1 for ; Thu, 12 Oct 2023 08:02:40 -0700 (PDT) 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-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Thu, 12 Oct 2023 08:02:52 -0700 (PDT) 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