Received: by 2002:a05:7412:37c9:b0:e2:908c:2ebd with SMTP id jz9csp1340429rdb; Wed, 20 Sep 2023 06:42:14 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHFNUDhU6oSueKDsIqw7vjumnUNoVpYUZzu6I5CCaIdbeWfv9Hmaow8uJqv6WKAnGi/gpdc X-Received: by 2002:a05:6a00:bc3:b0:68f:c1e0:a2c4 with SMTP id x3-20020a056a000bc300b0068fc1e0a2c4mr6769464pfu.3.1695217333839; Wed, 20 Sep 2023 06:42:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695217333; cv=none; d=google.com; s=arc-20160816; b=RrSfclsk+juEVRCBmLmU688WogP/KMpAXv2qw3bkC4rdCwv17KfRzHzoorZSXDFqpr LYKRVQgZAdkJgB+f35TDOVBrCEL3xMk6mYcxiU4ROVjfyk1o9ENSnOukMO+7j/sqgrWd r51jltzKrsqAK9fxQz+dsgOzLhldJGAqgv46j7VDCOlIKYZShPKUCXAmJmu7zbbbts/p RC+Mirjsy500qX8iZ/7cSNUv1Fs6ZX8t9mMfp+luKni4xenPWsD/4jlnJg3X/y2v2mj0 vdndDeuoP9Mpo0CKhGw4Exj6mm8ZU5o7Uleb0/tVyGreTGKxs3aM1G/onVFDTYjz7VPs 3v5Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:references :in-reply-to:subject:cc:to:dkim-signature:dkim-signature:from; bh=b+lwndKdQlP/9nZEQAFcW14cpo1FpcaI6fxfaleP4oA=; fh=toANsy8BUbg7N1yOWu5JdUeAuNefhsYqkFkh1jGFufw=; b=qi1T7fScQ0gSr4/CqYT0y59koQUTNXJvmyjeNNwHrU+IRYzLswT0M0fyMYZYLuIgpD WJFd4Z5igzh1vEQGMZ/oEDdHOUb8R11CG8mai9hUxcRP75tI2gNKt+Dm+t5IUkh/EstP s+hsk3HM9wRDmmhg3LoGxi/K/C3R6xIq+A72JLxsMtg23mL5nEqd1T0UHTmyKAw0Rzcr JBmDXC18GvCL4nW2kjYC/dPmLn3NVxvxvz+2a+7Sd5qBSq6Bpa5RV9QXkCkqv5QMYwcq +UvT2kimdOXSMGxJZ52//Yq6t/Pwgr0+RkltDgpJM8WWAs35At+52Azo7cBHPp/F6LJu QFMg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=DDx3bnMd; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b="pSKL+CZ/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id eb8-20020a056a004c8800b0068fcccf5c87si12063100pfb.300.2023.09.20.06.42.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Sep 2023 06:42:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=DDx3bnMd; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b="pSKL+CZ/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 44A56804B29C; Wed, 20 Sep 2023 06:00:35 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236380AbjITNA3 (ORCPT + 99 others); Wed, 20 Sep 2023 09:00:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55280 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236339AbjITNAZ (ORCPT ); Wed, 20 Sep 2023 09:00:25 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CA40D93 for ; Wed, 20 Sep 2023 06:00:19 -0700 (PDT) From: John Ogness DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1695214818; 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=b+lwndKdQlP/9nZEQAFcW14cpo1FpcaI6fxfaleP4oA=; b=DDx3bnMdWWwpG85xcoDuibKSsbmtg8cu1d3hN5naZ//ntjz6h1Q4hBoY/m4UrhJHzW7oSd sLTWX5lIy+EBvtw487xsoKS8rvBXkP2V4r24h1FFs2++IsTmNBvyN29scZNac2nq7CdnQj du+8uB2QGlWcbbZ93+pv2/Ewm9WZn5re/qZsXiH4mQx+LbKCsLEsNziYKK1fO9uNog5Xja a9dq3VF1BaX+UWQymmu3RYubgR4caJuxXJ+Jy/OErpDCch8cTUkeqTaFld6PDFUMi5n3L0 nOtVxg0t9wKzjI32hJLGWbzGGi853HQFxP7GEp+nxy1Eqeig/NR5Wp5mr8hx9Q== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1695214818; 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=b+lwndKdQlP/9nZEQAFcW14cpo1FpcaI6fxfaleP4oA=; b=pSKL+CZ/M3RATCymopWoEDKt9qljPHgoljCszAEqb356czCG6wLngmoITLVGJXedJwcE4c vfvAlAHTj4Cf+ADw== To: Petr Mladek , Sergey Senozhatsky , Steven Rostedt Cc: Thomas Gleixner , Greg Kroah-Hartman , linux-kernel@vger.kernel.org, Petr Mladek Subject: Re: [PATCH] printk/nbcon: Add assert that CPU migration is disabled when calling nbcon_context_try_acquire() In-Reply-To: <20230920125136.15504-1-pmladek@suse.com> References: <20230920125136.15504-1-pmladek@suse.com> Date: Wed, 20 Sep 2023 15:06:08 +0206 Message-ID: <874jjpt2xz.fsf@jogness.linutronix.de> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INVALID_DATE_TZ_ABSURD, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Wed, 20 Sep 2023 06:00:36 -0700 (PDT) On 2023-09-20, Petr Mladek wrote: > The nbcon console is locked when the 'prio' and 'cpu' fields in > console->nbcon_state stay the same. The locking algorithm would > break when the locked context got migrated to another CPU. > > Add assert into nbcon_context_try_acquire(). It would warn when > the function is called in a context where the CPU migration > is possible. static bool nbcon_context_try_acquire(struct nbcon_context *ctxt) { unsigned int cpu = smp_processor_id(); Doesn't smp_processor_id() already provide the necessary checking and warning? John