Received: by 2002:a05:7208:9594:b0:7e:5202:c8b4 with SMTP id gs20csp2050967rbb; Tue, 27 Feb 2024 09:07:20 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUKWHmBOrPYAeWyiEno5+IO16fcrqxtmT0c12LP4VMBJCoZ0ZxUADaIFwBgmIaGDDJO7waUv3S5QP+ssNpuCSHPaCjB2ZAWYm9X4sxAtg== X-Google-Smtp-Source: AGHT+IFW2sHMDyii7zBZQfcvhRzlA3i0bBsJ5vgKU4HnhVoBtfPCTdWi548fUJRU73wZ5ZbYDncA X-Received: by 2002:a05:6a20:e68b:b0:1a0:e639:7adc with SMTP id mz11-20020a056a20e68b00b001a0e6397adcmr2803258pzb.16.1709053639766; Tue, 27 Feb 2024 09:07:19 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709053639; cv=pass; d=google.com; s=arc-20160816; b=k26CMVea0WL3bHWg2UfjzRviBxK9i0apGBwPd0xs5Ps7nJvEMtUsalwK9GahBkwxDu f+UT5Z1fPDRsY69YWv0erPYydj5Pbir1U0RkH4q/4TU+jyNv2aiUPb7YACfDBRBmB/37 kt5agL1XuAX3UgapdT84wvcVxUs6f8gdQk/l1YSGmosn/z6Qg1N2V3Kjj2AZe9m7gFUP 9jIIgNdkej3IAD41/+bZfPOpkkYyIkZbWm+/rGQMFLGh8jOcohUemKNvQUX3YGBfj5dO ud+qw2+IPeJkxyrhgwxE1XycEWKu6FgRB6AcawuK8b6KBES/6raOHps34dUEriBKy5/9 iexw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=/MGuTE0DU8CyyPYXulKWAoGMCEKdrgcReMxRuOBYI80=; fh=LjVi734VKTr/n/Ixf6FmjQD3h1llszLBsOxS1D8DbcI=; b=YDGAEH4AcxKglnBXqf8Ouad8mBN+RDTVw4tYq4wCtHCjZ+B6uv/IjsGm99NoFw7sQW aqY3LoP0K7RguRi9OOx9hpYOjeBl4FRDBKEDf4qe9ppvY2GF7eg9B1LppV8veXDG6j9k ONbckEMhoq+KUHYVi1d2YayMsrknX04xbOZLaSu39Vhg/y2j8yXGNWNiCKGo33u15/nQ NINQuXy7UaEtPD9PBW+Py8ZjWaTRcmnhp1BHEFt2KmKcdi9QEuoPI5fLV9R0R8VWNYyB o0YHiAiReaGuZrMl6lUeQwnpjRpls7PBpvbIGCBLmROoIrF7fJNwO5jV2aVDuaxJE9Ch I43A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b="NvcFz/+s"; arc=pass (i=1 spf=pass spfdomain=quicinc.com dkim=pass dkdomain=quicinc.com dmarc=pass fromdomain=quicinc.com); spf=pass (google.com: domain of linux-kernel+bounces-83618-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-83618-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id c11-20020a63d50b000000b005dc42a836a3si5720687pgg.625.2024.02.27.09.07.19 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Feb 2024 09:07:19 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-83618-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b="NvcFz/+s"; arc=pass (i=1 spf=pass spfdomain=quicinc.com dkim=pass dkdomain=quicinc.com dmarc=pass fromdomain=quicinc.com); spf=pass (google.com: domain of linux-kernel+bounces-83618-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-83618-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com 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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 36238B32191 for ; Tue, 27 Feb 2024 16:38:14 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id AF0D1208B6; Tue, 27 Feb 2024 16:38:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="NvcFz/+s" Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) (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 5990C208AD for ; Tue, 27 Feb 2024 16:38:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.180.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709051882; cv=none; b=m+aS9Im+R1kxg/lWxUEWmdI/gOZp7yH70/27BW/z3XpIDoyfs4aJ2Vv9yoGRctimhN52v5b80HzSBmgfsEkJemRugkYXGDllb1C948FuPRqU0K9FYXmfryOYVA2hz7vp7vfiGhHz0nV39tvRwlG33i2V4GIN3L+itcNKAbYW9f8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709051882; c=relaxed/simple; bh=OHiW7rbcuYzcClUQc9OK8mKAChRHcUsMHQFdnb5Tz8g=; h=Message-ID:Date:MIME-Version:Subject:To:CC:References:From: In-Reply-To:Content-Type; b=a7gMeV/dv3vqexRZpH/MDAwl8J5PUWHp1fygiZv7o8fcrmNdM88BqJmTi3vq5z81ls7CYBnELdbg1r+48ppGYNwXaAVjoWwFoe/qdRHa5C8AjGa78tLihQ1ThUAKFjHc2vHMAYCiOkQ7nA264vIDPetpQIwjBYRZVUqBQOcAUH8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com; spf=pass smtp.mailfrom=quicinc.com; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b=NvcFz/+s; arc=none smtp.client-ip=205.220.180.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=quicinc.com Received: from pps.filterd (m0279873.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 41RC8LGQ003566; Tue, 27 Feb 2024 16:37:38 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= message-id:date:mime-version:subject:to:cc:references:from :in-reply-to:content-type:content-transfer-encoding; s= qcppdkim1; bh=/MGuTE0DU8CyyPYXulKWAoGMCEKdrgcReMxRuOBYI80=; b=Nv cFz/+sa3SZq+3WwkOWZNT6V2czM7PqeeXgumZePSPZEr7g87C3gsiEYvf4ykUUNR vVBoOFC1PO7stNLhq5A2f1E7PRndI0eNDqlvzahIl1+VVOh6A9jXZIGTfasxrpIZ W0m52NlvE0MjSO66HzE8h0rqR1c8/XD9echohlcomZCNduNjWqLZR2A8TFSGa6Nl xCuL5+ojUpUc104e/obC7x14929/pVT4Wac60dngnDUHguUqfYhcikSZwbWXJ7Uw apEo/KrMS8wBBsGCus+2MXLt7CWD9hi/8hRzBH+vnh1jj/GTOTf6m5rbkSWmh2Js z9HWnUIuA8EbGl7K8s5w== Received: from nasanppmta03.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3wh64qhx5j-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 27 Feb 2024 16:37:38 +0000 (GMT) Received: from nasanex01c.na.qualcomm.com (nasanex01c.na.qualcomm.com [10.45.79.139]) by NASANPPMTA03.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 41RGbEIM029254 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 27 Feb 2024 16:37:14 GMT Received: from [10.216.25.104] (10.80.80.8) by nasanex01c.na.qualcomm.com (10.45.79.139) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.40; Tue, 27 Feb 2024 08:37:11 -0800 Message-ID: <2408885e-517d-dc98-e05a-b79de0c66c38@quicinc.com> Date: Tue, 27 Feb 2024 22:07:08 +0530 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: [PATCH] printk: Update @console_may_schedule in console_trylock_spinning() Content-Language: en-US To: John Ogness , , , CC: 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> <8734tfml8v.fsf@jogness.linutronix.de> From: Mukesh Ojha In-Reply-To: <8734tfml8v.fsf@jogness.linutronix.de> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To nasanex01c.na.qualcomm.com (10.45.79.139) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-ORIG-GUID: LzOFRhNtxSBz9dOAtFyBnNLecZMYscoO X-Proofpoint-GUID: LzOFRhNtxSBz9dOAtFyBnNLecZMYscoO X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-02-27_03,2024-02-27_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxscore=0 spamscore=0 priorityscore=1501 suspectscore=0 mlxlogscore=990 clxscore=1015 impostorscore=0 lowpriorityscore=0 phishscore=0 malwarescore=0 bulkscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2402120000 definitions=main-2402270128 On 2/26/2024 6:32 PM, John Ogness wrote: > 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). I overlooked it, thanks. Patch LGTM. Reviewed-by: Mukesh Ojha -Mukesh > > John