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 70E46C636CC for ; Wed, 8 Feb 2023 13:35:36 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id B706C6B0071; Wed, 8 Feb 2023 08:35:35 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id B208A6B0072; Wed, 8 Feb 2023 08:35:35 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9E8A06B0073; Wed, 8 Feb 2023 08:35:35 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 8F5E36B0071 for ; Wed, 8 Feb 2023 08:35:35 -0500 (EST) Received: from smtpin08.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 5BCEAA0935 for ; Wed, 8 Feb 2023 13:35:35 +0000 (UTC) X-FDA: 80444221830.08.7FA4989 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf22.hostedemail.com (Postfix) with ESMTP id CD967C0002 for ; Wed, 8 Feb 2023 13:35:32 +0000 (UTC) Authentication-Results: imf22.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=nv1U4Cs2; spf=none (imf22.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1675863333; 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=PMp0gXsVfVTqwcUhaqwEjQxmo111+Dr+n4G2THRRgz4=; b=vKq4ctMln4RbHN0w4qXrEnTb0h2TIODdsIgeuJlLj3JhHlDlS+wVU1IUV5vYVZ0+7h+AQp 4KWn3nCtv71DLvN7LgqCSTuRY4orwVSWQSP6eBobHRvTNKYL/yAJibJob7HYwc6VQkIeks oSsoR23L2JcWXHVGNQSrBEhMkmmVwBw= ARC-Authentication-Results: i=1; imf22.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=nv1U4Cs2; spf=none (imf22.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org; dmarc=none ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1675863333; a=rsa-sha256; cv=none; b=1FiT4kerYWF+mxRe8dw8L4M+E2i0EF1am/fumU/VIiKy04YrkAYpIujm0biXTUtWoVF0kB E4WzuH8egp8CI2MTQiwTK6IlW9msMoqlaOR7iny8WgqyDT3XqUvmCgD5BhpP/mb/VAyqbL i5WZx0oYm1paefUXcGQ3sN6gpFJe3gc= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Transfer-Encoding: Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date: Sender:Reply-To:Content-ID:Content-Description; bh=PMp0gXsVfVTqwcUhaqwEjQxmo111+Dr+n4G2THRRgz4=; b=nv1U4Cs2toJAUKTbNLnEh3GkOY 7TafoARROVHQSw9xJfz56g9qot5qCf4w6m4SWQjlNps1Oe5T2sHs3KDsj7DDyHZsEule4Fc1EDsFi 1ot7N3tXnfTdb0UAUOhw7OBfMJkQv96CLrRBbzSzT9W9CzOllOmN6OP7nihODAjH1GrmhpTSrxXbw +FQ3rTbD5HBPPVYU6nfEd7rZEnlmQKhiACj6Chvr3AVC+hWz7Ee5CIY899SSczPizMsfNgyHKXZEr J+yG9hswiuu8WG3XCLcbAsJkbqGmrnhF93OGExxTKKUafWDJ+5Nvu8CB5rz+/ij9RclHTGYLDqeqN r07kkj+g==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1pPkbR-001F0R-Gf; Wed, 08 Feb 2023 13:35:13 +0000 Date: Wed, 8 Feb 2023 13:35:13 +0000 From: Matthew Wilcox To: "Yin, Fengwei" Cc: Alexandre Ghiti , linux-arch@vger.kernel.org, linux-mm@kvack.org, linux-alpha@vger.kernel.org, linux-csky@vger.kernel.org, linux-m68k@lists.linux-m68k.org, linux-mips@vger.kernel.org, Dinh Nguyen , linux-parisc@vger.kernel.org, linux-sh@vger.kernel.org, linux-arm-kernel@lists.infradead.org, loongarch@lists.linux.dev, openrisc@lists.librecores.org, linuxppc-dev@lists.ozlabs.org, linux-riscv@lists.infradead.org, sparclinux@vger.kernel.org, linux-xtensa@linux-xtensa.org Subject: Re: API for setting multiple PTEs at once Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: CD967C0002 X-Stat-Signature: hc6u1yho1wuzxrd7pqrwk43xo39emmmc X-Rspam-User: X-HE-Tag: 1675863332-863458 X-HE-Meta: U2FsdGVkX1/1g8C0JjbR2u3YulP330DQPdWZ3qrxndTol7GlVL/O47u4kROegNQRwAGRqz7hq2m7sEdX4Wj9ljuLqYYzZikGxFZamyH/cxBc3wTsjESvHXePvf+auhyu9CrolGqic/4DDhfo2hQTCoy/SO1Rgdgen5ZJIws4ZHJpsuNhgpd5pnfMvu+cMEYn5b+EY+iIoDez8CLf9aK/6KTYY/z3k3embV2pscPF+epiOFuoX6rBNhKsTtv6S8l2vIWX0M6k1U5xwl/mi6Wqzed870KNrpcotXblEa1iywaFWt/xWUeItywq8k0Vm1Q5JJb1eR0hz1G/P5Lw54nNg0Pz4sGNN9KiWcgmhuAH+dSAQEGsmStXpfmr4x7n4+Tq44d1mtdOWeSVXFaUEuhmmI7gJ9iv7oWN9PM7QtJxdxWr7wR0RcfPBULaTvHMdiv2cTCOpLBct1QOGy0C2v/lOUYQnajbKIwDaIiKx1ffqm4mFugU300mfjZr6OYyxbHbyUWkTh9G8Jzwn9xrhreQea1p/YPme3nUnnSK4CMlD2ks6Cb6OsyHzGltoVriBUPDGGCwtsHUl55DPlW3QMzwPrm4Plg0tzO4wjqven4NXlbmoXAy9okSNV6+3rNidrRDzBUIBKko3s6smQv/w9ngSjgxwdsut3X4vHTtF8/V7/jb0moZ5NxGPvXqXebaZKRbJQlQwe3rGcv0OiG4Hkps85ypAiRRi2Buplktn+d0g39+cnquFCuQiV27EYZ6821ZnYnyNutXtGJ6Sb2HFU8TBPIOE7L5a1gkeRa96DGs8ST1jr501z0c1EGmLwTnGKHgGqGThQhm9q3rYBgtuqkaT6S+lDZ3GvvGmrs9JkiSeRweyssIQ/3iYJv86ltL3UmSPK6BN4nIKmApdsf1kGUZiLtnZ/4HAxZXJSvLHcLqhC8Hpr5txVgnny5wMzpZPm4nhqRFeRaUgg/iE17DJqg Z1eFUyqz LWHaho2x8wV4k+ZzoKX72C60Ka7cDjMoBi0FSmP4H81YI5Yk53MAkcTtmR3y6/Kq4Ze7KD+vdlodnFVp8DFS8Y6ZkX2mNPKmfgVXxUdP3+9mG07Nh8PB5m/AqJKAW2sg67kTroKg/ehMtzJNB499SEtVtCEvU/GKMdq0IiXnY/qu2IA9uz6dqRObiHKWFFSUusVH6RrlatJfJnwTaqMTHyBgLoANuNEjYmtDSax2zcKoxzwipc/gG0nCU4Uum6E+PPX1X67Wq3jiiVeoybXV7scAyK7putV0+Nsxh4k3x+/tTymIK/RqdGYJClg== 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, Feb 08, 2023 at 08:09:00PM +0800, Yin, Fengwei wrote: > > > On 2/8/2023 7:23 PM, Alexandre Ghiti wrote: > > Hi Matthew, > > > > On 2/7/23 21:27, Matthew Wilcox wrote: > >> On Thu, Feb 02, 2023 at 09:14:23PM +0000, Matthew Wilcox wrote: > >>> For those of you not subscribed, linux-mm is currently discussing > >>> how best to handle page faults on large folios.  I simply made it work > >>> when adding large folio support.  Now Yin Fengwei is working on > >>> making it fast. > >> OK, here's an actual implementation: > >> > >> https://lore.kernel.org/linux-mm/20230207194937.122543-3-willy@infradead.org/ > >> > >> It survives a run of xfstests.  If your architecture doesn't store its > >> PFNs at PAGE_SHIFT, you're going to want to implement your own set_ptes(), > > > > > > riscv stores its pfn at PAGE_PFN_SHIFT instead of PAGE_SHIFT, se we need to reimplement set_ptes. But I have been playing with your patchset and we never fall into the case where set_ptes is called with nr > 1, any idea why? I booted a large ubuntu defconfig and launched will_it_scale.page_fault4. > Need to use xfs filesystem to get large folio for file mapping. > Other filesystem may be also OK. But I just tried xfs. Thanks. XFS is certainly the flagship filesystem to support large folios, but others have added support, AFS and EROFS. You can also get large folios in tmpfs (which is slightly different as it focuses on THPs rather than generic large folios). You also have to have CONFIG_TRANSPARENT_HUGEPAGE selected, which riscv can do. That restriction will be lifted at some point, but for now large folios depends on the THP infrastructure.