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=-3.8 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,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 A8647C43461 for ; Tue, 20 Apr 2021 15:25:24 +0000 (UTC) Received: from mm01.cs.columbia.edu (mm01.cs.columbia.edu [128.59.11.253]) by mail.kernel.org (Postfix) with ESMTP id E223D613CF for ; Tue, 20 Apr 2021 15:25:23 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E223D613CF Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvmarm-bounces@lists.cs.columbia.edu Received: from localhost (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 63D704B3CA; Tue, 20 Apr 2021 11:25:23 -0400 (EDT) X-Virus-Scanned: at lists.cs.columbia.edu Authentication-Results: mm01.cs.columbia.edu (amavisd-new); dkim=softfail (fail, message has been altered) header.i=@kernel.org Received: from mm01.cs.columbia.edu ([127.0.0.1]) by localhost (mm01.cs.columbia.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id D6uVIY2AwvVB; Tue, 20 Apr 2021 11:25:18 -0400 (EDT) Received: from mm01.cs.columbia.edu (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 0EE0E4B3C3; Tue, 20 Apr 2021 11:25:18 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id C6F324B3C3 for ; Tue, 20 Apr 2021 11:25:16 -0400 (EDT) X-Virus-Scanned: at lists.cs.columbia.edu Received: from mm01.cs.columbia.edu ([127.0.0.1]) by localhost (mm01.cs.columbia.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id wEtWD13SfkKA for ; Tue, 20 Apr 2021 11:25:11 -0400 (EDT) Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by mm01.cs.columbia.edu (Postfix) with ESMTPS id B99774B3A2 for ; Tue, 20 Apr 2021 11:25:11 -0400 (EDT) Received: by mail.kernel.org (Postfix) with ESMTPSA id 982F161264; Tue, 20 Apr 2021 15:25:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1618932310; bh=MAjswkG1d6uIfyIvGoPH2JcXnT5VvPujn7l2uT7Uvj4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=XWMQKAMU43ygxwHm/tIVp+WpJQapUl0Kd60x6HPlbDjcKHnf74tigDwWzGVjUZtAA tSdT+jZGx+d3ZPsKLu+jqBEA39bKT+7+0vr0dhyxEZGCpGlPxkgZ97678lO8WgGG4d QgW3tLOkl5mV+MxGBxxN5j8RAFrxIUGHaYegouiIHqIGoy34Dvfl8diR65SAtnm2sr Lmm/xaDLwYIOcOCnrqMkGqhYpZmIddlqTjCcrJUYJP4M5Cr95OivNBA3jWrHSClyG2 NlCodhM9dvGtr9D03VRf+IlIRcvRBQbVUFXaCEmYNLH08BeSOZ5UALddCrzzC0+Eer T0ouGAFTRdlJA== Date: Tue, 20 Apr 2021 18:25:01 +0300 From: Mike Rapoport To: David Hildenbrand Subject: Re: [PATCH v1 2/4] memblock: update initialization of reserved pages Message-ID: References: <20210420090925.7457-1-rppt@kernel.org> <20210420090925.7457-3-rppt@kernel.org> <45a7e13d-3e44-3b94-a253-2df72649a83d@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <45a7e13d-3e44-3b94-a253-2df72649a83d@redhat.com> Cc: Anshuman Khandual , Catalin Marinas , linux-kernel@vger.kernel.org, Mike Rapoport , linux-mm@kvack.org, kvmarm@lists.cs.columbia.edu, Marc Zyngier , Will Deacon , linux-arm-kernel@lists.infradead.org X-BeenThere: kvmarm@lists.cs.columbia.edu X-Mailman-Version: 2.1.14 Precedence: list List-Id: Where KVM/ARM decisions are made List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: kvmarm-bounces@lists.cs.columbia.edu Sender: kvmarm-bounces@lists.cs.columbia.edu On Tue, Apr 20, 2021 at 05:18:55PM +0200, David Hildenbrand wrote: > On 20.04.21 17:03, Mike Rapoport wrote: > > On Tue, Apr 20, 2021 at 03:56:28PM +0200, David Hildenbrand wrote: > > > On 20.04.21 11:09, Mike Rapoport wrote: > > > > From: Mike Rapoport > > > > > > > > The struct pages representing a reserved memory region are initialized > > > > using reserve_bootmem_range() function. This function is called for each > > > > reserved region just before the memory is freed from memblock to the buddy > > > > page allocator. > > > > > > > > The struct pages for MEMBLOCK_NOMAP regions are kept with the default > > > > values set by the memory map initialization which makes it necessary to > > > > have a special treatment for such pages in pfn_valid() and > > > > pfn_valid_within(). > > > > > > Just a general question while thinking about it: > > > > > > Would we right now initialize the memmap of these pages already via > > > memmap_init_zone()->memmap_init_range()? (IOW, not marking the > > > PageReserved?) > > > > Yep. These pages are part of memblock.memory so they are initialized in > > memmap_init_zone()->memmap_init_range() to the default values. > > > > So instead of fully initializing them again, we mostly would only have to > set PageReserved(). Not sure how big that memory usually is -- IOW, if we > really care about optimizing the double-init. IIUC, these are small areas reserved by the firmware, like e.g. ACPI tables. @Ard, am I right? -- Sincerely yours, Mike. _______________________________________________ kvmarm mailing list kvmarm@lists.cs.columbia.edu https://lists.cs.columbia.edu/mailman/listinfo/kvmarm 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=-4.0 required=3.0 tests=BAYES_00,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 B0B7EC433B4 for ; Tue, 20 Apr 2021 15:27:12 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (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 4D6686135F for ; Tue, 20 Apr 2021 15:27:12 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4D6686135F 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-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=desiato.20200630; 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=QaA/s0h70pJhPhm7VYyNGGY9BQ2g40dbjY72/q8/bxQ=; b=goGHpfkL9jN+x7HMuoG6HjE1l /mjI4n0sum+Tq30aIu84a6za3dpGNWTVNlaH06/7xfIRi9N53IUQJK4ZKJ/iEuw5E+kK7TZVhQevO wDAWfb4ydk1BSmzROMYxbBQ3o6T6nrpznPSD0lvNYjn4SHVQccu5kHff0Y+KIiGPz1s8T7hlxS6jT AWSSLSF4dNeB4h3Juza0TmSJNZ8tFAs5/+pHFyjBlOaIlbkfyCDuhUR1wgHe+Nk9JLqq5bI5ffZxh jFqmhIMytkR2aSsIY8HXk5rCLUfADPXHjO3503g7KQ3jAqhhCfkdm9qXIVC80V6BX8aPVmndnCOUu vfERu6DSw==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lYsFZ-00CTO4-CR; Tue, 20 Apr 2021 15:25:17 +0000 Received: from bombadil.infradead.org ([2607:7c80:54:e::133]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lYsFV-00CTNc-Jg for linux-arm-kernel@desiato.infradead.org; Tue, 20 Apr 2021 15:25:13 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; 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=bT3jyP8yzYwAxUBwmB4xODPrLC8HhYm5F9X7uIr29zM=; b=0TDyl2/ozUlzYXZeCXTxypGx5E NSu2zHXtOl4YgrBnhQDVfhhBlg8lER/qKDxhjbvCs/rl2fcBskWuRxUi9FW2NjnRPEHk0whsCAWBa dvvEnMsE85rEQ70qn3gK4HVgXIiWU/Dct6DQTMYf1nmGioKv5XldBYg4uKaGGx8Lkz9mjFTeO1Acp FvSMoZH3vX+lfc2nvlUuUJJVMBg5E4tTZaQdIMkAp6t5PC8BPNhm9rFDNZFrn9wYP3RARoj63oFQZ kGDaUejYnbsZ68DSqR5upzoYqWy2grjYNycFtb+WxJuqGfgdDm77/IYTtjeEkjwR0mLZBhFodv7fI iKR3YMQA==; Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lYsFT-00CEUS-5d for linux-arm-kernel@lists.infradead.org; Tue, 20 Apr 2021 15:25:12 +0000 Received: by mail.kernel.org (Postfix) with ESMTPSA id 982F161264; Tue, 20 Apr 2021 15:25:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1618932310; bh=MAjswkG1d6uIfyIvGoPH2JcXnT5VvPujn7l2uT7Uvj4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=XWMQKAMU43ygxwHm/tIVp+WpJQapUl0Kd60x6HPlbDjcKHnf74tigDwWzGVjUZtAA tSdT+jZGx+d3ZPsKLu+jqBEA39bKT+7+0vr0dhyxEZGCpGlPxkgZ97678lO8WgGG4d QgW3tLOkl5mV+MxGBxxN5j8RAFrxIUGHaYegouiIHqIGoy34Dvfl8diR65SAtnm2sr Lmm/xaDLwYIOcOCnrqMkGqhYpZmIddlqTjCcrJUYJP4M5Cr95OivNBA3jWrHSClyG2 NlCodhM9dvGtr9D03VRf+IlIRcvRBQbVUFXaCEmYNLH08BeSOZ5UALddCrzzC0+Eer T0ouGAFTRdlJA== Date: Tue, 20 Apr 2021 18:25:01 +0300 From: Mike Rapoport To: David Hildenbrand Cc: linux-arm-kernel@lists.infradead.org, Anshuman Khandual , Ard Biesheuvel , Catalin Marinas , Marc Zyngier , Mark Rutland , Mike Rapoport , Will Deacon , kvmarm@lists.cs.columbia.edu, linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: Re: [PATCH v1 2/4] memblock: update initialization of reserved pages Message-ID: References: <20210420090925.7457-1-rppt@kernel.org> <20210420090925.7457-3-rppt@kernel.org> <45a7e13d-3e44-3b94-a253-2df72649a83d@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <45a7e13d-3e44-3b94-a253-2df72649a83d@redhat.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210420_082511_266995_304CF488 X-CRM114-Status: GOOD ( 19.68 ) X-BeenThere: linux-arm-kernel@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-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Tue, Apr 20, 2021 at 05:18:55PM +0200, David Hildenbrand wrote: > On 20.04.21 17:03, Mike Rapoport wrote: > > On Tue, Apr 20, 2021 at 03:56:28PM +0200, David Hildenbrand wrote: > > > On 20.04.21 11:09, Mike Rapoport wrote: > > > > From: Mike Rapoport > > > > > > > > The struct pages representing a reserved memory region are initialized > > > > using reserve_bootmem_range() function. This function is called for each > > > > reserved region just before the memory is freed from memblock to the buddy > > > > page allocator. > > > > > > > > The struct pages for MEMBLOCK_NOMAP regions are kept with the default > > > > values set by the memory map initialization which makes it necessary to > > > > have a special treatment for such pages in pfn_valid() and > > > > pfn_valid_within(). > > > > > > Just a general question while thinking about it: > > > > > > Would we right now initialize the memmap of these pages already via > > > memmap_init_zone()->memmap_init_range()? (IOW, not marking the > > > PageReserved?) > > > > Yep. These pages are part of memblock.memory so they are initialized in > > memmap_init_zone()->memmap_init_range() to the default values. > > > > So instead of fully initializing them again, we mostly would only have to > set PageReserved(). Not sure how big that memory usually is -- IOW, if we > really care about optimizing the double-init. IIUC, these are small areas reserved by the firmware, like e.g. ACPI tables. @Ard, am I right? -- Sincerely yours, Mike. _______________________________________________ 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 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=-6.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,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 B4B01C433ED for ; Tue, 20 Apr 2021 15:25:13 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 1D37161354 for ; Tue, 20 Apr 2021 15:25:12 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1D37161354 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 6A5826B006C; Tue, 20 Apr 2021 11:25:12 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 655656B006E; Tue, 20 Apr 2021 11:25:12 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 4F5E86B0070; Tue, 20 Apr 2021 11:25:12 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0216.hostedemail.com [216.40.44.216]) by kanga.kvack.org (Postfix) with ESMTP id 30E126B006C for ; Tue, 20 Apr 2021 11:25:12 -0400 (EDT) Received: from smtpin05.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id DAEA28249980 for ; Tue, 20 Apr 2021 15:25:11 +0000 (UTC) X-FDA: 78053118822.05.084A6C8 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf02.hostedemail.com (Postfix) with ESMTP id 147F540002C8 for ; Tue, 20 Apr 2021 15:24:48 +0000 (UTC) Received: by mail.kernel.org (Postfix) with ESMTPSA id 982F161264; Tue, 20 Apr 2021 15:25:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1618932310; bh=MAjswkG1d6uIfyIvGoPH2JcXnT5VvPujn7l2uT7Uvj4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=XWMQKAMU43ygxwHm/tIVp+WpJQapUl0Kd60x6HPlbDjcKHnf74tigDwWzGVjUZtAA tSdT+jZGx+d3ZPsKLu+jqBEA39bKT+7+0vr0dhyxEZGCpGlPxkgZ97678lO8WgGG4d QgW3tLOkl5mV+MxGBxxN5j8RAFrxIUGHaYegouiIHqIGoy34Dvfl8diR65SAtnm2sr Lmm/xaDLwYIOcOCnrqMkGqhYpZmIddlqTjCcrJUYJP4M5Cr95OivNBA3jWrHSClyG2 NlCodhM9dvGtr9D03VRf+IlIRcvRBQbVUFXaCEmYNLH08BeSOZ5UALddCrzzC0+Eer T0ouGAFTRdlJA== Date: Tue, 20 Apr 2021 18:25:01 +0300 From: Mike Rapoport To: David Hildenbrand Cc: linux-arm-kernel@lists.infradead.org, Anshuman Khandual , Ard Biesheuvel , Catalin Marinas , Marc Zyngier , Mark Rutland , Mike Rapoport , Will Deacon , kvmarm@lists.cs.columbia.edu, linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: Re: [PATCH v1 2/4] memblock: update initialization of reserved pages Message-ID: References: <20210420090925.7457-1-rppt@kernel.org> <20210420090925.7457-3-rppt@kernel.org> <45a7e13d-3e44-3b94-a253-2df72649a83d@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <45a7e13d-3e44-3b94-a253-2df72649a83d@redhat.com> X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: 147F540002C8 X-Stat-Signature: d45chgj5xe3sx81c3f5zjhz6e8wq83rq Received-SPF: none (kernel.org>: No applicable sender policy available) receiver=imf02; identity=mailfrom; envelope-from=""; helo=mail.kernel.org; client-ip=198.145.29.99 X-HE-DKIM-Result: pass/pass X-HE-Tag: 1618932288-506074 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 Tue, Apr 20, 2021 at 05:18:55PM +0200, David Hildenbrand wrote: > On 20.04.21 17:03, Mike Rapoport wrote: > > On Tue, Apr 20, 2021 at 03:56:28PM +0200, David Hildenbrand wrote: > > > On 20.04.21 11:09, Mike Rapoport wrote: > > > > From: Mike Rapoport > > > > > > > > The struct pages representing a reserved memory region are initialized > > > > using reserve_bootmem_range() function. This function is called for each > > > > reserved region just before the memory is freed from memblock to the buddy > > > > page allocator. > > > > > > > > The struct pages for MEMBLOCK_NOMAP regions are kept with the default > > > > values set by the memory map initialization which makes it necessary to > > > > have a special treatment for such pages in pfn_valid() and > > > > pfn_valid_within(). > > > > > > Just a general question while thinking about it: > > > > > > Would we right now initialize the memmap of these pages already via > > > memmap_init_zone()->memmap_init_range()? (IOW, not marking the > > > PageReserved?) > > > > Yep. These pages are part of memblock.memory so they are initialized in > > memmap_init_zone()->memmap_init_range() to the default values. > > > > So instead of fully initializing them again, we mostly would only have to > set PageReserved(). Not sure how big that memory usually is -- IOW, if we > really care about optimizing the double-init. IIUC, these are small areas reserved by the firmware, like e.g. ACPI tables. @Ard, am I right? -- Sincerely yours, Mike.