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=-0.6 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS 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 84094C33CAC for ; Thu, 6 Feb 2020 17:34:19 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 4D7B221741 for ; Thu, 6 Feb 2020 17:34:19 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="pIchoAuP" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4D7B221741 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id D5FB96B0003; Thu, 6 Feb 2020 12:34:18 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id CE7D86B0006; Thu, 6 Feb 2020 12:34:18 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id BB0216B0007; Thu, 6 Feb 2020 12:34:18 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0135.hostedemail.com [216.40.44.135]) by kanga.kvack.org (Postfix) with ESMTP id A0B776B0003 for ; Thu, 6 Feb 2020 12:34:18 -0500 (EST) Received: from smtpin01.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 3B663181AEF09 for ; Thu, 6 Feb 2020 17:34:18 +0000 (UTC) X-FDA: 76460400996.01.show63_428986c2e8c0a X-HE-Tag: show63_428986c2e8c0a X-Filterd-Recvd-Size: 2712 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) by imf49.hostedemail.com (Postfix) with ESMTP for ; Thu, 6 Feb 2020 17:34:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=2xO1/s22NXju0ffKiPMkviSAqp888BPnBvnlY36Um+w=; b=pIchoAuPN9ruwW3+v+0EBT+0LK 11Zzqt+sUDPwk/oCZRAdB2FiGx6KzS7V59DlfMancuIHV1b8ZmQgF0ZqrGAbIZh9NBDoHFob9pUlr xsE3BlvdUrMN9BTEma4jA/HuSlv4ndeEdW25lLpBrAtvbrX2cMg9PqppdiGZQ9ayUgeOEEfHoqH2P MNubpFSZl9MPMDdYaQrPZYWSkUuS7L9CjFyCjgdyYMI6+qifMODGwiNtmWx3pVwmLv56mbEMV5DaS wPKrIENvCSdCxV4J4OtND3u4YfJXmwvKVlw6Fz4wNkLKOA+A2PrBQrctEhgFDVhNdz7hEFKA3YeoV eADs2AdQ==; Received: from willy by bombadil.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1izl2Y-0005Ik-2r; Thu, 06 Feb 2020 17:34:10 +0000 Date: Thu, 6 Feb 2020 09:34:10 -0800 From: Matthew Wilcox To: Mike Rapoport Cc: lsf-pc@lists.linux-foundation.org, linux-mm@kvack.org Subject: Re: [LSF/MM/BPF TOPIC] Page table manipulation primitives Message-ID: <20200206173410.GW8731@bombadil.infradead.org> References: <20200206165741.GC17499@linux.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200206165741.GC17499@linux.ibm.com> X-Bogosity: Ham, tests=bogofilter, spamicity=0.000075, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Thu, Feb 06, 2020 at 06:57:41PM +0200, Mike Rapoport wrote: > While updating the architectures to properly use 5-level folded page tables > without and > I wondered if we can do better than explicitly name each and every level of > the page table, open-code traversal of all the layers numerous times and > have copied do_something_pXd_range(). > > Then I've come across Kirill's "Proof-of-concept: better(?) page-table > manipulation API" [1], but as far as I could see there was no progress > since then. > > I'd like to resurrect the topic and try to see if we can come up with > actually better page table manipulation API. > > [1] https://lore.kernel.org/lkml/20180424154355.mfjgkf47kdp2by4e@black.fi.intel.com/ I don't think this approach helps support 64k pages on ARM, for example, so it doesn't solve enough problems to be worth doing. I'd favour an interface which looked more like this: vpte_iter iter; vpte_t vpte; vpte_iter_for_each(vpte, iter, start, end, flags) { unsigned char order = vpte_order(&iter); ... do things based on vpte and order ... }