Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp2226161rwb; Thu, 17 Nov 2022 08:04:53 -0800 (PST) X-Google-Smtp-Source: AA0mqf5hSB0sbr+WyrysLjsGLHtJgAPeek55xMCGAkGSEwWz4PwX12lx+X68ToZCCu/+XLcRnviG X-Received: by 2002:a17:903:260d:b0:188:b5d6:2873 with SMTP id jd13-20020a170903260d00b00188b5d62873mr3247612plb.144.1668701092920; Thu, 17 Nov 2022 08:04:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668701092; cv=none; d=google.com; s=arc-20160816; b=qmMZKHuRZQ3OUR+F7nUrJUcnErIKAfLxd/vX3pZTRbr23Ck04TttgZSIssbdT3So9z vOuOxx+wUpNwYvo9LCX51uNjqZkmNBFRXGQH6jp2kifGyVQqTt45Ke/m8EY6+wGRbRRg apStcY4lcC6G6sa4zT66ceRnEBelRBEQtlsgr/qDiq2OyKNN6OZVY30nwmy+HQ5FsC/+ Qhs2uwGGdOOCW4G1Dpe3wDvYYkcJPMimKPmIIxVJNEIfV3CJ+HhE3wg5cYr/t8MQ77L8 FTtLli+r5Q5rpixDMG4kC/Wf3bjBLVM7z1CT7NBxd0n9b60VDbDLdJGZtXtArT6+bDGZ ePnw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :date:dkim-signature; bh=O5HKEB3fHlBEv/KV0IugSFogCrFrsWVhqrP69OBbPPg=; b=BNnf0ymsjuqqRsTjapBwObCxVi5108wtMy2TVjfOibQyDi8n25qyRDrQ/i6Gu6qgFg XI4FnVZQnLSLgweCf2e5ldBeo05twqjFiZ6XhEDpr7V60Iid8w3PhhR3YVxSkkY62V4M d6HSCyxWli7IdHGOfe4OtW9gFVyBOVQuHjQ1KuMQu6Qqu+xFtTmyGz/ugMkvIF7bw0Je LnXWNebavYVt3a9isczZwYfFZoYko1QChHJ/68FxWARl4RwYIWemwiYRpkz/JdDDQyV1 oTxo7/5CIPOPWHxmKAk+yF3LrBhgDM3XkUmd4lCbvcBrSglbZ4MwOSDdAn6mdpqFJTOM OJBw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=dt8m3cDP; 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 l38-20020a635b66000000b004402f48dee0si1218606pgm.629.2022.11.17.08.04.40; Thu, 17 Nov 2022 08:04:52 -0800 (PST) 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=dt8m3cDP; 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 S239350AbiKQPrg (ORCPT + 93 others); Thu, 17 Nov 2022 10:47:36 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56446 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234614AbiKQPrc (ORCPT ); Thu, 17 Nov 2022 10:47:32 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C9B487616C for ; Thu, 17 Nov 2022 07:46:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1668699997; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=O5HKEB3fHlBEv/KV0IugSFogCrFrsWVhqrP69OBbPPg=; b=dt8m3cDPOPayIHJsUBKXa9tzf2ILYLTpqmmN39sEK7MSO+UViAZ5j7Y3iXCKFkHaHVVhvk P2kReNEpP5R5hjkdQhxcGicnlCy2wQqincKRlyXqlQRm+m+aGmxuEnFwoQT0il6zMmle9u 8qaAnl/K+5lRR5h4u6Woi85EIKR+v7Y= 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-621-1Rth89DTNc6P3eYwTF55Pg-1; Thu, 17 Nov 2022 10:46:30 -0500 X-MC-Unique: 1Rth89DTNc6P3eYwTF55Pg-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 5F1A4101A528; Thu, 17 Nov 2022 15:46:29 +0000 (UTC) Received: from rotkaeppchen (unknown [10.39.193.156]) by smtp.corp.redhat.com (Postfix) with ESMTP id 150ED40C83EB; Thu, 17 Nov 2022 15:46:26 +0000 (UTC) Date: Thu, 17 Nov 2022 16:46:12 +0100 From: Philipp Rudo To: Steven Rostedt Cc: "Joel Fernandes (Google)" , linux-kernel@vger.kernel.org, ribalda@google.com, zwisler@google.com, robdclark@gmail.com, Eric Biederman , kexec@lists.infradead.org Subject: Re: [PATCH RFC] kexec: Freeze processes before kexec Message-ID: <20221117164612.65832e37@rotkaeppchen> In-Reply-To: <20221116151610.7294a9e8@gandalf.local.home> References: <20221116195624.124092-1-joel@joelfernandes.org> <20221116151610.7294a9e8@gandalf.local.home> Organization: Red Hat inc. MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 3.1 on 10.11.54.1 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE 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 Hi Steve, On Wed, 16 Nov 2022 15:16:10 -0500 Steven Rostedt wrote: > On Wed, 16 Nov 2022 19:56:24 +0000 > "Joel Fernandes (Google)" wrote: > > > --- a/kernel/kexec_core.c > > +++ b/kernel/kexec_core.c > > @@ -1175,6 +1175,12 @@ int kernel_kexec(void) > > } else > > #endif > > { > > + error = freeze_processes(); > > + if (error) { > > + error = -EBUSY; > > + goto Unlock; > > + } > > If this is the path of a kernel panic, do we really want to check the > return error of freeze_processes()? We are panicing, there's not much more > we can do. kernel_kexec isn't called during panic. We don't need to worry about it here. Having that said I think this is a problem in the device driver _not_ in kexec. In my opinion it's the job of the driver to prevent such races during shutdown. Thanks Philipp