From mboxrd@z Thu Jan 1 00:00:00 1970 From: Matthew Wilcox Date: Sat, 27 Jun 2020 19:03:04 +0000 Subject: Re: [PATCH 4/8] asm-generic: pgalloc: provide generic pmd_alloc_one() and pmd_free_one() Message-Id: <20200627190304.GG25039@casper.infradead.org> List-Id: References: <20200627143453.31835-1-rppt@kernel.org> <20200627143453.31835-5-rppt@kernel.org> In-Reply-To: <20200627143453.31835-5-rppt@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Mike Rapoport Cc: linux-kernel@vger.kernel.org, Abdul Haleem , Andrew Morton , Andy Lutomirski , Arnd Bergmann , Christophe Leroy , Joerg Roedel , Max Filippov , Mike Rapoport , Peter Zijlstra , Satheesh Rajendran , Stafford Horne , Stephen Rothwell , Steven Rostedt , linux-alpha@vger.kernel.org, linux-arch@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-csky@vger.kernel.org, linux-hexagon@vger.kernel.org, linux-ia64@vger.kernel.org, linux-m68k@lists.linux-m68k.org, linux-mi 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? 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_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 96562C433E0 for ; Sat, 27 Jun 2020 19:03:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7A188207FC for ; Sat, 27 Jun 2020 19:03:26 +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="rq00ouSx" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726704AbgF0TDZ (ORCPT ); Sat, 27 Jun 2020 15:03:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51534 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725975AbgF0TDY (ORCPT ); Sat, 27 Jun 2020 15:03:24 -0400 Received: from casper.infradead.org (unknown [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 675ADC061794; Sat, 27 Jun 2020 12:03:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.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=OR7OBaJyU20QVLaZTPXddMLTo5rxOsqU6iEIJEupuWE=; b=rq00ouSxMdTmSFa28hDOUKTHBg 3dXyfPXkTUDZyQHTetqsyMna5fwntHa6QKcic/h71IwcUCnGNbErGyqkiwiLcgU2nYHZh16/QaPeb b5zkBVG9gFL5QSc/VNDuNclsIuluvuMI/LYza+5r2JW/cLhLN6jZ5ik5eKIuodERFMabxSNfOI2Bi +dL26IWnzvmxsRx2Z0NmVql7PiiPOtRewW4aUiQeNyCevs8ZZkzP0faCH2uqSnyC23QLvVtj1Wi9z Fo+73sfYzK5rnUfqtXfFwYUwyfilRDtoIcUUPTCSGsmVmOCF5BvgZD7yS/O5QwZNMhirY3o8KlkeY 6JIFEkYQ==; Received: from willy by casper.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1jpG6S-0005fe-2n; Sat, 27 Jun 2020 19:03:04 +0000 Date: Sat, 27 Jun 2020 20:03:04 +0100 From: Matthew Wilcox To: Mike Rapoport Cc: linux-kernel@vger.kernel.org, Abdul Haleem , Andrew Morton , Andy Lutomirski , Arnd Bergmann , Christophe Leroy , Joerg Roedel , Max Filippov , Mike Rapoport , Peter Zijlstra , Satheesh Rajendran , Stafford Horne , Stephen Rothwell , Steven Rostedt , linux-alpha@vger.kernel.org, linux-arch@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-csky@vger.kernel.org, linux-hexagon@vger.kernel.org, linux-ia64@vger.kernel.org, linux-m68k@lists.linux-m68k.org, linux-mips@vger.kernel.org, linux-mm@kvack.org, linux-parisc@vger.kernel.org, linux-riscv@lists.infradead.org, linux-s390@vger.kernel.org, linux-sh@vger.kernel.org, linux-snps-arc@lists.infradead.org, linux-um@lists.infradead.org, linux-xtensa@linux-xtensa.org, linuxppc-dev@lists.ozlabs.org, openrisc@lists.librecores.org, sparclinux@vger.kernel.org Subject: Re: [PATCH 4/8] asm-generic: pgalloc: provide generic pmd_alloc_one() and pmd_free_one() Message-ID: <20200627190304.GG25039@casper.infradead.org> References: <20200627143453.31835-1-rppt@kernel.org> <20200627143453.31835-5-rppt@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200627143453.31835-5-rppt@kernel.org> Sender: linux-parisc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-parisc@vger.kernel.org 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? From mboxrd@z Thu Jan 1 00:00:00 1970 From: Matthew Wilcox Subject: Re: [PATCH 4/8] asm-generic: pgalloc: provide generic pmd_alloc_one() and pmd_free_one() Date: Sat, 27 Jun 2020 20:03:04 +0100 Message-ID: <20200627190304.GG25039@casper.infradead.org> References: <20200627143453.31835-1-rppt@kernel.org> <20200627143453.31835-5-rppt@kernel.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: <20200627143453.31835-5-rppt@kernel.org> Sender: linux-alpha-owner@vger.kernel.org To: Mike Rapoport Cc: linux-kernel@vger.kernel.org, Abdul Haleem , Andrew Morton , Andy Lutomirski , Arnd Bergmann , Christophe Leroy , Joerg Roedel , Max Filippov , Mike Rapoport , Peter Zijlstra , Satheesh Rajendran , Stafford Horne , Stephen Rothwell , Steven Rostedt , linux-alpha@vger.kernel.org, linux-arch@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-csky@vger.kernel.org, linux-hexagon@vger.kernel.org, linux-ia64@vger.kernel.org, linux-m68k@lists.linux-m68k.org, linux-mi List-Id: linux-arch.vger.kernel.org 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? 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,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED 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 071A9C433DF for ; Sat, 27 Jun 2020 19:03:23 +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 D01E2207FC for ; Sat, 27 Jun 2020 19:03:22 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="pWDSRIho"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="rq00ouSx" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D01E2207FC Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-riscv-bounces+linux-riscv=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=PKD+4ybK9MzpjULyqstDYdwdvwqI5g4ra6Fx921nOQ4=; b=pWDSRIhomOHdiEhD1g7XpgZWV 3/cVq4wbz7d8VR5Thof+tqGA1qRgPeB36uPvbaAdJx6Kw2jTlnPya29k+Y/fWp60Y5Na+S2o9euq/ f9Vh5go3ezC77ixfuFRNR9PkmlUdXEfG4AWzqMmNrI2bLcVVF9+Imn/BtvjG5sEVdilIKn8PhuiWF e5BVD3Sl7Cg3Xsa7rH0iHc1mlgZKNBwBqy2Hm6lOQN1PzkEbrxfM7GTHQ+0YCz26Ych8uwBmx7acv 8yfaNN3nuiqBRUuE/Kjjh9CeeDsyZvmANFxzVqDJEsYvasAXXATK8sqkb7IH4wIZCZtWM3gbJdtnz Nyua3WH8w==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jpG6d-0007AK-Um; Sat, 27 Jun 2020 19:03:16 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jpG6V-00078V-Sv; Sat, 27 Jun 2020 19:03:07 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.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=OR7OBaJyU20QVLaZTPXddMLTo5rxOsqU6iEIJEupuWE=; b=rq00ouSxMdTmSFa28hDOUKTHBg 3dXyfPXkTUDZyQHTetqsyMna5fwntHa6QKcic/h71IwcUCnGNbErGyqkiwiLcgU2nYHZh16/QaPeb b5zkBVG9gFL5QSc/VNDuNclsIuluvuMI/LYza+5r2JW/cLhLN6jZ5ik5eKIuodERFMabxSNfOI2Bi +dL26IWnzvmxsRx2Z0NmVql7PiiPOtRewW4aUiQeNyCevs8ZZkzP0faCH2uqSnyC23QLvVtj1Wi9z Fo+73sfYzK5rnUfqtXfFwYUwyfilRDtoIcUUPTCSGsmVmOCF5BvgZD7yS/O5QwZNMhirY3o8KlkeY 6JIFEkYQ==; Received: from willy by casper.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1jpG6S-0005fe-2n; Sat, 27 Jun 2020 19:03:04 +0000 Date: Sat, 27 Jun 2020 20:03:04 +0100 From: Matthew Wilcox To: Mike Rapoport Subject: Re: [PATCH 4/8] asm-generic: pgalloc: provide generic pmd_alloc_one() and pmd_free_one() Message-ID: <20200627190304.GG25039@casper.infradead.org> References: <20200627143453.31835-1-rppt@kernel.org> <20200627143453.31835-5-rppt@kernel.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20200627143453.31835-5-rppt@kernel.org> X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org 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? _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv 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_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 9C2D7C433DF for ; Sat, 27 Jun 2020 19:05:09 +0000 (UTC) Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (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 18E05207FC for ; Sat, 27 Jun 2020 19:05:08 +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="rq00ouSx" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 18E05207FC Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Received: from bilbo.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 49vNVV5QZ0zDrCp for ; Sun, 28 Jun 2020 05:05:06 +1000 (AEST) Authentication-Results: lists.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=infradead.org (client-ip=2001:8b0:10b:1236::1; helo=casper.infradead.org; envelope-from=willy@infradead.org; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=infradead.org header.i=@infradead.org header.a=rsa-sha256 header.s=casper.20170209 header.b=rq00ouSx; dkim-atps=neutral Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 49vNSh3SZMzDrCB for ; Sun, 28 Jun 2020 05:03:32 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.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=OR7OBaJyU20QVLaZTPXddMLTo5rxOsqU6iEIJEupuWE=; b=rq00ouSxMdTmSFa28hDOUKTHBg 3dXyfPXkTUDZyQHTetqsyMna5fwntHa6QKcic/h71IwcUCnGNbErGyqkiwiLcgU2nYHZh16/QaPeb b5zkBVG9gFL5QSc/VNDuNclsIuluvuMI/LYza+5r2JW/cLhLN6jZ5ik5eKIuodERFMabxSNfOI2Bi +dL26IWnzvmxsRx2Z0NmVql7PiiPOtRewW4aUiQeNyCevs8ZZkzP0faCH2uqSnyC23QLvVtj1Wi9z Fo+73sfYzK5rnUfqtXfFwYUwyfilRDtoIcUUPTCSGsmVmOCF5BvgZD7yS/O5QwZNMhirY3o8KlkeY 6JIFEkYQ==; Received: from willy by casper.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1jpG6S-0005fe-2n; Sat, 27 Jun 2020 19:03:04 +0000 Date: Sat, 27 Jun 2020 20:03:04 +0100 From: Matthew Wilcox To: Mike Rapoport Subject: Re: [PATCH 4/8] asm-generic: pgalloc: provide generic pmd_alloc_one() and pmd_free_one() Message-ID: <20200627190304.GG25039@casper.infradead.org> References: <20200627143453.31835-1-rppt@kernel.org> <20200627143453.31835-5-rppt@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200627143453.31835-5-rppt@kernel.org> X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List 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 , 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 Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" 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? 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,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED 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 78DBDC433DF for ; Sat, 27 Jun 2020 19:03:17 +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 44A4F207FC for ; Sat, 27 Jun 2020 19:03:17 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="HzNPbeng"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="rq00ouSx" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 44A4F207FC Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.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=aYZNziwa22ZOrXJ8hvOLRXQCNK9VjB547snJ7BVUNhQ=; b=HzNPbengoWlubv5Jg1kSZC/XR eXNcj/A/6liY15lPqJiDELXiM5nspWNRGGBLh9Dewvu125ZCjEthTASKsHalOhks5mu15cMrQsHmh KFPPhnMBAtfamDrqD/F1t+89j/Okg/joad5IK8l3mTUB/lUk1ncDQ6p23rXdw17KZ8F4N8q9cJ8Zx EO2pCPGBd2qLLz6ltaCvTzP0mJD9VqlLbcgIlGFbUXSChu7sEDXg0fKj5aCin1kuT5h8DBQHN3F0Z NxUVAuf2rRCxG+lsn2ZhJiX0/nff9kqwdjr8uwJc7rZ38EaZMLpBlIH8EKf/77+Ad8Abdmcs+I2hW H+Xpfo07A==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jpG6e-0007BT-FM; Sat, 27 Jun 2020 19:03:16 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jpG6V-00078V-Sv; Sat, 27 Jun 2020 19:03:07 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.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=OR7OBaJyU20QVLaZTPXddMLTo5rxOsqU6iEIJEupuWE=; b=rq00ouSxMdTmSFa28hDOUKTHBg 3dXyfPXkTUDZyQHTetqsyMna5fwntHa6QKcic/h71IwcUCnGNbErGyqkiwiLcgU2nYHZh16/QaPeb b5zkBVG9gFL5QSc/VNDuNclsIuluvuMI/LYza+5r2JW/cLhLN6jZ5ik5eKIuodERFMabxSNfOI2Bi +dL26IWnzvmxsRx2Z0NmVql7PiiPOtRewW4aUiQeNyCevs8ZZkzP0faCH2uqSnyC23QLvVtj1Wi9z Fo+73sfYzK5rnUfqtXfFwYUwyfilRDtoIcUUPTCSGsmVmOCF5BvgZD7yS/O5QwZNMhirY3o8KlkeY 6JIFEkYQ==; Received: from willy by casper.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1jpG6S-0005fe-2n; Sat, 27 Jun 2020 19:03:04 +0000 Date: Sat, 27 Jun 2020 20:03:04 +0100 From: Matthew Wilcox To: Mike Rapoport Subject: Re: [PATCH 4/8] asm-generic: pgalloc: provide generic pmd_alloc_one() and pmd_free_one() Message-ID: <20200627190304.GG25039@casper.infradead.org> References: <20200627143453.31835-1-rppt@kernel.org> <20200627143453.31835-5-rppt@kernel.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20200627143453.31835-5-rppt@kernel.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 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? _______________________________________________ linux-snps-arc mailing list linux-snps-arc@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-snps-arc 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,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED 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 4EEF1C433DF for ; Sat, 27 Jun 2020 19:05:22 +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 1AD4F2065F for ; Sat, 27 Jun 2020 19:05:22 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="Xu7n0T3e"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="rq00ouSx" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1AD4F2065F Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=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=HDwdTASXq1jEA1JysBJxAsK/QMrUj771QoIRie0MtQg=; b=Xu7n0T3edqPCv9hNwcirpqXgi q/uivnZM0M4R8SgEWKt2OcIR4/TP+iUjQ9GX/8v14wNxspWd5Fyzu0TTYLoQ5PTszXgYmzU6chAGk DhlwbMYNeA/Xli4gRyZpzaYqM79+7tJqwTuNono5mU8FOIyVKbvkFxCnn0DFvWbMTC9VjU+ZYScBr kAhZoLgfnvMI8rPmhdNXkbmHJLvytzW0qzZwxXaWKYK9CjyNg0+ioYNjX9KSXclZ9xZoxARqBcq8o XKcNWIICDLSodtM0/E7msUanX6ETUJeRibH4ueKD0+UAHeYeIFjyLLNVgTW8xc/RIXn1NkQkJpcjr JPGjMa+lA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jpG6b-00078t-8N; Sat, 27 Jun 2020 19:03:13 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jpG6V-00078V-Sv; Sat, 27 Jun 2020 19:03:07 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.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=OR7OBaJyU20QVLaZTPXddMLTo5rxOsqU6iEIJEupuWE=; b=rq00ouSxMdTmSFa28hDOUKTHBg 3dXyfPXkTUDZyQHTetqsyMna5fwntHa6QKcic/h71IwcUCnGNbErGyqkiwiLcgU2nYHZh16/QaPeb b5zkBVG9gFL5QSc/VNDuNclsIuluvuMI/LYza+5r2JW/cLhLN6jZ5ik5eKIuodERFMabxSNfOI2Bi +dL26IWnzvmxsRx2Z0NmVql7PiiPOtRewW4aUiQeNyCevs8ZZkzP0faCH2uqSnyC23QLvVtj1Wi9z Fo+73sfYzK5rnUfqtXfFwYUwyfilRDtoIcUUPTCSGsmVmOCF5BvgZD7yS/O5QwZNMhirY3o8KlkeY 6JIFEkYQ==; Received: from willy by casper.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1jpG6S-0005fe-2n; Sat, 27 Jun 2020 19:03:04 +0000 Date: Sat, 27 Jun 2020 20:03:04 +0100 From: Matthew Wilcox To: Mike Rapoport Subject: Re: [PATCH 4/8] asm-generic: pgalloc: provide generic pmd_alloc_one() and pmd_free_one() Message-ID: <20200627190304.GG25039@casper.infradead.org> References: <20200627143453.31835-1-rppt@kernel.org> <20200627143453.31835-5-rppt@kernel.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20200627143453.31835-5-rppt@kernel.org> X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: 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-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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? _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel From mboxrd@z Thu Jan 1 00:00:00 1970 From: Matthew Wilcox Date: Sat, 27 Jun 2020 20:03:04 +0100 Subject: [OpenRISC] [PATCH 4/8] asm-generic: pgalloc: provide generic pmd_alloc_one() and pmd_free_one() In-Reply-To: <20200627143453.31835-5-rppt@kernel.org> References: <20200627143453.31835-1-rppt@kernel.org> <20200627143453.31835-5-rppt@kernel.org> Message-ID: <20200627190304.GG25039@casper.infradead.org> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: openrisc@lists.librecores.org 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?