Received: by 2002:a05:7412:37c9:b0:e2:908c:2ebd with SMTP id jz9csp1400362rdb; Wed, 20 Sep 2023 08:09:24 -0700 (PDT) X-Google-Smtp-Source: AGHT+IETs++mUDkTcdJKlmZazt+yqmvCdzMjERW1m7hDa43vSHchsAkXvhJ8sRpWuXdo71MSfSrJ X-Received: by 2002:a05:6a00:2d84:b0:68b:e29c:b69 with SMTP id fb4-20020a056a002d8400b0068be29c0b69mr3836846pfb.9.1695222564074; Wed, 20 Sep 2023 08:09:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695222564; cv=none; d=google.com; s=arc-20160816; b=cwRrdc786C83HlZJw0Ve9Ac/fSv7isjDgv4Uzeh5OkJ1O1W73jZ/hf+e2aBbQWvOES GlUshNsaTLKWEayFtAVJNLXVPO+Ly5tFSaZW+0+B1W8EUzHIvlZw+BYG/MObNDK1IwqB GDfseG33WY5WqrRhABZD/tbZiPQ8INFt55rk0rJIQzHPJMZH2gmhm75NpHPgA6T4iUKM kZx9Oq0pmFMBJA3Yq0BO82hcq2at/y3XL2NRjBOKBCDAQYFxRcgbGNKOQxEtgans/UT3 1bqSnA9u1M243Ay+FMRPGoZqo1YPBtFj96olAaall4G8e2I1T1bBIh+74CdOPfqepsp2 DDrg== 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=ZNNjjHKGzFsgYCWcXiYg2UfEdGAFaY3R4tUcgu0Pvqg=; fh=TzkyIES4otWN3W4dWMyTdB7pderI3qV989jbMUyRIRc=; b=o52Qj1S+8js6gc9kTFpMhyImq1jEMeaC0J+l51vRE6/5ID/aBCQg/KTogHMhBA+FM1 /SCG5Daht3ACPh7owPcNOIR4zzPLUe9WApg5T9F+n6t2isA+UZoGNN67F3g6otf/2q2g iFpRN9ZHIuDNGx9JKeRqTaPIZHGmyo3YpIX7k7/id5rq4YVUVcCYCEbmIRHymkGhRNZ4 hWZlgPaWT253L+l/yAnzHGmt5ohqmW8+YT4ZBKT6TZ9i4AAHjI+mRRoeVr/LZhJf7mUW vBtWEPmJ1PH1HOa/ciWnuxkYhrFVJfN+SXCp9kHbXtKREGf6OQ9phP4Jkhf4+hSIM2rP O0RQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=rcPPjo1n; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Return-Path: Received: from pete.vger.email (pete.vger.email. [23.128.96.36]) by mx.google.com with ESMTPS id l71-20020a63884a000000b00578a7f53bacsi3875576pgd.777.2023.09.20.08.09.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Sep 2023 08:09:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) client-ip=23.128.96.36; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=rcPPjo1n; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id 8DA928022C2C; Wed, 20 Sep 2023 06:09:32 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235969AbjITNJX (ORCPT + 99 others); Wed, 20 Sep 2023 09:09:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57248 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235907AbjITNJT (ORCPT ); Wed, 20 Sep 2023 09:09:19 -0400 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 204D21B7 for ; Wed, 20 Sep 2023 06:08:52 -0700 (PDT) Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out1.suse.de (Postfix) with ESMTP id BDD6521C00; Wed, 20 Sep 2023 13:08:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1695215330; h=from:from:reply-to: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=ZNNjjHKGzFsgYCWcXiYg2UfEdGAFaY3R4tUcgu0Pvqg=; b=rcPPjo1nGFadAtj91wS80q0UFFan7yt5cTgnwBUfH0zRJ+ootYduHvpC2hHedVk5m+D/qi MmYhkHZCVNIPpCy1bSqEZvE2Y1USyeOgWJbmDCd4jOuv0Mv9Hn++Vzg5GiNIg1p3h4MSST CaQB+ZxbESlHW+b+JO8G0RNOkQX7FMI= Received: from suse.cz (pmladek.tcp.ovpn2.prg.suse.de [10.100.208.146]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by relay2.suse.de (Postfix) with ESMTPS id 801462C143; Wed, 20 Sep 2023 13:08:50 +0000 (UTC) Date: Wed, 20 Sep 2023 15:08:50 +0200 From: Petr Mladek To: John Ogness Cc: Sergey Senozhatsky , Steven Rostedt , Thomas Gleixner , Greg Kroah-Hartman , linux-kernel@vger.kernel.org Subject: Re: [PATCH] printk/nbcon: Add assert that CPU migration is disabled when calling nbcon_context_try_acquire() Message-ID: References: <20230920125136.15504-1-pmladek@suse.com> <874jjpt2xz.fsf@jogness.linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <874jjpt2xz.fsf@jogness.linutronix.de> X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,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 pete.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 (pete.vger.email [0.0.0.0]); Wed, 20 Sep 2023 06:09:33 -0700 (PDT) On Wed 2023-09-20 15:06:08, John Ogness wrote: > 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? Ah, I have missed it. Please, forgot this patch. Best Regards, Petr