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.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, 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 7E986C2BA83 for ; Fri, 7 Feb 2020 17:45:41 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 2731421741 for ; Fri, 7 Feb 2020 17:45:40 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=shutemov-name.20150623.gappssmtp.com header.i=@shutemov-name.20150623.gappssmtp.com header.b="x8B8Zlzz" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2731421741 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=shutemov.name Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 834F46B0003; Fri, 7 Feb 2020 12:45:40 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 7E4D16B0006; Fri, 7 Feb 2020 12:45:40 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6D2776B0007; Fri, 7 Feb 2020 12:45:40 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0172.hostedemail.com [216.40.44.172]) by kanga.kvack.org (Postfix) with ESMTP id 51E8D6B0003 for ; Fri, 7 Feb 2020 12:45:40 -0500 (EST) Received: from smtpin07.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 7AAF53D13 for ; Fri, 7 Feb 2020 17:45:39 +0000 (UTC) X-FDA: 76464058398.07.group43_4e6b154968b40 X-HE-Tag: group43_4e6b154968b40 X-Filterd-Recvd-Size: 4788 Received: from mail-lj1-f195.google.com (mail-lj1-f195.google.com [209.85.208.195]) by imf04.hostedemail.com (Postfix) with ESMTP for ; Fri, 7 Feb 2020 17:45:38 +0000 (UTC) Received: by mail-lj1-f195.google.com with SMTP id y6so225833lji.0 for ; Fri, 07 Feb 2020 09:45:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=shutemov-name.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=9QpwIP3XJbBJYHg9ziboT7BXf2fido+kMDrerHb1y+M=; b=x8B8ZlzzPhRYPQRT2QQ7aU2I/xrJ5V3TDuJCyvWfTOItryqNOAE91hd8cR482icf15 bCRuLCKF/yKyEt0fnY9K4WGFqFLPo/ofsiiIPdtcR0AOwaV4ehx3zO2U9mOtcb3ElSrz MptBcKwF4QT40CkC2gpebRPtCJ3r6PFtCIa6De0xkR6yYurq0kFKOHgzN+kSABKfcUOl ru7bdSiPFwLb1JHfrvVKE2zA1ZRTXcwBgwUN6vTTDJ/8dQSfJD17B9MWtxWrWmqJ+1GW 0LTokzpKcxxXD9OfelhJAjtIBbAvFvAkdndSeoUYJesXNNuyxRohE3jxlM17o73oY2Yb LaRg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=9QpwIP3XJbBJYHg9ziboT7BXf2fido+kMDrerHb1y+M=; b=kAixc/a9dHbr7E8zsCAcjkb2ZAVPA8a8XHdEA1trTjtITg7CoYffmMSpO0I/tp8WzP FfEk45b2JTWlBUNfnopTuqtlPSP7c+TV9TvAg6HDhY/XqPD3JkEr1lpDF0eN+2bxsPio 822gIeu2Lj+1SdDXk1hBbqPrGYb9NeX8xGCdtWJWRZ3iYI/sfqzb7OYSxJj+L6ZJE0hV x9gDyBoD4xLSRImbzWNwi0SkoQRHlRTCmAy95NxrjnQ0KHpnFQgOX42Hym+uJGrP4qjo 3kUvqmfE103JB3n1hUI1fxDXWoGdHE8FBkOWVHYDafXNzOFcH2CVdWBf92Gy1rtB30YX xnJA== X-Gm-Message-State: APjAAAWuyONyFgb2Y7qmGOO1DBABSM42n03Kkqt3SgvHFrOGJlvZJpwY +cwf/vECg5dt8Pgcq3Ml+l5oTA== X-Google-Smtp-Source: APXvYqyRHBAvRNvJTIwX0jWOIciouBA8UshxHZ0Jg/vJGcQwIe5b6Ew5eccAopkCq7J6Vzf1T8MDNg== X-Received: by 2002:a2e:3608:: with SMTP id d8mr234591lja.152.1581097537153; Fri, 07 Feb 2020 09:45:37 -0800 (PST) Received: from box.localdomain ([86.57.175.117]) by smtp.gmail.com with ESMTPSA id c8sm1361466lfm.65.2020.02.07.09.45.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Feb 2020 09:45:36 -0800 (PST) Received: by box.localdomain (Postfix, from userid 1000) id 2FF2E100B68; Fri, 7 Feb 2020 20:45:53 +0300 (+03) Date: Fri, 7 Feb 2020 20:45:53 +0300 From: "Kirill A. Shutemov" To: Matthew Wilcox Cc: Mike Rapoport , lsf-pc@lists.linux-foundation.org, linux-mm@kvack.org Subject: Re: [LSF/MM/BPF TOPIC] Page table manipulation primitives Message-ID: <20200207174553.mx6onurbvhgn7w5p@box> References: <20200206165741.GC17499@linux.ibm.com> <20200206173410.GW8731@bombadil.infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200206173410.GW8731@bombadil.infradead.org> 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, Feb 06, 2020 at 09:34:10AM -0800, Matthew Wilcox wrote: > 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 played a bit more with it after that, but got distracted to other stuff. I'll see if I'll be able to come up with an update. > I don't think this approach helps support 64k pages on ARM Could you specify what such support would require? > , 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 ... > } It looks like just an higher level API that can be provided over my approach. Maybe it should be the default go-to. But I find it useful to be able go into low-level details where it is matters. -- Kirill A. Shutemov