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 9AD17EB64DC for ; Fri, 14 Jul 2023 16:54:59 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 29879900011; Fri, 14 Jul 2023 12:54:59 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 24878900006; Fri, 14 Jul 2023 12:54:59 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 11199900011; Fri, 14 Jul 2023 12:54:59 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id F20E5900006 for ; Fri, 14 Jul 2023 12:54:58 -0400 (EDT) Received: from smtpin27.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id C75DA1A02F4 for ; Fri, 14 Jul 2023 16:54:58 +0000 (UTC) X-FDA: 81010817076.27.B735BE1 Received: from mail-qt1-f178.google.com (mail-qt1-f178.google.com [209.85.160.178]) by imf04.hostedemail.com (Postfix) with ESMTP id 10A0940025 for ; Fri, 14 Jul 2023 16:54:56 +0000 (UTC) Authentication-Results: imf04.hostedemail.com; dkim=pass header.d=google.com header.s=20221208 header.b="tKe/iovd"; spf=pass (imf04.hostedemail.com: domain of yuzhao@google.com designates 209.85.160.178 as permitted sender) smtp.mailfrom=yuzhao@google.com; dmarc=pass (policy=reject) header.from=google.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1689353697; 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:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=z22Lji21DHhPyVayNZqqGmw+ssfxQ2kpwK4smkoUB/w=; b=LcW5RuLEw0BINDtapY7s1RSLsHzOHCpPSLrHnJkg1lM65T+21G27LurZHS//mYOAAnubet WpQydCgMFZTbnKfwj6qy12VKmvNTG5NhkCU5KdmNd5DrWUXyzqK8JWnuiXmVTQcy61WSSI Q2yNhTg35ytjX4VcWp/L0wCXG5F+B/Q= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1689353697; a=rsa-sha256; cv=none; b=jXH1m5OsHGtuMYFVE1asVUf0zV6OCMywmRooK4YR/2FpXz2Jef2f6jzjTJyq5knsRaqJYL r8MhHPJt8FTaxltcm9KOpLOrgILoYKwIwYMSBnBrjb9356Oyl8JiGub4jnTxTAxbfS1MPg ztJAMVPrH55J8JmZpcgaRosAOo5ESMc= ARC-Authentication-Results: i=1; imf04.hostedemail.com; dkim=pass header.d=google.com header.s=20221208 header.b="tKe/iovd"; spf=pass (imf04.hostedemail.com: domain of yuzhao@google.com designates 209.85.160.178 as permitted sender) smtp.mailfrom=yuzhao@google.com; dmarc=pass (policy=reject) header.from=google.com Received: by mail-qt1-f178.google.com with SMTP id d75a77b69052e-403b622101bso2461cf.1 for ; Fri, 14 Jul 2023 09:54:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1689353696; x=1691945696; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=z22Lji21DHhPyVayNZqqGmw+ssfxQ2kpwK4smkoUB/w=; b=tKe/iovdH0qDwlwiziwLGPu9QaKUll2SxPp/gfkfKdoiHzE3qARf+GfzNRxPV1SBVO b6ytSna0wEXaX3W2WsFPGMqlsKDEn8IjZxONJh8J/S61S1BvMAf4+fJbeFiaY8Jvlrti nZ7vlQYIhHKZDKSrsfPNgVXWDZUoZQ/aiq3bjhlgl4CglxEm0JX90PgRnuoueJ+4sGUX ziQ12PjguouQQc41xUgDygyCqZGufhI5IgFAREwOGMxlqEBBs2PXk7U4+/NnyYSr6aef UWZAVqFNkd4Y+sBKSFqz6sXv7sejZlNdPONpaJ8XhqLld60yN45sf8uDZkFWoJDlw3BM 1vhA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689353696; x=1691945696; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=z22Lji21DHhPyVayNZqqGmw+ssfxQ2kpwK4smkoUB/w=; b=lelbGgfcO8lo+lTSXsmffMmaZriiV4eLPRUNCAFDNO4/i4xeozZBb8LKxNXN+kZFS4 MS//4KkzNPOA/icVwM+0LmNRobyUrT11jDnkpCrN0ZwZr1ujsxNnOlrm1GH+j9TMwQe0 VfCbq8YLaH1sb4ST5I1FJbUmfl5W0Ai7jxr9U8FshYXExpQChQh6dEdONqiutKT1DRpy qexqI3hfD+Bn61gWIPN/blRWl8JRBSsPKa13fNmWC94PhzAdTLJV9+bbUUgpug6HyvQr KTPT8HxLWq/M6RqCYj8XIXDbi9Jkc60AmpKwBME21V0PYaOwdqk2P3j0DRK9p+yVNfif OmtA== X-Gm-Message-State: ABy/qLZiP7BYH5XYU7OeTgPPWNKqD/Ep5ExAtVkw1DSBIKblpnvjj7VM F/twQlpe+6vNEg7IfrYdPOBfwALG/WcElZ+b4gw/BQ== X-Google-Smtp-Source: APBJJlHncBuVEFEC55jlI7+mb7yJ4rrbwLngLi3+ds0/PMkK1w/AgZCCU6EOzolM/GD5bcXjFGoGEx2B+Si3CMfWcus= X-Received: by 2002:a05:622a:1994:b0:3ef:5f97:258f with SMTP id u20-20020a05622a199400b003ef5f97258fmr916843qtc.16.1689353696004; Fri, 14 Jul 2023 09:54:56 -0700 (PDT) MIME-Version: 1.0 References: <20230714160407.4142030-1-ryan.roberts@arm.com> <20230714161733.4144503-2-ryan.roberts@arm.com> In-Reply-To: <20230714161733.4144503-2-ryan.roberts@arm.com> From: Yu Zhao Date: Fri, 14 Jul 2023 10:54:20 -0600 Message-ID: Subject: Re: [PATCH v3 2/4] mm: Default implementation of arch_wants_pte_order() To: Ryan Roberts Cc: Andrew Morton , Matthew Wilcox , "Kirill A. Shutemov" , Yin Fengwei , David Hildenbrand , Catalin Marinas , Will Deacon , Anshuman Khandual , Yang Shi , "Huang, Ying" , Zi Yan , Luis Chamberlain , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Stat-Signature: 4a4qzfb6i5gcg3g6arpzed7autmfxihf X-Rspamd-Server: rspam10 X-Rspamd-Queue-Id: 10A0940025 X-Rspam-User: X-HE-Tag: 1689353696-307210 X-HE-Meta: U2FsdGVkX197rVy4RfKsJRstDDvsJ/TgVkyqa6jVq1nhWf/7K+ck+2XiOBLOj6wxjM62qUtKgk1XfGQ8yQJdnEFItkZ4X0jaDzphBOlXOzZx+Cs8LY6HbeZuaNJTKRZNzpNwMByJWxwdovdXPZZ8uypLNO7Oz1rXe/Q4QxmszGiLJmkrbgjzpXeGuJ3ZmkAmnxnXPEe075rPdVPMvxyGiqZJlThXZeeRYDG+OJppNeRTepTjJ15V4PQhVjmVBvK/CKyBLSXLDS6qd7SFIwoBJscGORTgXcuX6LaOkpcKUcr5t1+54JyQ+SUqBESZk7ruXIisH+vfXCP2/uKwBZ3n3parwj+iqhQpvkGNZQTVgin64PFUvaOIXFBzeCUyiJAmHxYM7+gZAJHYG9LCV19QJYviVg9Z26XEnrH+d35gGKQ54jXMNbjws5xTMfzAExKYbYX3C/+XI26tkE5Vk9aU/4Esm4oP4vgqcJVUqzvHTHAW8KGhazYDzmCt9IEIalQ2hi0F2VdE+BnDWZ0pIAzr0IqnMsbGm2xiYr5UtPb6QYIrmd0IXeZdyjHdlctFvrY+KExWMta+gikLy4nfNZVrKukZe6YFYG98YjnMYRuqW4DLTxerWzrNmTf98MwtZ0vzX0AXdLuAo8x71MBXW92n+W+5xDafVx0kzPn7FfcQQv6Tro5AdZ9UrEMZvfG+7QNjPFNqpVN+LRDGFfs32GNVh/QbypOulNLEU1doTxGGk/7NPf7qjXaz5foW75ieMy+Mt5uGZzG+dWdU9lPpuqgSjd4hmh/oHZ4XPWe9iHKH1kIW2Jald2P5PGZFjQkxbE6byjPGKnW11Q1L4Ebh0wsHY9qN5bLuPQJsqWMgVTd8MT1tWRmhx4EU21tVCwN1LhWLQK/8OQRNLMRSCI7LNsLSt+jAEcgEuWVNPT/N/bvYXLV4wm2zdfyoANMvSVO1f2h2DzxN6WeMBZcQFrT4K1M YsJ0NbV3 WmsL39bXfAa/+XSRnPnK1vAJinWpLnATDaER3be28wdCKX/lbtZh9wNR+8ULIX6ivCics2KN5OuY7ODptmlwgwL/Vgt88hi7npNnI1dtbeUI5R+dnlrYss062xLWh1bAUD3yVOa7UH27oSQeHyfWFkclE3ArsUo7E2+jM/DsDR6ioZ984C6wP0fwnL3LiGqW6AkUTaL4rbdXMZqUIAHIkF7eoxIWduebxq4Oy3KeGu79NUSXJ+6Io89doOwRaot3navuZ05DnNj+n+w9+Ps/awk9jOkIRYCWQ6lpkHoXLffFdmL/c6Cr8wQ2XaLFIubXFH4zT8tQgY9bWyoDjt/ywdYiXZOGUYYGwU3xxbZXjmoaF2cE= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000241, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Fri, Jul 14, 2023 at 10:17=E2=80=AFAM Ryan Roberts wrote: > > arch_wants_pte_order() can be overridden by the arch to return the > preferred folio order for pte-mapped memory. This is useful as some > architectures (e.g. arm64) can coalesce TLB entries when the physical > memory is suitably contiguous. > > The first user for this hint will be FLEXIBLE_THP, which aims to > allocate large folios for anonymous memory to reduce page faults and > other per-page operation costs. > > Here we add the default implementation of the function, used when the > architecture does not define it, which returns -1, implying that the HW > has no preference. In this case, mm will choose it's own default order. > > Signed-off-by: Ryan Roberts Reviewed-by: Yu Zhao Thanks: -1 actually is better than 0 (what I suggested) for the obvious rea= son.