Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp7823900ybi; Tue, 9 Jul 2019 05:01:24 -0700 (PDT) X-Google-Smtp-Source: APXvYqxlNrS9HjJgIkcQZKNGC4BBoEqe7FNnb1C0z4Qb1UNTVzG3LMLXUYq4lRW8xGOQolex7JpH X-Received: by 2002:a63:ea17:: with SMTP id c23mr15480164pgi.65.1562673684190; Tue, 09 Jul 2019 05:01:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562673684; cv=none; d=google.com; s=arc-20160816; b=XDKwYm59bRkHcm5EPNQ23DU24rz0ojJaQrTb2KbtDnxIEwf9fBFNo7o0BlL0FwuU9Z /4tswif3iykVdgr8MJi5L3m8/5znhiOWYxAE9WvSud+pKa8TOBKPiOf8q7rxMHsnBNRN YeCqVBt5xkz77wI97TMmqI90+MeJXXfV2jXfBd63EDFgb49uEEI9ISOgZtOHjvMhdMTk OFHno+E11ICuEHA58TQ4FFjyWfTlm/azXrxn4dTCKfYtbWGg+9R8dLyCHnT5RKdbHAU2 iFBWB9MfOhnvLq8ufhnPibD07HwKmPrKuV83U1Zaa0nlfHHbXq46BegujXgXqWJtjmcD BN8Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=fKbGxWYdL+PXqig+QsaSndvtKUSYb21rZ8BE5B063xE=; b=K2Pf92DuRL+3T9HU5pJkqAEzK0ObbSeWfLQ3tiAK1vQse8eC43l8momhUWup0pUo9S qrfoaQVnKGhX99HIrGaEBWWNTlvzlkhAiVWEcRzReBVOnRTcBv1aow4mTkJYY7JFmLH/ Qta68HtNTkBEolA9yed1qqSo/3qVacKOGMohKEb2XvpQQhPdngtJ3kpTDs9aFUmjpM68 RR8HrNMgEVhNmiz3wzrbbdgtEk4uKmH/0F7nv8gMqXwCpkMBFSaulWa6toM+KAwWOJjr 1Z4tpc7uE41/EJI9t70e1IutiEjHe/J7JVvYTg0k9EYl3SmiMdH5yq5PcRWsZUOLnQr9 6YrA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x3si20863161pgr.22.2019.07.09.05.01.08; Tue, 09 Jul 2019 05:01:24 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726692AbfGIL72 (ORCPT + 99 others); Tue, 9 Jul 2019 07:59:28 -0400 Received: from foss.arm.com ([217.140.110.172]:42226 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726002AbfGIL71 (ORCPT ); Tue, 9 Jul 2019 07:59:27 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 026F02B; Tue, 9 Jul 2019 04:59:26 -0700 (PDT) Received: from [10.1.196.105] (eglon.cambridge.arm.com [10.1.196.105]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 7296C3F59C; Tue, 9 Jul 2019 04:59:23 -0700 (PDT) Subject: Re: [v1 0/5] allow to reserve memory for normal kexec kernel To: Pavel Tatashin Cc: Bhupesh Sharma , James Morris , Sasha Levin , Eric Biederman , kexec mailing list , Linux Kernel Mailing List , Jonathan Corbet , Catalin Marinas , will@kernel.org, Linux Doc Mailing List , linux-arm-kernel References: <20190708211528.12392-1-pasha.tatashin@soleen.com> From: James Morse Message-ID: <2d60f302-5161-638a-76cd-d7d79e5631fe@arm.com> Date: Tue, 9 Jul 2019 12:59:22 +0100 User-Agent: Mozilla/5.0 (X11; Linux aarch64; rv:60.0) Gecko/20100101 Thunderbird/60.7.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-GB Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Pavel, On 09/07/2019 11:55, Pavel Tatashin wrote: > On Tue, Jul 9, 2019 at 6:36 AM Bhupesh Sharma wrote: >> On Tue, Jul 9, 2019 at 2:46 AM Pavel Tatashin wrote: >>> Currently, it is only allowed to reserve memory for crash kernel, because >>> it is a requirement in order to be able to boot into crash kernel without >>> touching memory of crashed kernel is to have memory reserved. >>> >>> The second benefit for having memory reserved for kexec kernel is >>> that it does not require a relocation after segments are loaded into >>> memory. >>> >>> If kexec functionality is used for a fast system update, with a minimal >>> downtime, the relocation of kernel + initramfs might take a significant >>> portion of reboot. >>> >>> In fact, on the machine that we are using, that has ARM64 processor >>> it takes 0.35s to relocate during kexec, thus taking 52% of kernel reboot >>> time: >>> >>> kernel shutdown 0.03s >>> relocation 0.35s >>> kernel startup 0.29s >>> >>> Image: 13M and initramfs is 24M. If initramfs increases, the relocation >>> time increases proportionally. >>> >>> While, it is possible to add 'kexeckernel=' parameters support to other >>> architectures by modifying reserve_crashkernel(), in this series this is >>> done for arm64 only. >> >> This seems like an issue with time spent while doing sha256 >> verification while in purgatory. >> >> Can you please try the following two patches which enable D-cache in >> purgatory before SHA verification and disable it before switching to >> kernel: >> >> http://lists.infradead.org/pipermail/kexec/2017-May/018839.html >> http://lists.infradead.org/pipermail/kexec/2017-May/018840.html > > Hi Bhupesh, > > The verification was taking 2.31s. This is why it is disabled via > kexec's '-i' flag. Therefore 0.35s is only the relocation part where > time is spent, and with my patches the time is completely gone. > Actually, I am glad you showed these patches to me because I might > pull them and enable verification for our needs. > >> >> Note that these were not accepted upstream but are included in several >> distros in some form or the other :) > > Enabling MMU and D-Cache for relocation would essentially require the > same changes in kernel. Could you please share exactly why these were > not accepted upstream into kexec-tools? Because '--no-checks' is a much simpler alternative. More of the discussion: https://lore.kernel.org/linux-arm-kernel/5599813d-f83c-d154-287a-c131c48292ca@arm.com/ While you can make purgatory a fully-fledged operating system, it doesn't really need to do anything on arm64. Errata-workarounds alone are a reason not do start down this path. Thanks, James