Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp7765276ybi; Tue, 9 Jul 2019 04:03:35 -0700 (PDT) X-Google-Smtp-Source: APXvYqygtR9vB5T3Q0NOQeSCj69Ehhv79JGdUC1C2eqXEIfPceQk65EE9B6epgeeC0Wt2hUKGN4E X-Received: by 2002:a17:902:8689:: with SMTP id g9mr29221205plo.252.1562670214943; Tue, 09 Jul 2019 04:03:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562670214; cv=none; d=google.com; s=arc-20160816; b=qdoNSAXfW/8lT0No4jXplXAh74GBamAV9whJGVuv8SxDwF2nL0cednlNcntqLiq0Ej SYKNUp32UoqhpwsyRzpVwcmdFhAJB3wMUJ6LTEHiwyoGH45k2Hpy/QhnJ9+mdOjjE49u UgZ+4KqFgRGfrMfRWz4sUfKyjDCJi3XogdwE2621D9lhp6Iu3T6xQsQJfGH2Zsccpewr 8KeyZqzIrOApS8mVzo8QMsMfJfW9QfCTFbIjtuDQbH+unc2hXM/HsNckiPNyaggXS7X9 RmGRXNHKbWdAcYu8YcAbjMxkAhJc+Kn+Z794fhGyZDzbYrCZyYquTfzW4GYMTQyjGE7C 6qSg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=CuR0e69I7mgSfC2aZ+6Blt0AlnXi6b5+QGMHj0cl8wQ=; b=QlEUwbk94BOWPHICps+AAUm6JEZSlLVrinyvl3sbfQlG50iBipJWTCtB+24bOSxBmr sv8yPb6wgUHi94SNhTw6riJ1PKAJUd5cRR0sOKCdKwNfrKo40k18I4COBma8aRzlojan N6id3l2wMZ2ZBaukTdUH47yvbB+Dp22Swhu0Iq1oCVueX6aG3UtkY10Q5ASo/Qj7kJjk EM0BY0eSSDmITOiCiGUilOPGcB+XInRzNvlfSJ+2fcTDWr3R0Rpaj3Xbltbdr57oQR7m uhTCVO8y7nnl50NpGqE2CD5VSs95QK5LBilnbcPARPl7DPv6LTt0dMFqHbs7Cf/17V/+ Wjzg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@soleen.com header.s=google header.b=H3WlmKui; 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 e14si23168715pfd.141.2019.07.09.04.03.15; Tue, 09 Jul 2019 04:03:34 -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; dkim=pass header.i=@soleen.com header.s=google header.b=H3WlmKui; 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 S1726768AbfGIKz4 (ORCPT + 99 others); Tue, 9 Jul 2019 06:55:56 -0400 Received: from mail-ed1-f66.google.com ([209.85.208.66]:40070 "EHLO mail-ed1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725947AbfGIKz4 (ORCPT ); Tue, 9 Jul 2019 06:55:56 -0400 Received: by mail-ed1-f66.google.com with SMTP id k8so17319140eds.7 for ; Tue, 09 Jul 2019 03:55:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=soleen.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=CuR0e69I7mgSfC2aZ+6Blt0AlnXi6b5+QGMHj0cl8wQ=; b=H3WlmKuijQsSU0a7TLuEFl5089i9cBj5bQlzW0gPvihWPMgP7G94S30SDDV2haeICa pGMt/tK8FnppDqzcxSyDW/ZGHEBCDZF9y+SItMZORqBsUrYu7gWSBoRGhqvDlsRgCk3L CJFf3ltd8JZY5lsUyIPS3BcsvbXDX+aEDXSYvTa69E4sO6vP3fGrxCVgD3jxFxcK3kWc 7HgLFC117OAk1gqAJL9/arNhNxDJv5ZGq02OWiM5Qfyr+bIicJ4bYEBP7ydQ+0WcFv/L bDTQbUbW7RbXsY8zovPUrWR5ZXV+ttIdrqIfu0jz4gftf9++zkA4rDA/sSp6z/o/n0Et 6f6A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=CuR0e69I7mgSfC2aZ+6Blt0AlnXi6b5+QGMHj0cl8wQ=; b=ul3PmaiYDKp9fdaeNt0SeDwTtZoZ8OS9sdaXHJZyeIoiTrgdmAvbhp2vv1XnQoAy26 imNmlkc6hQ+kWLwduWnLeJyvjyvzcMLRI3EJlO0n0QI23kMfPPIePnMVRBk2atMOFq9d tBfbIyE/ZxaKH5wwv3dJp+W2CNloFO+sK7UKFbx34cI3Ji4n2JIEw0ORcqH7J5H3IAlS bPfOyIpJ9fYDedVegAL5SDPwP28PVJ2Wd1LYjMBc9GHW+wSbq0iV/UKRb8uEBUSJiDWv gt4kXY2QAd5vWk7XWYWsQHJqgOqTW5RBBohbHUdTxh7xEdvkKZX397jYDlKOUzJt6F7z TN9Q== X-Gm-Message-State: APjAAAXQkiAwDWH3wXR0HjszYC++Wtkj/ddMxysosTss3I7i9VKtieYX l5nDVCVWhbmBErr/1fmIXX6R2cDK33DWP7/8B0mCqg== X-Received: by 2002:a05:6402:782:: with SMTP id d2mr25261183edy.80.1562669754543; Tue, 09 Jul 2019 03:55:54 -0700 (PDT) MIME-Version: 1.0 References: <20190708211528.12392-1-pasha.tatashin@soleen.com> In-Reply-To: From: Pavel Tatashin Date: Tue, 9 Jul 2019 06:55:43 -0400 Message-ID: Subject: Re: [v1 0/5] allow to reserve memory for normal kexec kernel To: Bhupesh Sharma Cc: 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 Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jul 9, 2019 at 6:36 AM Bhupesh Sharma wrote: > > Hi Pavel, > > 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. > > > > Pavel Tatashin (5): > > kexec: quiet down kexec reboot > > kexec: add resource for normal kexec region > > kexec: export common crashkernel/kexeckernel parser > > kexec: use reserved memory for normal kexec reboot > > arm64, kexec: reserve kexeckernel region > > > > .../admin-guide/kernel-parameters.txt | 7 ++ > > arch/arm64/kernel/setup.c | 5 ++ > > arch/arm64/mm/init.c | 83 ++++++++++++------- > > include/linux/crash_core.h | 6 ++ > > include/linux/ioport.h | 1 + > > include/linux/kexec.h | 6 +- > > kernel/crash_core.c | 27 +++--- > > kernel/kexec_core.c | 50 +++++++---- > > 8 files changed, 127 insertions(+), 58 deletions(-) > > > > -- > > 2.22.0 > > 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? Thank you, Pasha > > Thanks, > Bhupesh