Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp199271pxb; Mon, 7 Feb 2022 09:14:51 -0800 (PST) X-Google-Smtp-Source: ABdhPJx1gL+f8UcaMQ8V9UtCj4pC3x950HNyEmqn3BMQtcd9imHqWc32MrnmVtvlVHu0m4H5cjjk X-Received: by 2002:a05:6a00:b96:: with SMTP id g22mr485721pfj.31.1644254091093; Mon, 07 Feb 2022 09:14:51 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1644254091; cv=pass; d=google.com; s=arc-20160816; b=okVsKHVfd/4HADWlAk3NkN81RMOBqPEACBki/u09MPqVmUEcJEJ4gmJg4c1viOTxWa WI/t7n5F1DFSjlIG7IBQH8YGQxz00797I3pj9QSWYacg7CuxXjgIFHXIAoCsu/DBZmDv Fa2rZi5kQKh+LJUotuR+u7jRJVFG6tEwJVUZLN5qRdI56HFZoerHyFz/q4eRaO59shAn 907zOgOLkFh2FDlclZdGEoUyuMviTme1H9kPtL01hNNLRx0h09Dt9CSxQZ8nOEHjCcML i2lMkKBKUzeswb4jNAGI57cj8bw3HcKRIljfezMwYCR+ib4PE6PPUHD+oINrXLcHlmK1 4X3A== ARC-Message-Signature: i=2; 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:from:dkim-signature:dkim-signature; bh=b3olD9kOrSRJJsPtwM75wHUKhaIFNPYxR5g9HsASZ/Q=; b=p3E22becVmRIL575j3ON8JwAexlhERIkgQdRiQ5D2p+cOpCUgTHNwV/dfI9B2WHmXj SbzP4OkXQXXtYnoV6bgMj47362hKKs5ksBK1h/qcQrhiwB4GVVJSnJeeh85kBuGUcOn9 iQNYymZV7t6IuRollRPMY8TsgZP1aLLzP4loEmKPrEzG5eC7oif6Br4jNTMwIBTwB+et REhr5h2Kr+KUuj1RfmKewxsq5tXLBcxWd3wWqQPZtX6ciEyL6mRQyPhYvcbhHRyRo71A c/yQQRt1WXWT+s2K9Q/4C8KlzgHnfktiwcFSFbBO9+rVTvb+Knc2kleSyqLF2e4wOMu7 eR5w== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2021-07-09 header.b=nla9cSSi; dkim=pass header.i=@oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=Yw37rR1+; arc=pass (i=1); 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=oracle.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ng5si1337760pjb.128.2022.02.07.09.14.37; Mon, 07 Feb 2022 09:14:51 -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=@oracle.com header.s=corp-2021-07-09 header.b=nla9cSSi; dkim=pass header.i=@oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=Yw37rR1+; arc=pass (i=1); 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=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243675AbiBBBjp (ORCPT + 99 others); Tue, 1 Feb 2022 20:39:45 -0500 Received: from mx0b-00069f02.pphosted.com ([205.220.177.32]:1840 "EHLO mx0b-00069f02.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243588AbiBBBjo (ORCPT ); Tue, 1 Feb 2022 20:39:44 -0500 Received: from pps.filterd (m0246631.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 2120L0vg026575; Wed, 2 Feb 2022 01:39:21 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : in-reply-to : references : date : message-id : content-type : mime-version; s=corp-2021-07-09; bh=b3olD9kOrSRJJsPtwM75wHUKhaIFNPYxR5g9HsASZ/Q=; b=nla9cSSi57XVikPc6fpTeNUOtf6+USPiMnjbbgeqhAfs1JUEvILAOByatW9Gl1C2b9zx lqFeckS+BF9vHQ9zmhSQlX7Z6JaJSo3Amks9byGEO5HSwrob6Lp7HmVaYDvOIV1xEFck rHPgNlH2uu3PDmctpaNYpHHvbHMB3T3gq4AfJuiQpLqpWmG/7Y1+O7K64vie0P6bzp/h kJ4/dXyK9d166DjB4X8X+nHjBDnSfPvh0DDDbT4LD2DFk/m96fnDXbk5mkHZouN5I005 r+bB4ZX8MwlIjvoy/EUecIv2UFNfXCf0M+hjDhvlBX8rc9JjonccIhyiBge2VNI24Thx mQ== Received: from userp3020.oracle.com (userp3020.oracle.com [156.151.31.79]) by mx0b-00069f02.pphosted.com with ESMTP id 3dxj9vcqe9-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 02 Feb 2022 01:39:21 +0000 Received: from pps.filterd (userp3020.oracle.com [127.0.0.1]) by userp3020.oracle.com (8.16.1.2/8.16.1.2) with SMTP id 2121VbSw024121; Wed, 2 Feb 2022 01:39:20 GMT Received: from nam11-co1-obe.outbound.protection.outlook.com (mail-co1nam11lp2176.outbound.protection.outlook.com [104.47.56.176]) by userp3020.oracle.com with ESMTP id 3dvy1r61vq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 02 Feb 2022 01:39:20 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NGorMR/7iDdl1pT5u/z6g/MMO/x5B1uyxpRHzAbCajutlyo5wuTOGrOzgdBK0f14xETaRJFWziir1PuXcGZI8PZN9Tx7lkDkksr5kJE556F84y25/n4y6Cb0G6pP7KsW5+utpHoj/6DMtkXsZSgepvTRkf/HYu+vQI9BsG5Xn4MKvz5g+LhupkMZI/2JXuMyz9KhtdKhjJmSVNZ7FyyGWKiSW6xyCnwKA0mbMaqmZJ681aBJTfjbVse0VGZDhlsm4zgf+FHzDU5l2aghqDetVpzufY/V8eork7slkIXX7ZbOZ5J2wuIIx4wYGLmZBSRl+Fgny16lHwDsqAGAqAwp2w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=b3olD9kOrSRJJsPtwM75wHUKhaIFNPYxR5g9HsASZ/Q=; b=jm3QcMEuFK0cQ2cFeT+yr1fjWVSoKzYmzV8k3DNQlIHb4bUol5oLbKktwInw1dJTh+9FK2sA2jUo85O1fVY8TuYYC7I9/bXOl55HWSONSaYUaj9DDMBD4icbdp0n6W49SuhyEnrblL19OxhCjdTetOPzIzDNtW9icckQmuNeGOYLmGel8aWqFSq6jEprgdOs23ZS38Xr1RpCeLBcvqLDunuwiXb/oqJtGGeCgJYvaOz619XO7Cv83DR+OpXyt680KP1VACtLwkxrMfe+cQJrBugauobxX1OQfXiH4pw5OaISbADxegJH6xyd28eF4gnTNsCoTM9HC2y0icDm6bG+Ng== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=b3olD9kOrSRJJsPtwM75wHUKhaIFNPYxR5g9HsASZ/Q=; b=Yw37rR1+qw4aX1OrNW8YIyH4sheyRhCUKYQdleWSeVTyzG2VioAkbOMEMJHx6ulLaEi/iosYe85IzstFykob4G0JSHHQfjr4Hfs37N1ZjGPAMKEUf0sSGdQ9PAQ8HiiyCo65xxGGMBmLK7OCELGA4ObqRmvmOXbn3E830sXsNWo= Received: from CH2PR10MB4166.namprd10.prod.outlook.com (2603:10b6:610:78::20) by CH0PR10MB5355.namprd10.prod.outlook.com (2603:10b6:610:c8::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4930.20; Wed, 2 Feb 2022 01:39:18 +0000 Received: from CH2PR10MB4166.namprd10.prod.outlook.com ([fe80::f4d7:8817:4bf5:8f2a]) by CH2PR10MB4166.namprd10.prod.outlook.com ([fe80::f4d7:8817:4bf5:8f2a%4]) with mapi id 15.20.4951.012; Wed, 2 Feb 2022 01:39:18 +0000 From: Stephen Brennan To: Sergey Senozhatsky , Petr Mladek Cc: Steven Rostedt , linux-kernel@vger.kernel.org, John Ogness Subject: Re: [PATCH v3 1/4] printk: Add panic_in_progress helper In-Reply-To: <20220201185802.98345-2-stephen.s.brennan@oracle.com> References: <20220201185802.98345-1-stephen.s.brennan@oracle.com> <20220201185802.98345-2-stephen.s.brennan@oracle.com> Date: Tue, 01 Feb 2022 17:39:15 -0800 Message-ID: <87y22udp30.fsf@stepbren-lnx.us.oracle.com> Content-Type: text/plain X-ClientProxiedBy: SN7PR18CA0009.namprd18.prod.outlook.com (2603:10b6:806:f3::17) To CH2PR10MB4166.namprd10.prod.outlook.com (2603:10b6:610:78::20) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: b2970e6f-aa2a-4b25-6739-08d9e5ecd3dc X-MS-TrafficTypeDiagnostic: CH0PR10MB5355:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:2958; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: NNZnuMsm1czDczDk1yvLT97/EzYJ0hDPDFgYWmfF6L+tM/tICkiMfXLBod4fmbuw41VW6HO7OCbdwgEL8MV4GLtKSkMUED3CtNuD6ckogr1BqfJlfQKqmZcWFLIVXfVk32UYs/KJi1/5nKyhnLmWa6bYWxubThFKQEzbzcQ0uQmRxzTu7PlZWA95+Bg0rciPP6hrHIZO68tPzUXShkJMndbDEe8VkuB7uqL/uCzCOiHV3GiO7rJeGhgZkDiObPMswisHpbz204elF3veaveo+g7Gai0C+ArQzpQk9u7RPO+j1uxIqkzaAvubA5fJPo0Teiw3Ma310zQK/2xDrVD2YJaUFSwrN+/EcVRmLO8Bu2ei5R3dkzOZ2j9DM+LjF/wfX6xS9OkJkpMAotxFltRjottHuf4NssSrnxdlBDmELFDLYX81de7ccyN0fQDzLgJgSlyfJjZhvwF8XcECyTVckH4RtqVka3W36JRa3dzwutxiPsC8Mw89XB3VMreRdO9GhO0QuZZNZjJRYmJIW16cLyf7LaPYgPFtJZe+tyksgkwsQ0NBAex9tlbuxTcgAZKRrAloeRQzlYa/Nfpt4oE9uhE5/fpfLeFCfbKXdFRcAsJqB2ldgyzFyOAqiozN0PGnq6kaahxep5XkZnnEIIzrGYhkzV8ZHAVT8oJyJ3hqziqefi8nDDWI9UjI8u6WXVw6LxVarnjIg132ijUtZ2/j5w== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CH2PR10MB4166.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230001)(366004)(4326008)(86362001)(38100700002)(6486002)(52116002)(54906003)(38350700002)(316002)(508600001)(110136005)(66556008)(5660300002)(66946007)(6506007)(8676002)(6512007)(8936002)(6666004)(66476007)(2906002)(83380400001)(186003)(26005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?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id: b2970e6f-aa2a-4b25-6739-08d9e5ecd3dc X-MS-Exchange-CrossTenant-AuthSource: CH2PR10MB4166.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Feb 2022 01:39:18.2083 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: e8KVT/VuDlL1MNX5PodgzvRI2bF8A0+8QETePkdDnxh3VJUnI2xBR0uT95rMcZ3C1WStiykXnyMGD7A24d8Irh0Fi8/400tPWcR1l0OhtcY= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH0PR10MB5355 X-Proofpoint-Virus-Version: vendor=nai engine=6300 definitions=10245 signatures=673430 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 mlxscore=0 spamscore=0 bulkscore=0 adultscore=0 mlxlogscore=999 phishscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2201110000 definitions=main-2202020004 X-Proofpoint-ORIG-GUID: 7dVZxb7GLFFPZUuZprFWi_FLW7qe5RGw X-Proofpoint-GUID: 7dVZxb7GLFFPZUuZprFWi_FLW7qe5RGw Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Stephen Brennan writes: > This will be used help avoid deadlocks during panics. Although it would > be better to include this in linux/panic.h, it would require that header > to include linux/atomic.h as well. On some architectures, this results > in a circular dependency. So instead add the helper directly to > printk.c. > > Suggested-by: Petr Mladek > Signed-off-by: Stephen Brennan > Reviewed-by: Petr Mladek > --- > > Notes: > v3: Move the helper into printk.c due to circular include > v2: Switch from macro to static inline function > > kernel/printk/printk.c | 5 +++++ > 1 file changed, 5 insertions(+) > > diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c > index 57b132b658e1..b33c2861a8fc 100644 > --- a/kernel/printk/printk.c > +++ b/kernel/printk/printk.c > @@ -1762,6 +1762,11 @@ static DEFINE_RAW_SPINLOCK(console_owner_lock); > static struct task_struct *console_owner; > static bool console_waiter; > > +static bool panic_in_progress(void) > +{ > + return unlikely(atomic_read(&panic_cpu) != PANIC_CPU_INVALID); > +} > + Unfortunately this is defined within a (very large) #ifdef CONFIG_PRINTK section. Thanks to the kbuild bot which will have earned the reported-by tag on this patch :D v4 will be tomorrow. Sorry for the noise everyone! > /** > * console_lock_spinning_enable - mark beginning of code where another > * thread might safely busy wait > -- > 2.30.2