Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp1224641pxb; Thu, 16 Sep 2021 02:39:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzPghpHcno/ANBahOtbUhgVtUNk6H1jM71O3ShRm0ZrVa9GcOiMok1bmE3MNqEbdmMhneEq X-Received: by 2002:a05:6402:cbb:: with SMTP id cn27mr5530035edb.5.1631785167731; Thu, 16 Sep 2021 02:39:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631785167; cv=none; d=google.com; s=arc-20160816; b=u6Zmu3zv5/44KfS91WRLvcog2qKRerfZ6Lu6uUzhKXnnSnXnuEJrZZTqEPuZW585L3 gEHuSCE3Egba8xUHKF/eqdEUpGo53sS6Ln6LFRry231P2th4g/XmbA1pbo5vd9J8Ifn3 v1XF++V3l1G7PT+L1f39HgKHTXdvsnrMLwVEF/l9QunKrZrgC93LI/6w4aSQl9u/PUjH qkx9FTH6k6a0zbbTVPL8cK0RPkvQAkqSaqIeIpyBlynt5cCa6+QGpZkfuzwcVyny3ijs 1t2RyAeNj9JWmKDZmEc4oXtoCI/OSJncAOCHFJS8OI5qJK/8xQ0wjWZQTifVu8QDQjFb YeTQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=KYjzmO25Jgz+mHE5QJxl2NTHuv4UbdlczbZOPfL6D98=; b=b/f9asZdzWzKIsm2SpUilBUiw3fligkYLY9pxmDiQ7sttU6HNBdQedEJUFj6+5+UPG dy8VAyWxxQS5GZp51FgbAYI/TeDlXZru+BV9phxh/PjZy8thIqvHjsll8KvGMjceGGdn qY3SlxcirRctQ22UJtNVEnBracClldTEDek8MMAD175/w4JW9ZwBAodqz2KqMCXDUTez LVKtHnmBVYXAhGvvPqn25YD8uZugStUWwPzJ66IVZRNGwT8zP6fGCtuyW8SRveDaj3If WkVGXPHom47Az5hS4kRNd41KaV2mYS21NYmnf48yM0/02E4a/C2oVk0sE20fWyNWhS/R jx7g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d2si2860464edo.451.2021.09.16.02.39.03; Thu, 16 Sep 2021 02:39:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235504AbhIPJjI (ORCPT + 99 others); Thu, 16 Sep 2021 05:39:08 -0400 Received: from mail.kernel.org ([198.145.29.99]:50850 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235524AbhIPJjH (ORCPT ); Thu, 16 Sep 2021 05:39:07 -0400 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: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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