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=-1.0 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,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 06DEBC433DF for ; Sun, 28 Jun 2020 07:11:04 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C815C207E8 for ; Sun, 28 Jun 2020 07:11:03 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="prODt3T0"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="UyijhxBt" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C815C207E8 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-snps-arc-bounces+linux-snps-arc=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=x+xn/uicAZtd9R5ATKz51tyCEAitU1fjZLd1yZ+CGzw=; b=prODt3T01JwmwJhEoALE2D8bQ p1gKCQHBXPttOMZh5nUbfuOZdz29V+TJTsVb6jGqpE6/DxYOPEtQwxjHpQpVA+6K9qvfVOwpXnjMU Dkhhd4jGAXuWYYpAtos0SGb415yeLIxNN79EQsEfc6rfahc5SiU0gF+ZSjZKZz1/g1RimnPYhz6sb QpkycCEE569t9g2+rmxWGR2PMDHnkuAZnNun0UFuJYw5ffQCjB9rcBL8iLHvSbz0JsBsW43qLwqaL rkG9/Pvkv6NUdA9GlCFtvxWnojjcTsIhVzyw5PnEKPkaHiMy1JJdhdYlIRg2SuLxA9xlu233rAm9I YzorjT95A==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jpRSv-0001uo-GJ; Sun, 28 Jun 2020 07:11:02 +0000 Received: from mail.kernel.org ([198.145.29.99]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jpRSq-0001tg-D7; Sun, 28 Jun 2020 07:10:57 +0000 Received: from kernel.org (unknown [87.71.40.38]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 3D65920775; Sun, 28 Jun 2020 07:10:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1593328255; bh=yK/mmEcayAp4K1SoJVYgv0KctiM5CGqsdRXbo6D8DTo=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=UyijhxBtiPImkMHKkSGIyXWOBHqIqoPqHi03HWzaGBbmBhYKOSRUunGTmaRWc4Gjn 2TMA+ldpEEnMFu0kFYBgT1B2G/Iqyrdp18UacvMYdOXnb2Y4yh/FSazt4w3nUe/3UB VKf4vf+8Dah0/sxlNf+Z75XPskzsJ/8NsyHkTS2A= Date: Sun, 28 Jun 2020 10:10:44 +0300 From: Mike Rapoport To: Matthew Wilcox Subject: Re: [PATCH 4/8] asm-generic: pgalloc: provide generic pmd_alloc_one() and pmd_free_one() Message-ID: <20200628071044.GC576120@kernel.org> References: <20200627143453.31835-1-rppt@kernel.org> <20200627143453.31835-5-rppt@kernel.org> <20200627190304.GG25039@casper.infradead.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20200627190304.GG25039@casper.infradead.org> X-BeenThere: linux-snps-arc@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on Synopsys ARC Processors List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-ia64@vger.kernel.org, linux-sh@vger.kernel.org, Peter Zijlstra , linux-mips@vger.kernel.org, Max Filippov , Satheesh Rajendran , linux-csky@vger.kernel.org, sparclinux@vger.kernel.org, linux-riscv@lists.infradead.org, linux-arch@vger.kernel.org, Stephen Rothwell , linux-hexagon@vger.kernel.org, Joerg Roedel , Christophe Leroy , Mike Rapoport , Abdul Haleem , linux-snps-arc@lists.infradead.org, linux-xtensa@linux-xtensa.org, Arnd Bergmann , linux-s390@vger.kernel.org, linux-um@lists.infradead.org, Steven Rostedt , linux-m68k@lists.linux-m68k.org, openrisc@lists.librecores.org, Andy Lutomirski , Stafford Horne , linux-arm-kernel@lists.infradead.org, linux-parisc@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, linux-alpha@vger.kernel.org, Andrew Morton , linuxppc-dev@lists.ozlabs.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-snps-arc" Errors-To: linux-snps-arc-bounces+linux-snps-arc=archiver.kernel.org@lists.infradead.org On Sat, Jun 27, 2020 at 08:03:04PM +0100, Matthew Wilcox wrote: > On Sat, Jun 27, 2020 at 05:34:49PM +0300, Mike Rapoport wrote: > > More elaborate versions on arm64 and x86 account memory for the user page > > tables and call to pgtable_pmd_page_ctor() as the part of PMD page > > initialization. > > > > Move the arm64 version to include/asm-generic/pgalloc.h and use the generic > > version on several architectures. > > > > The pgtable_pmd_page_ctor() is a NOP when ARCH_ENABLE_SPLIT_PMD_PTLOCK is > > not enabled, so there is no functional change for most architectures except > > of the addition of __GFP_ACCOUNT for allocation of user page tables. > > Thanks for including this line; it reminded me that we're not setting > the PageTable flag on the page, nor accounting it to the zone page stats. > Hope you don't mind me tagging a patch to do that on as 9/8. > > We could also do with a pud_page_[cd]tor and maybe even p4d/pgd versions. > But that brings me to the next question -- could/should some of this > be moved over to asm-generic/pgalloc.h? The ctor/dtor aren't called > from anywhere else, and there's value to reducing the total amount of > code in mm.h, but then there's also value to keeping all the ifdef > ARCH_ENABLE_SPLIT_PMD_PTLOCK code together too. So I'm a bit torn. > What do you think? There are arhcitectures that don't use asm-generic/pgalloc.h but rather have their own, sometimes completely different, versoins of these funcitons. I've tried adding linux/pgalloc.h, but I've ended up with contradicting need to include asm/pgalloc.h before the generic code for some architecures or after the generic code for others :) I think let's leave it in mm.h for now, maybe after several more cleaups we could do better. -- Sincerely yours, Mike. _______________________________________________ linux-snps-arc mailing list linux-snps-arc@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-snps-arc