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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C6BFBC433F5 for ; Tue, 30 Nov 2021 00:08:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232313AbhK3ALd (ORCPT ); Mon, 29 Nov 2021 19:11:33 -0500 Received: from mail-ot1-f54.google.com ([209.85.210.54]:39509 "EHLO mail-ot1-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232246AbhK3ALc (ORCPT ); Mon, 29 Nov 2021 19:11:32 -0500 Received: by mail-ot1-f54.google.com with SMTP id r10-20020a056830080a00b0055c8fd2cebdso27813312ots.6; Mon, 29 Nov 2021 16:08:14 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=D8pPDA8BhqYxJlGll70Jfs/EV2c/vlH3kHLgmxR36Bk=; b=rWLe9jssgGiqIjfQXsquA8EriPxUGdczEjaWZg5mJ1/9W+nv3kwc+056ww7gJQb3kJ zZZF5Et7Wdnm70x7VGLlWHaNLWC8aUHy1XESRLjgGGLndLgw/yE/ZEJBeG1sM8Z5KV+o +2JN+7CPKJ9ZRcYsoQraaeVfqPLxWsVURyDU72KD+W2QE7jaLrj+kT666AjW6Qdx7C5C OTRs1XhHe5J7qnvJ31q+0CypiAXt6xGGfBtM/oJnfhQWTjbodAOu56fqkKUb9GF6SK2K sjdNB7t0sqkPSDgZsmCEKjzEXyyiGk8zLEaamBJIkk3Y75Gn9SyWqWdDH/asm2aGUazL PvOg== X-Gm-Message-State: AOAM530N2rKLF8F131l4vNfM7/NQhJJzjB7GAO4IgRW9EfMM5DoSe5ag OiWTJ2ubvlehyI9+yeh47Q== X-Google-Smtp-Source: ABdhPJwHdVFEp5hd/T8aXyXLlCP6k0CfP+fpF2T3r+PJoHiG4EwmK+ob5JSJ6nKmQgmurmZ684PLSA== X-Received: by 2002:a9d:4702:: with SMTP id a2mr47864106otf.262.1638230893962; Mon, 29 Nov 2021 16:08:13 -0800 (PST) Received: from robh.at.kernel.org (66-90-148-213.dyn.grandenetworks.net. [66.90.148.213]) by smtp.gmail.com with ESMTPSA id bi20sm3422829oib.29.2021.11.29.16.08.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Nov 2021 16:08:13 -0800 (PST) Received: (nullmailer pid 864351 invoked by uid 1000); Tue, 30 Nov 2021 00:08:10 -0000 Date: Mon, 29 Nov 2021 18:08:10 -0600 From: Rob Herring To: Mike Rapoport Cc: Calvin Zhang , Vineet Gupta , Russell King , Catalin Marinas , Will Deacon , Guo Ren , Yoshinori Sato , Thomas Bogendoerfer , Nick Hu , Greentime Hu , Vincent Chen , Dinh Nguyen , Jonas Bonn , Stefan Kristiansson , Stafford Horne , Michael Ellerman , Benjamin Herrenschmidt , Paul Mackerras , Paul Walmsley , Palmer Dabbelt , Albert Ou , Rich Felker , Chris Zankel , Max Filippov , Frank Rowand , Andrew Morton , David Hildenbrand , Arnd Bergmann , Kefeng Wang , Vladimir Isaev , "Russell King (Oracle)" , "Kirill A. Shutemov" , Guenter Roeck , Marc Zyngier , David Brazdil , Anshuman Khandual , Andrey Konovalov , Mark Rutland , Souptick Joarder , Jinyang He , "Rafael J. Wysocki" , Serge Semin , Tiezhu Yang , Geert Uytterhoeven , Randy Dunlap , Ley Foon Tan , Andreas Oetken , Christophe JAILLET , Christophe Leroy , Zhang Yunkai , Andy Shevchenko , Markus Elfring , Ganesh Goudar , "Aneesh Kumar K.V" , Atish Patra , Anup Patel , Nick Kossifidis , Alexandre Ghiti , Vitaly Wool , Thierry Reding , Lee Jones , Guo Ren , Alexander Sverdlin , Greg Kroah-Hartman , Mauri Sandberg , Palmer Dabbelt , linux-snps-arc@lists.infradead.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-csky@vger.kernel.org, uclinux-h8-devel@lists.sourceforge.jp, linux-mips@vger.kernel.org, openrisc@lists.librecores.org, linuxppc-dev@lists.ozlabs.org, linux-riscv@lists.infradead.org, linux-sh@vger.kernel.org, linux-xtensa@linux-xtensa.org, devicetree@vger.kernel.org Subject: Re: [PATCH 0/2] of: remove reserved regions count restriction Message-ID: References: <20211119075844.2902592-1-calvinzhang.cool@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-csky@vger.kernel.org On Sun, Nov 21, 2021 at 08:43:47AM +0200, Mike Rapoport wrote: > On Fri, Nov 19, 2021 at 03:58:17PM +0800, Calvin Zhang wrote: > > The count of reserved regions in /reserved-memory was limited because > > the struct reserved_mem array was defined statically. This series sorts > > out reserved memory code and allocates that array from early allocator. > > > > Note: reserved region with fixed location must be reserved before any > > memory allocation. While struct reserved_mem array should be allocated > > after allocator is activated. We make early_init_fdt_scan_reserved_mem() > > do reservation only and add another call to initialize reserved memory. > > So arch code have to change for it. > > I think much simpler would be to use the same constant for sizing > memblock.reserved and reserved_mem arrays. Do those arrays get shrunk? Or do we waste the memory forever? Maybe we can copy and shrink the initial array? Though I suspect struct reserved_mem pointers have already been given out. > > If there is too much reserved regions in the device tree, reserving them in > memblock will fail anyway because memblock also starts with static array > for memblock.reserved, so doing one pass with memblock_reserve() and > another to set up reserved_mem wouldn't help anyway. > > > I'm only familiar with arm and arm64 architectures. Approvals from arch > > maintainers are required. Thank you all. > > > > Calvin Zhang (2): > > of: Sort reserved_mem related code > > of: reserved_mem: Remove reserved regions count restriction > > > > arch/arc/mm/init.c | 3 + > > arch/arm/kernel/setup.c | 2 + > > arch/arm64/kernel/setup.c | 3 + > > arch/csky/kernel/setup.c | 3 + > > arch/h8300/kernel/setup.c | 2 + > > arch/mips/kernel/setup.c | 3 + > > arch/nds32/kernel/setup.c | 3 + > > arch/nios2/kernel/setup.c | 2 + > > arch/openrisc/kernel/setup.c | 3 + > > arch/powerpc/kernel/setup-common.c | 3 + > > arch/riscv/kernel/setup.c | 2 + > > arch/sh/kernel/setup.c | 3 + > > arch/xtensa/kernel/setup.c | 2 + > > drivers/of/fdt.c | 107 +--------------- > > drivers/of/of_private.h | 12 +- > > drivers/of/of_reserved_mem.c | 189 ++++++++++++++++++++++++----- > > include/linux/of_reserved_mem.h | 4 + > > 17 files changed, 207 insertions(+), 139 deletions(-) > > > > -- > > 2.30.2 > > > > -- > Sincerely yours, > Mike. > 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 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id ABF84C433F5 for ; Tue, 30 Nov 2021 00:08:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc: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=iZaiP5ZZPgQxYtzzIwOvD6/7cVV0JfTR4pLm0ugQi+Y=; b=VDlhDRbK+H18sf nNYjwEGqUFHXFL5SqUEjYvyr2TwFuMoiuMdpPLorqS8ZWgnkSA6N5IzDP2NZA75HMbRNPuJ+h7kT9 31IPg4e35UZfcUHwDPFrtT2+c4R4KEJk4dOxSfsAHR66CT4JvYQ1ETCwNtH0pano5r1ZqPueWmjFw QZy4DpJKCue1yDSHphQy95dQdJbAIFBblsZIRQZIO3Y1A+EIfgn70gFyeNicOOtKW/xWv9Vfhuto8 XHhw96Ed05sAP+wBXTNzv+8T4gN2ncsnLQXG1seZ54p9yBwN6SvJ7ZzlOfGCEdXSLZT4wJfkOsL+9 zxyVQ30IZ3H23EhbdA8Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mrqh1-003BBN-EN; Tue, 30 Nov 2021 00:08:19 +0000 Received: from mail-ot1-f53.google.com ([209.85.210.53]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mrqgx-003B9z-JN; Tue, 30 Nov 2021 00:08:16 +0000 Received: by mail-ot1-f53.google.com with SMTP id 47-20020a9d0332000000b005798ac20d72so27809602otv.9; Mon, 29 Nov 2021 16:08:14 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=D8pPDA8BhqYxJlGll70Jfs/EV2c/vlH3kHLgmxR36Bk=; b=UQdPs1pgJqfxfzc24jLfakVqCQKdhUU4wqTgGy2ngwWMAiPwyZO5muZ5HIA8wt/5tN DnlrIpMTvKp0KGRqIIHRg8rRRI4K5tNhd3qhKWxtHKqeeWOAVOrjhsVEUUYj9Ihb6YEF YIovEv2ORzQW0VwHEwFitqX/LIusmzNvPmoXIu0nouO6gnQ2m3sBg9ddV94iRa/0qce5 Igxz1qLJB/sW6QDeLr6NrX0ermwBOy5/HUS3C1Ott9Qatkx3NAZR/0Ul6pSYCbu7DWFf CeH8QEe/hWXfOeVGQe8Y28KsKgxMhYGhMLKzl533PvnRK9BvUSBrlfo6ykIOn0Fc7vN1 Qoxg== X-Gm-Message-State: AOAM533r805ZX7iI6ed7rLEmg5xnq+f1olsa6qRZvETN19YazXdg38Fu 3x9J4tci20YeMHtf+QkJPw== X-Google-Smtp-Source: ABdhPJwHdVFEp5hd/T8aXyXLlCP6k0CfP+fpF2T3r+PJoHiG4EwmK+ob5JSJ6nKmQgmurmZ684PLSA== X-Received: by 2002:a9d:4702:: with SMTP id a2mr47864106otf.262.1638230893962; Mon, 29 Nov 2021 16:08:13 -0800 (PST) Received: from robh.at.kernel.org (66-90-148-213.dyn.grandenetworks.net. [66.90.148.213]) by smtp.gmail.com with ESMTPSA id bi20sm3422829oib.29.2021.11.29.16.08.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Nov 2021 16:08:13 -0800 (PST) Received: (nullmailer pid 864351 invoked by uid 1000); Tue, 30 Nov 2021 00:08:10 -0000 Date: Mon, 29 Nov 2021 18:08:10 -0600 From: Rob Herring To: Mike Rapoport Cc: Calvin Zhang , Vineet Gupta , Russell King , Catalin Marinas , Will Deacon , Guo Ren , Yoshinori Sato , Thomas Bogendoerfer , Nick Hu , Greentime Hu , Vincent Chen , Dinh Nguyen , Jonas Bonn , Stefan Kristiansson , Stafford Horne , Michael Ellerman , Benjamin Herrenschmidt , Paul Mackerras , Paul Walmsley , Palmer Dabbelt , Albert Ou , Rich Felker , Chris Zankel , Max Filippov , Frank Rowand , Andrew Morton , David Hildenbrand , Arnd Bergmann , Kefeng Wang , Vladimir Isaev , "Russell King (Oracle)" , "Kirill A. Shutemov" , Guenter Roeck , Marc Zyngier , David Brazdil , Anshuman Khandual , Andrey Konovalov , Mark Rutland , Souptick Joarder , Jinyang He , "Rafael J. Wysocki" , Serge Semin , Tiezhu Yang , Geert Uytterhoeven , Randy Dunlap , Ley Foon Tan , Andreas Oetken , Christophe JAILLET , Christophe Leroy , Zhang Yunkai , Andy Shevchenko , Markus Elfring , Ganesh Goudar , "Aneesh Kumar K.V" , Atish Patra , Anup Patel , Nick Kossifidis , Alexandre Ghiti , Vitaly Wool , Thierry Reding , Lee Jones , Guo Ren , Alexander Sverdlin , Greg Kroah-Hartman , Mauri Sandberg , Palmer Dabbelt , linux-snps-arc@lists.infradead.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-csky@vger.kernel.org, uclinux-h8-devel@lists.sourceforge.jp, linux-mips@vger.kernel.org, openrisc@lists.librecores.org, linuxppc-dev@lists.ozlabs.org, linux-riscv@lists.infradead.org, linux-sh@vger.kernel.org, linux-xtensa@linux-xtensa.org, devicetree@vger.kernel.org Subject: Re: [PATCH 0/2] of: remove reserved regions count restriction Message-ID: References: <20211119075844.2902592-1-calvinzhang.cool@gmail.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211129_160815_654594_C2A4A3B0 X-CRM114-Status: GOOD ( 24.52 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , 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 Sun, Nov 21, 2021 at 08:43:47AM +0200, Mike Rapoport wrote: > On Fri, Nov 19, 2021 at 03:58:17PM +0800, Calvin Zhang wrote: > > The count of reserved regions in /reserved-memory was limited because > > the struct reserved_mem array was defined statically. This series sorts > > out reserved memory code and allocates that array from early allocator. > > > > Note: reserved region with fixed location must be reserved before any > > memory allocation. While struct reserved_mem array should be allocated > > after allocator is activated. We make early_init_fdt_scan_reserved_mem() > > do reservation only and add another call to initialize reserved memory. > > So arch code have to change for it. > > I think much simpler would be to use the same constant for sizing > memblock.reserved and reserved_mem arrays. Do those arrays get shrunk? Or do we waste the memory forever? Maybe we can copy and shrink the initial array? Though I suspect struct reserved_mem pointers have already been given out. > > If there is too much reserved regions in the device tree, reserving them in > memblock will fail anyway because memblock also starts with static array > for memblock.reserved, so doing one pass with memblock_reserve() and > another to set up reserved_mem wouldn't help anyway. > > > I'm only familiar with arm and arm64 architectures. Approvals from arch > > maintainers are required. Thank you all. > > > > Calvin Zhang (2): > > of: Sort reserved_mem related code > > of: reserved_mem: Remove reserved regions count restriction > > > > arch/arc/mm/init.c | 3 + > > arch/arm/kernel/setup.c | 2 + > > arch/arm64/kernel/setup.c | 3 + > > arch/csky/kernel/setup.c | 3 + > > arch/h8300/kernel/setup.c | 2 + > > arch/mips/kernel/setup.c | 3 + > > arch/nds32/kernel/setup.c | 3 + > > arch/nios2/kernel/setup.c | 2 + > > arch/openrisc/kernel/setup.c | 3 + > > arch/powerpc/kernel/setup-common.c | 3 + > > arch/riscv/kernel/setup.c | 2 + > > arch/sh/kernel/setup.c | 3 + > > arch/xtensa/kernel/setup.c | 2 + > > drivers/of/fdt.c | 107 +--------------- > > drivers/of/of_private.h | 12 +- > > drivers/of/of_reserved_mem.c | 189 ++++++++++++++++++++++++----- > > include/linux/of_reserved_mem.h | 4 + > > 17 files changed, 207 insertions(+), 139 deletions(-) > > > > -- > > 2.30.2 > > > > -- > Sincerely yours, > Mike. > _______________________________________________ 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 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 007E8C433EF for ; Tue, 30 Nov 2021 00:08:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc: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=FF+WD4RomcOhkA/sDc0GFA2CszbRI96kTrI6dTS0+iY=; b=LDuXIagEqw+NOj wq7svkTO3IHYttOdLgj/CI+8slGAmXMGjS9vZxt+kaxDaSzMPuWtXbKEyCIAjo6rjksZhk2MH9oyq Z4oAKSofuGylGiMldZl2ANRADO5aGV9XjwnIGJr8o+0wUoGxC3e+cK+RbQdVeaYAy+ys7zKs6bZ5+ Ze472MfHFyDj16NsBnJuh/Oto7K59LBvuVpMFqzXJFDIxl7yjk2M6/4c1SA20zpBEysf8d35sYkoz Bppws+ycBO865tFEHNYBdBAC96vdq44te6fFLPvOAB4nd8ZSGCrebztB1d84zikJ513jAD8DeEvLa hUtvIoMnDR+kgjWg7wNA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mrqh0-003BBB-73; Tue, 30 Nov 2021 00:08:18 +0000 Received: from mail-ot1-f53.google.com ([209.85.210.53]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mrqgx-003B9z-JN; Tue, 30 Nov 2021 00:08:16 +0000 Received: by mail-ot1-f53.google.com with SMTP id 47-20020a9d0332000000b005798ac20d72so27809602otv.9; Mon, 29 Nov 2021 16:08:14 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=D8pPDA8BhqYxJlGll70Jfs/EV2c/vlH3kHLgmxR36Bk=; b=UQdPs1pgJqfxfzc24jLfakVqCQKdhUU4wqTgGy2ngwWMAiPwyZO5muZ5HIA8wt/5tN DnlrIpMTvKp0KGRqIIHRg8rRRI4K5tNhd3qhKWxtHKqeeWOAVOrjhsVEUUYj9Ihb6YEF YIovEv2ORzQW0VwHEwFitqX/LIusmzNvPmoXIu0nouO6gnQ2m3sBg9ddV94iRa/0qce5 Igxz1qLJB/sW6QDeLr6NrX0ermwBOy5/HUS3C1Ott9Qatkx3NAZR/0Ul6pSYCbu7DWFf CeH8QEe/hWXfOeVGQe8Y28KsKgxMhYGhMLKzl533PvnRK9BvUSBrlfo6ykIOn0Fc7vN1 Qoxg== X-Gm-Message-State: AOAM533r805ZX7iI6ed7rLEmg5xnq+f1olsa6qRZvETN19YazXdg38Fu 3x9J4tci20YeMHtf+QkJPw== X-Google-Smtp-Source: ABdhPJwHdVFEp5hd/T8aXyXLlCP6k0CfP+fpF2T3r+PJoHiG4EwmK+ob5JSJ6nKmQgmurmZ684PLSA== X-Received: by 2002:a9d:4702:: with SMTP id a2mr47864106otf.262.1638230893962; Mon, 29 Nov 2021 16:08:13 -0800 (PST) Received: from robh.at.kernel.org (66-90-148-213.dyn.grandenetworks.net. [66.90.148.213]) by smtp.gmail.com with ESMTPSA id bi20sm3422829oib.29.2021.11.29.16.08.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Nov 2021 16:08:13 -0800 (PST) Received: (nullmailer pid 864351 invoked by uid 1000); Tue, 30 Nov 2021 00:08:10 -0000 Date: Mon, 29 Nov 2021 18:08:10 -0600 From: Rob Herring To: Mike Rapoport Cc: Calvin Zhang , Vineet Gupta , Russell King , Catalin Marinas , Will Deacon , Guo Ren , Yoshinori Sato , Thomas Bogendoerfer , Nick Hu , Greentime Hu , Vincent Chen , Dinh Nguyen , Jonas Bonn , Stefan Kristiansson , Stafford Horne , Michael Ellerman , Benjamin Herrenschmidt , Paul Mackerras , Paul Walmsley , Palmer Dabbelt , Albert Ou , Rich Felker , Chris Zankel , Max Filippov , Frank Rowand , Andrew Morton , David Hildenbrand , Arnd Bergmann , Kefeng Wang , Vladimir Isaev , "Russell King (Oracle)" , "Kirill A. Shutemov" , Guenter Roeck , Marc Zyngier , David Brazdil , Anshuman Khandual , Andrey Konovalov , Mark Rutland , Souptick Joarder , Jinyang He , "Rafael J. Wysocki" , Serge Semin , Tiezhu Yang , Geert Uytterhoeven , Randy Dunlap , Ley Foon Tan , Andreas Oetken , Christophe JAILLET , Christophe Leroy , Zhang Yunkai , Andy Shevchenko , Markus Elfring , Ganesh Goudar , "Aneesh Kumar K.V" , Atish Patra , Anup Patel , Nick Kossifidis , Alexandre Ghiti , Vitaly Wool , Thierry Reding , Lee Jones , Guo Ren , Alexander Sverdlin , Greg Kroah-Hartman , Mauri Sandberg , Palmer Dabbelt , linux-snps-arc@lists.infradead.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-csky@vger.kernel.org, uclinux-h8-devel@lists.sourceforge.jp, linux-mips@vger.kernel.org, openrisc@lists.librecores.org, linuxppc-dev@lists.ozlabs.org, linux-riscv@lists.infradead.org, linux-sh@vger.kernel.org, linux-xtensa@linux-xtensa.org, devicetree@vger.kernel.org Subject: Re: [PATCH 0/2] of: remove reserved regions count restriction Message-ID: References: <20211119075844.2902592-1-calvinzhang.cool@gmail.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211129_160815_654594_C2A4A3B0 X-CRM114-Status: GOOD ( 24.52 ) X-BeenThere: linux-snps-arc@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux on Synopsys ARC Processors List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , 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 Sun, Nov 21, 2021 at 08:43:47AM +0200, Mike Rapoport wrote: > On Fri, Nov 19, 2021 at 03:58:17PM +0800, Calvin Zhang wrote: > > The count of reserved regions in /reserved-memory was limited because > > the struct reserved_mem array was defined statically. This series sorts > > out reserved memory code and allocates that array from early allocator. > > > > Note: reserved region with fixed location must be reserved before any > > memory allocation. While struct reserved_mem array should be allocated > > after allocator is activated. We make early_init_fdt_scan_reserved_mem() > > do reservation only and add another call to initialize reserved memory. > > So arch code have to change for it. > > I think much simpler would be to use the same constant for sizing > memblock.reserved and reserved_mem arrays. Do those arrays get shrunk? Or do we waste the memory forever? Maybe we can copy and shrink the initial array? Though I suspect struct reserved_mem pointers have already been given out. > > If there is too much reserved regions in the device tree, reserving them in > memblock will fail anyway because memblock also starts with static array > for memblock.reserved, so doing one pass with memblock_reserve() and > another to set up reserved_mem wouldn't help anyway. > > > I'm only familiar with arm and arm64 architectures. Approvals from arch > > maintainers are required. Thank you all. > > > > Calvin Zhang (2): > > of: Sort reserved_mem related code > > of: reserved_mem: Remove reserved regions count restriction > > > > arch/arc/mm/init.c | 3 + > > arch/arm/kernel/setup.c | 2 + > > arch/arm64/kernel/setup.c | 3 + > > arch/csky/kernel/setup.c | 3 + > > arch/h8300/kernel/setup.c | 2 + > > arch/mips/kernel/setup.c | 3 + > > arch/nds32/kernel/setup.c | 3 + > > arch/nios2/kernel/setup.c | 2 + > > arch/openrisc/kernel/setup.c | 3 + > > arch/powerpc/kernel/setup-common.c | 3 + > > arch/riscv/kernel/setup.c | 2 + > > arch/sh/kernel/setup.c | 3 + > > arch/xtensa/kernel/setup.c | 2 + > > drivers/of/fdt.c | 107 +--------------- > > drivers/of/of_private.h | 12 +- > > drivers/of/of_reserved_mem.c | 189 ++++++++++++++++++++++++----- > > include/linux/of_reserved_mem.h | 4 + > > 17 files changed, 207 insertions(+), 139 deletions(-) > > > > -- > > 2.30.2 > > > > -- > Sincerely yours, > Mike. > _______________________________________________ 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 From: Rob Herring Date: Mon, 29 Nov 2021 18:08:10 -0600 Subject: [OpenRISC] [PATCH 0/2] of: remove reserved regions count restriction In-Reply-To: References: <20211119075844.2902592-1-calvinzhang.cool@gmail.com> Message-ID: List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: openrisc@lists.librecores.org On Sun, Nov 21, 2021 at 08:43:47AM +0200, Mike Rapoport wrote: > On Fri, Nov 19, 2021 at 03:58:17PM +0800, Calvin Zhang wrote: > > The count of reserved regions in /reserved-memory was limited because > > the struct reserved_mem array was defined statically. This series sorts > > out reserved memory code and allocates that array from early allocator. > > > > Note: reserved region with fixed location must be reserved before any > > memory allocation. While struct reserved_mem array should be allocated > > after allocator is activated. We make early_init_fdt_scan_reserved_mem() > > do reservation only and add another call to initialize reserved memory. > > So arch code have to change for it. > > I think much simpler would be to use the same constant for sizing > memblock.reserved and reserved_mem arrays. Do those arrays get shrunk? Or do we waste the memory forever? Maybe we can copy and shrink the initial array? Though I suspect struct reserved_mem pointers have already been given out. > > If there is too much reserved regions in the device tree, reserving them in > memblock will fail anyway because memblock also starts with static array > for memblock.reserved, so doing one pass with memblock_reserve() and > another to set up reserved_mem wouldn't help anyway. > > > I'm only familiar with arm and arm64 architectures. Approvals from arch > > maintainers are required. Thank you all. > > > > Calvin Zhang (2): > > of: Sort reserved_mem related code > > of: reserved_mem: Remove reserved regions count restriction > > > > arch/arc/mm/init.c | 3 + > > arch/arm/kernel/setup.c | 2 + > > arch/arm64/kernel/setup.c | 3 + > > arch/csky/kernel/setup.c | 3 + > > arch/h8300/kernel/setup.c | 2 + > > arch/mips/kernel/setup.c | 3 + > > arch/nds32/kernel/setup.c | 3 + > > arch/nios2/kernel/setup.c | 2 + > > arch/openrisc/kernel/setup.c | 3 + > > arch/powerpc/kernel/setup-common.c | 3 + > > arch/riscv/kernel/setup.c | 2 + > > arch/sh/kernel/setup.c | 3 + > > arch/xtensa/kernel/setup.c | 2 + > > drivers/of/fdt.c | 107 +--------------- > > drivers/of/of_private.h | 12 +- > > drivers/of/of_reserved_mem.c | 189 ++++++++++++++++++++++++----- > > include/linux/of_reserved_mem.h | 4 + > > 17 files changed, 207 insertions(+), 139 deletions(-) > > > > -- > > 2.30.2 > > > > -- > Sincerely yours, > Mike. > 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 Received: from lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id F3900C433EF for ; Tue, 30 Nov 2021 00:44:29 +0000 (UTC) Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4J33Q42PDgz3dfw for ; Tue, 30 Nov 2021 11:44:28 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gmail.com (client-ip=209.85.210.42; helo=mail-ot1-f42.google.com; envelope-from=robherring2@gmail.com; receiver=) Received: from mail-ot1-f42.google.com (mail-ot1-f42.google.com [209.85.210.42]) (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 4J32cJ6N98z2yY7 for ; Tue, 30 Nov 2021 11:08:16 +1100 (AEDT) Received: by mail-ot1-f42.google.com with SMTP id v15-20020a9d604f000000b0056cdb373b82so27841555otj.7 for ; Mon, 29 Nov 2021 16:08:16 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=D8pPDA8BhqYxJlGll70Jfs/EV2c/vlH3kHLgmxR36Bk=; b=Qn6ZnHoV9KBB4EPPJqXtrHmEsMxTz6XdfTyHsBNYagp+lYGVDlNeHZu/NEh3CMs6fh RDS6qf5XqEzQBqUyfZcFaQ9h81NvV/k1rfA6fxxI/OI3cflmijhDL8dX8fBLCE1n7Pej XHn/8VrbhXirIpLndp4P/UKr2ftUVx2a+0mMM6vTCy/QkrGZQz2ib5IidKMK2x7I/Z9a zQOMe4Gio9OMQZR6T0IauXawjk0Vym4HPsDJwJ6XrAdsJTX/wd1kG/8+nZhCh6jy5Rv5 HMe/F7o+4WcIKrdAhEwh67e2twl3582A4k+kSIxSK9d0NZiZ497BvecHnUm5OefuDlsf RZLQ== X-Gm-Message-State: AOAM532CSsAWnjIGG/Q/T2XhDwwTjdXfDmE/+MnP1piwx0XjycRP4HmJ Ob3sxxC2t5xcf2w8vvteHQ== X-Google-Smtp-Source: ABdhPJwHdVFEp5hd/T8aXyXLlCP6k0CfP+fpF2T3r+PJoHiG4EwmK+ob5JSJ6nKmQgmurmZ684PLSA== X-Received: by 2002:a9d:4702:: with SMTP id a2mr47864106otf.262.1638230893962; Mon, 29 Nov 2021 16:08:13 -0800 (PST) Received: from robh.at.kernel.org (66-90-148-213.dyn.grandenetworks.net. [66.90.148.213]) by smtp.gmail.com with ESMTPSA id bi20sm3422829oib.29.2021.11.29.16.08.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Nov 2021 16:08:13 -0800 (PST) Received: (nullmailer pid 864351 invoked by uid 1000); Tue, 30 Nov 2021 00:08:10 -0000 Date: Mon, 29 Nov 2021 18:08:10 -0600 From: Rob Herring To: Mike Rapoport Subject: Re: [PATCH 0/2] of: remove reserved regions count restriction Message-ID: References: <20211119075844.2902592-1-calvinzhang.cool@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Mailman-Approved-At: Tue, 30 Nov 2021 11:43:13 +1100 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: "Kirill A. Shutemov" , Mark Rutland , Kefeng Wang , Rich Felker , Jinyang He , David Hildenbrand , Lee Jones , linux-kernel@vger.kernel.org, Max Filippov , Anup Patel , Guo Ren , Guo Ren , Calvin Zhang , Nick Kossifidis , Vladimir Isaev , Tiezhu Yang , Vincent Chen , Will Deacon , Markus Elfring , Vitaly Wool , Jonas Bonn , devicetree@vger.kernel.org, linux-snps-arc@lists.infradead.org, uclinux-h8-devel@lists.sourceforge.jp, Yoshinori Sato , Palmer Dabbelt , linux-sh@vger.kernel.org, "Rafael J. Wysocki" , Russell King , Ley Foon Tan , Geert Uytterhoeven , "Aneesh Kumar K.V" , Catalin Marinas , Ganesh Goudar , David Brazdil , linux-riscv@lists.infradead.org, Guenter Roeck , Alexander Sverdlin , Thierry Reding , Albert Ou , Arnd Bergmann , Anshuman Khandual , linux-xtensa@linux-xtensa.org, Vineet Gupta , Andreas Oetken , Stefan Kristiansson , "Russell King \(Oracle\)" , linux-csky@vger.kernel.org, Christophe JAILLET , Greentime Hu , Paul Walmsley , Stafford Horne , Andy Shevchenko , linux-arm-kernel@lists.infradead.org, Andrey Konovalov , Christophe Leroy , Chris Zankel , Thomas Bogendoerfer , linux-mips@vger.kernel.org, Alexandre Ghiti , Nick Hu , Atish Patra , Greg Kroah-Hartman , Randy Dunlap , Frank Rowand , Serge Semin , Dinh Nguyen , Zhang Yunkai , Palmer Dabbelt , Souptick Joarder , Marc Zyngier , Mauri Sandberg , Paul Mackerras , Andrew Morton , linuxppc-dev@lists.ozlabs.org, openrisc@lists.librecores.org Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" On Sun, Nov 21, 2021 at 08:43:47AM +0200, Mike Rapoport wrote: > On Fri, Nov 19, 2021 at 03:58:17PM +0800, Calvin Zhang wrote: > > The count of reserved regions in /reserved-memory was limited because > > the struct reserved_mem array was defined statically. This series sorts > > out reserved memory code and allocates that array from early allocator. > > > > Note: reserved region with fixed location must be reserved before any > > memory allocation. While struct reserved_mem array should be allocated > > after allocator is activated. We make early_init_fdt_scan_reserved_mem() > > do reservation only and add another call to initialize reserved memory. > > So arch code have to change for it. > > I think much simpler would be to use the same constant for sizing > memblock.reserved and reserved_mem arrays. Do those arrays get shrunk? Or do we waste the memory forever? Maybe we can copy and shrink the initial array? Though I suspect struct reserved_mem pointers have already been given out. > > If there is too much reserved regions in the device tree, reserving them in > memblock will fail anyway because memblock also starts with static array > for memblock.reserved, so doing one pass with memblock_reserve() and > another to set up reserved_mem wouldn't help anyway. > > > I'm only familiar with arm and arm64 architectures. Approvals from arch > > maintainers are required. Thank you all. > > > > Calvin Zhang (2): > > of: Sort reserved_mem related code > > of: reserved_mem: Remove reserved regions count restriction > > > > arch/arc/mm/init.c | 3 + > > arch/arm/kernel/setup.c | 2 + > > arch/arm64/kernel/setup.c | 3 + > > arch/csky/kernel/setup.c | 3 + > > arch/h8300/kernel/setup.c | 2 + > > arch/mips/kernel/setup.c | 3 + > > arch/nds32/kernel/setup.c | 3 + > > arch/nios2/kernel/setup.c | 2 + > > arch/openrisc/kernel/setup.c | 3 + > > arch/powerpc/kernel/setup-common.c | 3 + > > arch/riscv/kernel/setup.c | 2 + > > arch/sh/kernel/setup.c | 3 + > > arch/xtensa/kernel/setup.c | 2 + > > drivers/of/fdt.c | 107 +--------------- > > drivers/of/of_private.h | 12 +- > > drivers/of/of_reserved_mem.c | 189 ++++++++++++++++++++++++----- > > include/linux/of_reserved_mem.h | 4 + > > 17 files changed, 207 insertions(+), 139 deletions(-) > > > > -- > > 2.30.2 > > > > -- > Sincerely yours, > Mike. >