Received: by 2002:a05:6358:489b:b0:bb:da1:e618 with SMTP id x27csp4758273rwn; Sun, 11 Sep 2022 21:05:10 -0700 (PDT) X-Google-Smtp-Source: AA6agR6Lul+Z45803RnS7EH4H51G/mIx2vU3MDa97qKYlPp06/3CvJrK5npzYPj5u9iTAUL7dv+C X-Received: by 2002:a17:902:d70e:b0:178:2d9d:ba7b with SMTP id w14-20020a170902d70e00b001782d9dba7bmr3978236ply.90.1662955510353; Sun, 11 Sep 2022 21:05:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662955510; cv=none; d=google.com; s=arc-20160816; b=XBdkcVnWpMBjiVWf+ZwyT4vVPJO6MaJG2pmIy6LsxEWpaJjcKiCITU5VlZvI38bVjc g6Cbb82zgAJQ9EUD7l38gUK7VFgcbjT43nyOjCGtUMvJY3EQGuC28u/qF6ZxIO6kJbTl 5rGgczvL8Tbnd7NWB+6hf/H2q0jmpIyn9e5bnz3M/yCd3HOJSzin7C/rBymetEH0zN1r eWpLzJbyuT70n3WHJhzP6Ga+MLySHwL1Z8hDTTJmPBc/aytJjV/sEHe43fGILJ56R0b2 PXRI8dSLHOD1W1ZTpwf8PG574pRwWYwl+HNJDd0bXHenYe4jMpJ/uPKnF40vKbUg01Uo BPqA== 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:dkim-signature; bh=0YI2fZY4L8mJJbSUbUjIEfSD3oHCErBi4sdySSSE2E0=; b=hLvn0XfLUtakCfM9J4rw5XV8ntHAa5OXr88d5v+MYGbX7XgHBH3Ajsgcnh6XghPiOj ubVgTDqZD+pxctsXmWjOLb4qkK2bw598j8tcBAR9Rhms1xWFMOps7UFQgqGiTvyEhV9j p/32H9VypDBeXjeICYsv6Z/58bb6p9iDP1FevungqkSA9urnTANAD+OmC+ERfd4SbF6G TPEONtopc28Uukc9feXU3UNtqHJELkzBEJRZ7LM/2N6XEWH+ai5gtGhXDeV1V/+D0lBh VgbZqnoZ/bQPJEaW75mYcA96rPYUdVkPIs1BekcJvBRknRFjgoNkFlIESjxj6Cf+YPhj Xdww== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="Gsa/qohr"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g16-20020a63e610000000b00438e839828bsi3117993pgh.72.2022.09.11.21.04.56; Sun, 11 Sep 2022 21:05:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="Gsa/qohr"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229514AbiILDr1 (ORCPT + 99 others); Sun, 11 Sep 2022 23:47:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49442 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229459AbiILDrY (ORCPT ); Sun, 11 Sep 2022 23:47:24 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1C4F122281 for ; Sun, 11 Sep 2022 20:47:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1662954443; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=0YI2fZY4L8mJJbSUbUjIEfSD3oHCErBi4sdySSSE2E0=; b=Gsa/qohreWaxf74a5Aq1YjHyQDL6mokrZ3hp7sP5KlTWzTMZ1yRFMCrmAIgDzvXl5l1wnh 1gOJxc+ym/Rv8s9117ZKQ1OgeBm4mtod83LvcFmFoNv9o4NXvRZXqbxZOMMMj2aqXUW7SP aXfE+DOEAjwq6vUj6Nbpy9SdCSoU5i4= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-544-3HCIQzL1M1ydpu-6_MnOoA-1; Sun, 11 Sep 2022 23:47:20 -0400 X-MC-Unique: 3HCIQzL1M1ydpu-6_MnOoA-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id BDD1D185A794; Mon, 12 Sep 2022 03:47:19 +0000 (UTC) Received: from localhost (ovpn-12-21.pek2.redhat.com [10.72.12.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 3C8552026D64; Mon, 12 Sep 2022 03:47:18 +0000 (UTC) Date: Mon, 12 Sep 2022 11:47:14 +0800 From: Baoquan He To: Eric DeVolder , bp@alien8.de, akpm@linux-foundation.org, x86@kernel.org Cc: linux-kernel@vger.kernel.org, kexec@lists.infradead.org, ebiederm@xmission.com, dyoung@redhat.com, vgoyal@redhat.com, tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, dave.hansen@linux.intel.com, hpa@zytor.com, nramas@linux.microsoft.com, thomas.lendacky@amd.com, robh@kernel.org, efault@gmx.de, rppt@kernel.org, david@redhat.com, sourabhjain@linux.ibm.com, konrad.wilk@oracle.com, boris.ostrovsky@oracle.com Subject: Re: [PATCH v12 0/7] crash: Kernel handling of CPU and memory hot un/plug Message-ID: References: <20220909210509.6286-1-eric.devolder@oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220909210509.6286-1-eric.devolder@oracle.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 09/09/22 at 05:05pm, Eric DeVolder wrote: > When the kdump service is loaded, if a CPU or memory is hot > un/plugged, the crash elfcorehdr, which describes the CPUs > and memory in the system, must also be updated, else the resulting > vmcore is inaccurate (eg. missing either CPU context or memory > regions). > > The current solution utilizes udev to initiate an unload-then-reload > of the kdump image (e. kernel, initrd, boot_params, puratory and > elfcorehdr) by the userspace kexec utility. In previous posts I have > outlined the significant performance problems related to offloading > this activity to userspace. > > This patchset introduces a generic crash hot un/plug handler that > registers with the CPU and memory notifiers. Upon CPU or memory > changes, this generic handler is invoked and performs important > housekeeping, for example obtaining the appropriate lock, and then > invokes an architecture specific handler to do the appropriate > updates. > > In the case of x86_64, the arch specific handler generates a new > elfcorehdr, and overwrites the old one in memory. No involvement > with userspace needed. Thank a lot for all the effort, Eric. Hi Boris, Andrew, This version looks good to me. It introduces a framework for kdump to react mem/cpu hotplug eveut and add x86 handler. Should this go to x86 tree or mm tree? Please check what else we need do to fix or improve. Thanks Baoquan