Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1179235imu; Wed, 16 Jan 2019 14:14:07 -0800 (PST) X-Google-Smtp-Source: ALg8bN7IViuFfGDSWR8cE8s2/a1z5+JDiVsVLWDyVX/j/HWdP2j9TlBrEcunHlByKVPNZbVfr3wu X-Received: by 2002:a63:4b60:: with SMTP id k32mr10892203pgl.186.1547676847094; Wed, 16 Jan 2019 14:14:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547676847; cv=none; d=google.com; s=arc-20160816; b=BwhAUqp5wnv+IfNastfVxereZ6VZr/T7RqkdPzC7Ee+bKnIRqmkFiFGVNQaIo3RLwm 1pEF+NGtZpxSKIp49frG+7dwMkYP7R06DtIBlsdOv4H/jOM7HvSO4wUqAIOilxbh/sR5 tT97XqiiwisxY+yR52KbGeiwdjKtY0t6U7tgZlKMu/Ud1nQcUsa04BeAVJ/2xQIb0tQq S1Ur918i5tcH5brmauAV5K/xJp1+iAAEng5KmjXaH6Nq8DMGAK11aAqphO8k+AELD1nH lZ0yXEhEZedHwb2tzOuniJuWkebWc6unZz5wQiSCcbiHsCOm62wi+uTVzdPcdfzEk7FK Ihgg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=SOzqtRQnhrzBV/2kqoR/jW1DTahkUHWwkEGG0EIDlt8=; b=gQobJ14f4G4ulCOe3vjtPBxGQd5/TAz5lqwi+lYgXgOjZlGU0lN0UWm1DqWfOPvCfC QJhmEeILH6bA9mekuWsAhzlGCoPwuNp4U7lHo6Od6Hc+gKFV5Gvj4IWlcjwO7eLY6Pj1 nOHUSn4ei1rAMbBhjtK+Ugm0UCfxTz8E5qz8FLAYzOE4whrVv6WWNijobIEuPxInhxQq JSaG3WrVXL0fX1sXkqvTG0CY7GKklObWtOAUhQ7rqEUbpgXzOH5V+fvhip4aRn+B3YCA PO6gAAChw0oRRhu3dm33acKdNfa+jejm/EPnMX//4kFv4G9ClSRRjN+ZjjfUXtzqr60v IAAg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=umaZGSlS; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a9si7207193plp.323.2019.01.16.14.13.49; Wed, 16 Jan 2019 14:14:07 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=umaZGSlS; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2404635AbfAPOUV (ORCPT + 99 others); Wed, 16 Jan 2019 09:20:21 -0500 Received: from bombadil.infradead.org ([198.137.202.133]:57816 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2403767AbfAPOUU (ORCPT ); Wed, 16 Jan 2019 09:20:20 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.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:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=SOzqtRQnhrzBV/2kqoR/jW1DTahkUHWwkEGG0EIDlt8=; b=umaZGSlS/Mx6cAOQCY2BhcS56F JTft6i3pABnXS+1yEzVxc6J/HnMUqGhP0z1/U/ELpC9SPiGJZcpycToje9yk1SCtTpJbuIjaAZfmP 9hgJTa4oK7erwr+7pkqsEdHsRPFYxHJAVeOHEDkR3daRz6oJ+hfPDRkmAFSHXgwkYW03JUr4iiiII pwe6c5cQNXDArfmTdHshCR5u/eyVvFEO+8x+kCLvbRtYRUabVSSELftUY6vgPIKuKwP7gszL4UsYi SgiqQeZoXMooGlZZ0v46pl3O6+uIH4DVqAg7COtrdlYJg5fVyENBSsXIpN1paT+qMmm9LyeLLhLV1 yd5Thhxg==; Received: from willy by bombadil.infradead.org with local (Exim 4.90_1 #2 (Red Hat Linux)) id 1gjm3C-0006U0-M1; Wed, 16 Jan 2019 14:20:14 +0000 Date: Wed, 16 Jan 2019 06:20:14 -0800 From: Matthew Wilcox To: Christophe Leroy Cc: Anshuman Khandual , mark.rutland@arm.com, linux-sh@vger.kernel.org, peterz@infradead.org, catalin.marinas@arm.com, dave.hansen@linux.intel.com, will.deacon@arm.com, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-riscv@lists.infradead.org, kvmarm@lists.cs.columbia.edu, linux@armlinux.org.uk, mingo@redhat.com, vbabka@suse.cz, rientjes@google.com, palmer@sifive.com, greentime@andestech.com, marc.zyngier@arm.com, rppt@linux.vnet.ibm.com, shakeelb@google.com, kirill@shutemov.name, tglx@linutronix.de, Michal Hocko , linux-arm-kernel@lists.infradead.org, ard.biesheuvel@linaro.org, robin.murphy@arm.com, steve.capper@arm.com, christoffer.dall@arm.com, james.morse@arm.com, aneesh.kumar@linux.ibm.com, akpm@linux-foundation.org, linuxppc-dev@lists.ozlabs.org Subject: Re: [PATCH V2] mm: Introduce GFP_PGTABLE Message-ID: <20190116142014.GJ6310@bombadil.infradead.org> References: <1547619692-7946-1-git-send-email-anshuman.khandual@arm.com> <20190116065703.GE24149@dhcp22.suse.cz> <20190116123018.GF6310@bombadil.infradead.org> <07d6a264-dccd-78ab-e8a9-2410bbef7b97@arm.com> <20190116131827.GH6310@bombadil.infradead.org> <521d8511-4c87-49c6-de03-67a71d5bacca@c-s.fr> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <521d8511-4c87-49c6-de03-67a71d5bacca@c-s.fr> User-Agent: Mutt/1.9.2 (2017-12-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jan 16, 2019 at 02:47:16PM +0100, Christophe Leroy wrote: > Le 16/01/2019 ? 14:18, Matthew Wilcox a ?crit?: > > I disagree with your objective. Making more code common is a great idea, > > but this patch is too unambitious. We should be heading towards one or > > two page table allocation functions instead of having every architecture do > > its own thing. > > > > So start there. Move the x86 function into common code and convert one > > other architecture to use it too. > > Are we talking about pte_alloc_one_kernel() and pte_alloc_one() ? > > I'm not sure x86 function is the best common one, as it seems to allocate a > multiple of PAGE_SIZE only. And that's the common case. Most architectures use a single page for at least one level of the pte/pmd/pud/p4d/pgd hierarchy. Some use multiple pages and some use a fraction of a page. > Some arches like powerpc use pagetables which are smaller than a page, for > instance powerpc 8xx uses 4k pagetables even with 16k pages, which means a > single page can be used by 4 pagetables. Those can be added later. Note I said "one or two", and that's what I had in mind; I think we want one function that allocates just a page and another that allocates a page fragment. Then we can have a good discussion about what method we use; s390 and ppc use different techniques today and there's really no good reason for that.