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, 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 8AB46C433EF for ; Thu, 16 Sep 2021 09:37:49 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 2172F611C8 for ; Thu, 16 Sep 2021 09:37:49 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 2172F611C8 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id ABCDF6B0072; Thu, 16 Sep 2021 05:37:48 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id A6DAF6B0073; Thu, 16 Sep 2021 05:37:48 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 95C65940007; Thu, 16 Sep 2021 05:37:48 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0104.hostedemail.com [216.40.44.104]) by kanga.kvack.org (Postfix) with ESMTP id 8A50E6B0072 for ; Thu, 16 Sep 2021 05:37:48 -0400 (EDT) Received: from smtpin35.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 339C12C580 for ; Thu, 16 Sep 2021 09:37:48 +0000 (UTC) X-FDA: 78592934616.35.44E49C8 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf26.hostedemail.com (Postfix) with ESMTP id DD7A020019C9 for ; Thu, 16 Sep 2021 09:37:47 +0000 (UTC) Received: by mail.kernel.org (Postfix) with ESMTPSA id 334ED60F4A; Thu, 16 Sep 2021 09:37:43 +0000 (UTC) Date: Thu, 16 Sep 2021 10:37:40 +0100 From: Catalin Marinas To: Pavel Tatashin Cc: James Morris , Sasha Levin , "Eric W. Biederman" , kexec mailing list , LKML , Jonathan Corbet , Will Deacon , Linux ARM , Marc Zyngier , James Morse , Vladimir Murzin , Matthias Brugger , linux-mm , Mark Rutland , steve.capper@arm.com, rfontana@redhat.com, Thomas Gleixner , Selin Dag , Tyler Hicks , Pingfan Liu , Andrew Morton , madvenka@linux.microsoft.com Subject: Re: [PATCH v16 00/15] arm64: MMU enabled kexec relocation Message-ID: References: <20210802215408.804942-1-pasha.tatashin@soleen.com> <20210824180555.GD623@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: DD7A020019C9 X-Stat-Signature: uxp9183rooebewhenzxpuk7spmtnx7og Authentication-Results: imf26.hostedemail.com; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=arm.com (policy=none); spf=pass (imf26.hostedemail.com: domain of cmarinas@kernel.org designates 198.145.29.99 as permitted sender) smtp.mailfrom=cmarinas@kernel.org X-HE-Tag: 1631785067-413341 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 Thu, Aug 26, 2021 at 11:03:21AM -0400, Pavel Tatashin wrote: > On Tue, Aug 24, 2021 at 2:06 PM Catalin Marinas wrote: > > > Enable MMU during kexec relocation in order to improve reboot performance. > > > > > > If kexec functionality is used for a fast system update, with a minimal > > > downtime, the relocation of kernel + initramfs takes a significant portion > > > of reboot. > > > > > > The reason for slow relocation is because it is done without MMU, and thus > > > not benefiting from D-Cache. > > > > The performance improvements are indeed significant on some platforms > > (going from 7s to ~40ms), so I think the merging the series is worth it. > > Some general questions so I better understand the impact: > > > > - Is the kdump path affected in any way? IIUC that doesn't need any > > relocation but we should also make sure we don't create the additional > > page table unnecessarily (should keep as much memory intact as > > possible). Maybe that's already handled. > > Because kdump does not need relocation, we do not reserve pages for > the page table in the kdump reboot case. In fact, with this series, > kdump reboot becomes more straightforward as we skip the relocation > function entirely, and jump directly into the crash kernel (or > purgatory if kexec tools loaded them). > > > - What happens if trans_pgd_create_copy() fails to allocate memory. Does > > it fall back to an MMU-off relocation? > > In case we are so low on memory that trans_pgd_create_copy() fails to > allocate the linear map that uses the large pages (the size of the > page table is tiny) the kexec fails during kexec load time (not during > reboot time), as out of memory. The MMU enabled kexec reboot is always > on, and we should not have several ways to do kexec reboot as it makes > the kexec reboot unpredictable in terms of performance, and also prone > to bugs by having a common MMU enabled path and less common path when > we are low on memory which is never tested. I think this makes sense, especially since it will fail during the kexec load time rather than reboot. I'm ok in principle with this series but I'd need to convince James Morse to have a another look since he followed it more closely than me. Could you please rebase it against 5.15-rc1? Thanks. -- Catalin