Received: by 2002:a05:7208:9594:b0:7e:5202:c8b4 with SMTP id gs20csp1288507rbb; Mon, 26 Feb 2024 05:03:50 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUoEK3V3G2OXQJgN02drEMv1I/H1nj74B8Zryx5PICpQThJhe2DYt+dnqmN0KVfQtod3e01jY5LcxcfrE6hBdW8lsCkXJs6CpqPKjTbbA== X-Google-Smtp-Source: AGHT+IGFRJDrrrjLFSY8ctJzHzBhzVxNqoj7PG+QJuSrl+uM+Na8f4lv70MR0vMiu/PirWI/AWM8 X-Received: by 2002:a81:4314:0:b0:608:d599:e078 with SMTP id q20-20020a814314000000b00608d599e078mr4838262ywa.24.1708952630307; Mon, 26 Feb 2024 05:03:50 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708952630; cv=pass; d=google.com; s=arc-20160816; b=XaL7+XDyoOko5POHuDjAGfFcYXgQZbZ4L2awSLL4PrKkjS9ShiXIErXD8WU6TGM/tu 8KlZ91/1pjD7GwqxtfBFX25Ug5UUOFLSslVFJXkE1rPwigyEY9dZp4i1TmX8G+YMRmK6 kzeutGL+/xBt5qvbO0rCt/7j0EGtDFmbzLpOR0oCE7VxApHayF4hZj1O8viHhipCzWv2 AhnQ4RMSo41WNxA0ivN3wJ9B+Rk+DydwKlUuf+CwKJle+c+G5Q0M3hf+Jaqx5Kn5+xMN ySEU+0TBg+zk+nOoDCCvpCp0FcZuq6rxq2aus55UoQFpJbZxi8WfovyGO6Gx5/RtBDst ICKA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :message-id:date:references:in-reply-to:subject:cc:to:dkim-signature :dkim-signature:from; bh=AvZgz/eqbdExfSVQsfAaABe1V1JJXqW2EkI3XcjeC/A=; fh=zQtNUD4bVhfr04umHcX+NdGHfLH6aI7S0/IDFRulQTU=; b=WSLe+HTg4wA0ulrL17GWZZo5pd2gSgBiiS6TUxbYT6WNtYEN+JopOnOP3oxPEVzt/E ErllW8TEKwbO4Mj/udb39iVAvLaNwwJOD+MVvVQP03Y+uHLevS03qOOaT5eSDmYBCmrQ qS5M+cTtXHpny5huDtL7q+8wm4qxwZ0wtohv6QOYD9ZP8LaNjXEn50GJpGiEPWaL/yBR YR4lFUl0YTNSA5WMMQMgYtolG088EedhWOZrCNgGCVLgWVs18NGsM4q19LwpmlzRonK3 akA6hgzSrb/iLZzdHg+m9Q3U/gJlr1aGcURM3p0TUvkAMLtkLM4QtGY77WXJ6uxXIQuq qh1Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=QVfrsWSK; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=r3mFp5V+; arc=pass (i=1 spf=pass spfdomain=linutronix.de dkim=pass dkdomain=linutronix.de dmarc=pass fromdomain=linutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-81436-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-81436-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id x203-20020a817cd4000000b0060493580174si1483911ywc.543.2024.02.26.05.03.50 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Feb 2024 05:03:50 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-81436-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=QVfrsWSK; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=r3mFp5V+; arc=pass (i=1 spf=pass spfdomain=linutronix.de dkim=pass dkdomain=linutronix.de dmarc=pass fromdomain=linutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-81436-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-81436-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id DF3231C26472 for ; Mon, 26 Feb 2024 13:03:20 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4F0BA8002F; Mon, 26 Feb 2024 13:03:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="QVfrsWSK"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="r3mFp5V+" Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1774A5A7B9 for ; Mon, 26 Feb 2024 13:03:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708952595; cv=none; b=b3TlbAaS8SPPo3Kmj160C+FpMYQ5Rn/wUt9y2TdNsZPYaAEIwBVqXf20692gt1pyyeQl4vqkSyg44dcn0bJ0rPMcFWKWtWdn7H99Z/i8RUM3F7j03MrnbheV++4hjfa1Vif9zx7BMv8+KENdaaqjxNq2r6S4UuM3zaKFUNdsc1M= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708952595; c=relaxed/simple; bh=HIrEsdXsBYKVzEMqvaaTbk4nndRfnsAXSaCAYIPAUS0=; h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=ADF2TTJQ0YL1kPZhv/ASXdsU+fVT5DVXEieaR/60d7bs8s3FKVcFu9xq5dJzwkCC/3CQBY8oq2dQKSYrXcTfkHKszeN9yVcGYFXY0gAmmMZ94J8vXNYUginI7V+ndeJj0PNSugAIwDU7jaVLsjeHUXsZETGnZH5xhAWoYTI4PtA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=QVfrsWSK; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=r3mFp5V+; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de From: John Ogness DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1708952589; 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=AvZgz/eqbdExfSVQsfAaABe1V1JJXqW2EkI3XcjeC/A=; b=QVfrsWSKBgu5rrxR6F4rTjRqBVgVX74fqKQb2ESyjQWwUC+aF3216s6wRtmvMRAYEK/YZP lSLCWb/UD4vWkuOPinSV2bFZeb17GIOoQk8A1+dwtb0G/hZ+fZg6Dd+euz1qLqzKBAyUwR 4JfakK+3lU5gmKjDD4I0or+CCvayQ9pt+MqRN/1SYuz35l2vS6ih4uFdTBjWXCd9v5tC+k tBIKoQNgyMa+xppCKAravED38SfEdWcXVBc0jcsnkusUfH7b3RLDTJOevN+fphS2Dgxk11 VpAVqZKaPc9kgTF5LzS8a5qpN8xbGnr1dJZ0igR7/XGzmIltPY9xwRaV+1YNzA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1708952589; 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=AvZgz/eqbdExfSVQsfAaABe1V1JJXqW2EkI3XcjeC/A=; b=r3mFp5V+dd3HkC0KI4iPhPFpaLhky4EZlD/nCh0tipqqC1woRHEH8oWe322Zk4Z3WfEQk5 4vaAoSK1RELZI+BA== To: Mukesh Ojha , pmladek@suse.com, rostedt@goodmis.org, senozhatsky@chromium.org Cc: linux-kernel@vger.kernel.org Subject: Re: [PATCH] printk: Update @console_may_schedule in console_trylock_spinning() In-Reply-To: <44648e78-d117-2f6a-8ecd-f0a29327fa4f@quicinc.com> References: <20240222090538.23017-1-quic_mojha@quicinc.com> <87plwo5z4k.fsf@jogness.linutronix.de> <875xybmo2z.fsf@jogness.linutronix.de> <44648e78-d117-2f6a-8ecd-f0a29327fa4f@quicinc.com> Date: Mon, 26 Feb 2024 14:08:40 +0106 Message-ID: <8734tfml8v.fsf@jogness.linutronix.de> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain On 2024-02-26, Mukesh Ojha wrote: > what if console_trylock_spinning() gets the lock which makes > console_may_schedule =1 and it is still schedulable ? I am afraid I do not understand the question. console_trylock_spinning() is only called from the printk caller context. In this context, console_may_schedule is always set to 0. Only if another context acquires the console lock per sleeping wait, console_lock(), can console_may_schedule be set to 1. Note that the value of console_may_schedule is only relevant for the console lock owner when console_unlock() is called. That is why its value is set when locking the console (or, with this patch, when transferring console lock ownerhip). John