From patchwork Thu Jun 29 19:21:10 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric DeVolder X-Patchwork-Id: 114423 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp9890786vqr; Thu, 29 Jun 2023 13:20:54 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ43N14h1yiy9NTPfMWWHyripzUPuu6QKDtK56ToMlseG/x8xlY5dAx3dK/IQuMp9jZtluFl X-Received: by 2002:a17:902:e5cd:b0:1b8:2c2a:9629 with SMTP id u13-20020a170902e5cd00b001b82c2a9629mr7035990plf.19.1688070054014; Thu, 29 Jun 2023 13:20:54 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1688070053; cv=pass; d=google.com; s=arc-20160816; b=Wt9q8uMNZwyj8bemqQbZ72ixLrlZFDw/LnLTt3Mj53tW3PgsSAZL7OaV0W5kPRhzNZ xPvH1BXbtccxVs/k+vuMYibt3dNasWsQZEk4Y3ctmE137liR7lvv6qJedD8QT2wavEUl zkJ3llxArUo8X0gmdiDER95l4baRh36EGEc6Aa95Brv4oWNwCOIhi/8Hsheo0vmSFYXt 6nZbmLw0iyrsk1Zqunna0OV/IxuDTx7z3KbSTxhLPyqjIL7SFSyx+gUl3NH1NOLa9Bo0 wTYDhF9L2jX0aKcllxVf+mf3+9FREiDU4kKT1RINjD5dSklT5/vYLS94fNHJIKAA5tIu R1dg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:dkim-signature; bh=urxPOYUpKOMkti7IfS40b4Ht/WYOtVRmEjh+rUcS9T4=; fh=j+K5GuuLTbxxisV+wJRNZBqbr6zhGMwAghI8ANXi4rw=; b=rcix5EcQ8Vd/PaGycG84e99uFBloH5j5D2k6fIgH6gmjReOth0OVBNfb3b03L0v2wW uNOddmLaqJkDpKTH+chAGjGv93LF5/IT3JqGVma9NiWl42h1hXQBBDIluB0Wq6VQy3Id PuC/HauFgCIS+CCBoW8E7QaAO8uxjjjTS2QlrJv5gfgTlz1TijqCiaIA4S7yuEFFSwNe 2ndHbqrjhwS2IM+TF030YyeUEwE0B/CpKn8LMGvCaNfpmlqoNqAd9V9zmEDZgr8KTPdH nZ/2YR82BiRZN8feKn79HYPhQXTyEVFU1Pvu6ZygbX4ujYP95josVUKUVzEdIcU64Vtd gpLQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2023-03-30 header.b=ZNMyRp9q; dkim=pass header.i=@oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=YDZDQMDR; arc=pass (i=1 spf=pass spfdomain=oracle.com dkim=pass dkdomain=oracle.com dmarc=pass fromdomain=oracle.com); 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k13-20020a170902ce0d00b001b23d4573b2si11781247plg.27.2023.06.29.13.20.31; Thu, 29 Jun 2023 13:20:53 -0700 (PDT) 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-2023-03-30 header.b=ZNMyRp9q; dkim=pass header.i=@oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=YDZDQMDR; arc=pass (i=1 spf=pass spfdomain=oracle.com dkim=pass dkdomain=oracle.com dmarc=pass fromdomain=oracle.com); 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 S231857AbjF2TXo (ORCPT + 99 others); Thu, 29 Jun 2023 15:23:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50406 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232101AbjF2TWs (ORCPT ); Thu, 29 Jun 2023 15:22:48 -0400 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 53AC21FE4; Thu, 29 Jun 2023 12:22:43 -0700 (PDT) Received: from pps.filterd (m0246631.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 35TJ3vBT020435; Thu, 29 Jun 2023 19:21:33 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2023-03-30; bh=urxPOYUpKOMkti7IfS40b4Ht/WYOtVRmEjh+rUcS9T4=; b=ZNMyRp9q/8gDTzO4v8/4vIvAZOWWZUMbFcALTzgfbxzRZ82SNxO50TYZFS8+89jEXIR9 QAkwPRMvU7ZeeWP8nrwMyCSLc304ksoS8eNAFuwX2yHS1GNZJ+/m9wwYPH8QgyawWT1p 1g046aJJi+tlxe+S+fzH3+pOQ4N5WdaKc1b0OAqIFjSLE/QNqqAYZuOjlA4jNCYNdoAM PAiPj9Nb8AYx5CxhbhX3+S8dOyUEy1vaWSTVUNDQRS2YCrmew4URMJRO5TxvWi8epFJR BaZgL2FKp/5BT/ydIlBs52PBqzgzoAP45Yt8fJuoTCJns9CGXz3u6GvP1U27r+g+BpY6 fA== Received: from iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta03.appoci.oracle.com [130.35.103.27]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3rdq93dp8v-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 29 Jun 2023 19:21:33 +0000 Received: from pps.filterd (iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 35TJEaIf038200; Thu, 29 Jun 2023 19:21:32 GMT Received: from nam10-dm6-obe.outbound.protection.outlook.com (mail-dm6nam10lp2102.outbound.protection.outlook.com [104.47.58.102]) by iadpaimrmta03.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3rdpxebtdr-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 29 Jun 2023 19:21:32 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RUwjT/zbZPCupgWcwRawcYhIY363hb7DhROYktrjeZ69gNlfbwYrDW5nxD6jLDOf/zL6LhJXJ2IqCGc9wkyixb1052LkO7WBhbHC/f7pt9N5rIkMPCLXMcLCqkF6l/ELcUCQ2bW4w2niLanMG6bzgrcefhVQD/GjJfbMHa8XI5tan8jOsl/KonKh26LE6ODL0/ezN56u2TfnlYzxAUHgWxSjMXiS+lwlWnd1EHQ5mYNkMBD4aN1bMvpMlHe8YiBE7AwTn4ttigkJd/uMOaLD0shUaHY+iASr9XBhUJZt/eOfpC4/+H4KY8CUVUE6jPfhHgRTC6cTYQ19LH8k8r/y6g== 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=urxPOYUpKOMkti7IfS40b4Ht/WYOtVRmEjh+rUcS9T4=; b=OYcHZK8/j6Wm1SX+Cc6AWUP5BoMw/P7TP9SIbbF2+pGOmcUHYUmNGuIVex7qab9RGok7a2UZI3fDEc1JQyPkwKPvacwl7G2P0tFMtpuwR4WF1gszlpvAXhS/y7FqbtUS6yMpJw/+VIcIpexH92qU4ovLB6/T5e+KVURi2WCUKUXWlymsi5EpJEAA9c9vNeJY6Dus88Yv1jDXZHQhpPPKGrdoxhYiOiT5kF/xIlpbqPGjBQ8vQ2vrl4uh246w1QeHmEErOyUDY+DwKsTQ90GiTP67cyYxlpLTeOvvJspdA4RuHGTqeU+5LovEEGxI82R6aGjdG5Pan5tzac5iAD+9lA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; 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=urxPOYUpKOMkti7IfS40b4Ht/WYOtVRmEjh+rUcS9T4=; b=YDZDQMDRsnZJFYm130OuXsX/f6DZ7FeKAE1TszUtLzgYmHVx0DrSNQByJE0Gb3VJPTjre70YdYlBuUCKiFyzdr9R4moAHKx7274/Va39lDvc5y8fq9XmpKJL8W43dlof7MGERYJ6WCFOAByxWkKsSc26aP8xcf4Wp1ufn0MVS6E= Received: from CO1PR10MB4531.namprd10.prod.outlook.com (2603:10b6:303:6c::22) by IA1PR10MB7200.namprd10.prod.outlook.com (2603:10b6:208:3f7::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6521.21; Thu, 29 Jun 2023 19:21:29 +0000 Received: from CO1PR10MB4531.namprd10.prod.outlook.com ([fe80::8b8f:b4b1:bb78:b048]) by CO1PR10MB4531.namprd10.prod.outlook.com ([fe80::8b8f:b4b1:bb78:b048%5]) with mapi id 15.20.6521.024; Thu, 29 Jun 2023 19:21:29 +0000 From: Eric DeVolder To: linux-kernel@vger.kernel.org, david@redhat.com, osalvador@suse.de, corbet@lwn.net, tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, dave.hansen@linux.intel.com, x86@kernel.org, bhe@redhat.com, ebiederm@xmission.com, kexec@lists.infradead.org Cc: hpa@zytor.com, gregkh@linuxfoundation.org, rafael@kernel.org, vgoyal@redhat.com, dyoung@redhat.com, lf32.dev@gmail.com, akpm@linux-foundation.org, naveen.n.rao@linux.vnet.ibm.com, zohar@linux.ibm.com, bhelgaas@google.com, vbabka@suse.cz, tiwai@suse.de, seanjc@google.com, linux@weissschuh.net, vschneid@redhat.com, linux-mm@kvack.org, linux-doc@vger.kernel.org, sourabhjain@linux.ibm.com, konrad.wilk@oracle.com, boris.ostrovsky@oracle.com, eric.devolder@oracle.com Subject: [PATCH v25 01/10] drivers/base: refactor cpu.c to use .is_visible() Date: Thu, 29 Jun 2023 15:21:10 -0400 Message-Id: <20230629192119.6613-2-eric.devolder@oracle.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20230629192119.6613-1-eric.devolder@oracle.com> References: <20230629192119.6613-1-eric.devolder@oracle.com> X-ClientProxiedBy: SJ0PR03CA0180.namprd03.prod.outlook.com (2603:10b6:a03:338::35) To CO1PR10MB4531.namprd10.prod.outlook.com (2603:10b6:303:6c::22) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO1PR10MB4531:EE_|IA1PR10MB7200:EE_ X-MS-Office365-Filtering-Correlation-Id: b9b946e2-4b0d-4c1c-8a9c-08db78d60a39 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: JkZGzm7x/AFc6nlOCJhwDWWtl9fLwGEHMBaFtZdxbt67T9Yz6I87PA677Q2jWdSw9k8qdqPpHn+2pPOf57CwiICpy+BHUVIPomaMSZAYmHnps9NDiobdqgkwtOdcJWZxlxExBNgKIF5KXCho8TeLFxPH+pLuD9N34BlcnS1x/I8kAB3hScnPaHQi64mwdkmqgggdQnrT/1C7E07dGRLYPik0rawBNx0jr4e+NJ7AsuB3Pv9MxGc9gJvZWPrFN+meXi81rSn1xu9fUPVHMMLnrSgBHo9W0TkWq3WphTRGuIbb9no8GEPKDAeB0oysISjfbYcz849eO9ykhO59SgLMikzhDbkc00iVSh3T1ye/rBsqYjijLyYrpx0j1CNkr11IOc0JLOq8xeI0K87TMQYcbBYRHZnz0cVVCVhd+vI5bvZPcjMrHSDptLC4OS/sM58Fjq0ICFT1dAaWBvDaADF8NRCDELEvbg9P1I2kFcoa3wBErhQwH6yZuoJa39Hzw01+rxdhl2/of8re6tnOkg7Zfgoo/OlrGXKWLcQ72RPyhmQUe5ZPZl8woFnY1yZOq956Z2XfjFyMIIK55E+r4Z3THQzhbpshhXauBjyxkNWfKZ7Hab8rmrrnmrUK1qXn8ImV X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CO1PR10MB4531.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(136003)(376002)(39860400002)(366004)(396003)(346002)(451199021)(83380400001)(316002)(6666004)(8676002)(4326008)(8936002)(6486002)(41300700001)(36756003)(86362001)(38100700002)(921005)(2616005)(7416002)(7406005)(66556008)(6512007)(5660300002)(66946007)(66476007)(478600001)(2906002)(186003)(26005)(1076003)(107886003)(6506007)(142923001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: IDm+CkZaKzbIqI/jIyDImGy1teqsUAfgzXlTQ0hCPQzUv9ZS7w07lOaOsdNxDbd0m50Wk36V+GJScdqXCY7MtXwb4raF0PDKgpVsEAY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mh5/ox5QBnAY/lI2UnrbrxuRAcHlHdZJE7RCGerw2yS3iZqoqt0Y/3ripFTRHly2LlJlVa4keGyPuQtx7JObGY/E9PxJZ076YvbVZ0+bbc6+o99qw4kyKYrqT5uLjw7/uk7WOQJgI1xpHfKjBG3OjUlFLXUChAXCYpOdVvinhB9zh8DZe8EdHwvs2ya3SJfMxJRe+hDOWRdvvv8FCLBqEN0mNFl1p9Vi1n6kJP/KBbBC+tfR2J8oh+6o4RX0RohOnfTw3VdJAWhDX3cmN/lST/EUxdmqMLvXeArHts6I7Y0e0bAg43atA2zOwORm7vb+RBDhS3KPpHLLXRnwhk8Pj1dJfdSZwFniQLiggR/RXZ7DYm/hLhO4TovF1CAyeFrAzsTyLkzi1QbVEt3e0uogI5uSib0bmieeXdB2FowNuVqFbKiwh8qHnru+C7ytmznmk4vZdQTBPPBfXep08QsE+xc9dtb1pf1XkNZVUogVrxEma6bOEykio6njxS2DuriWfKQmtAQEPAU0N6LLvjJWQTWd9kt+/tHKAz98+03PUcijohJFaMn6oSVdXlaI7tz0etEJ0gs6/ojfx19ot9Z4vUxmI4NvLuxLPmsQ3RWKHFH9ipjCukuXSUHnLbMuBXToisYy85Fpk4tUtmiPNdA3SF2aQjbbYYX6QqzhGe3EW2DSECvqDTLtccoirMOmDx/2KIZl32RBtW0vcY2CQ096Dwu8i635XueA6L7rPqQU0guWpkKzi/zwWpSXUib5IXC3cLDoox0KXGtGI2JfdatlP6GNudfZmGOiIfWzbrjxUHPZIK067K6C79vAKr6YD4T3raOthvhHciNHMz7zjrvNqU+sAM639qmkBgg9ToZv3jBjoZL9zpuCeQajpfSrXLqno3aXsuNXlOzdkxtvHo= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: b9b946e2-4b0d-4c1c-8a9c-08db78d60a39 X-MS-Exchange-CrossTenant-AuthSource: CO1PR10MB4531.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Jun 2023 19:21:29.3988 (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: lomf7q1lbeS+029FjTUf8qhPRfh9W+En2qmsby28qcVEtUWjTw/QHtz7cf+xnuISEj+2uGAK0iqo1OqWNY11SqyxWGl2ty6osSGqhKM6g1o= X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA1PR10MB7200 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.591,FMLib:17.11.176.26 definitions=2023-06-29_06,2023-06-27_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 spamscore=0 mlxlogscore=999 malwarescore=0 phishscore=0 bulkscore=0 suspectscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2305260000 definitions=main-2306290174 X-Proofpoint-ORIG-GUID: 61ICmdlgMU9EblougI-RUJy8afwawlQx X-Proofpoint-GUID: 61ICmdlgMU9EblougI-RUJy8afwawlQx X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1770069745073499114?= X-GMAIL-MSGID: =?utf-8?q?1770069745073499114?= Greg Kroah-Hartman requested that this file use the .is_visible() method instead of #ifdefs for the attributes in cpu.c. static struct attribute *cpu_root_attrs[] = { #ifdef CONFIG_ARCH_CPU_PROBE_RELEASE &dev_attr_probe.attr, &dev_attr_release.attr, #endif &cpu_attrs[0].attr.attr, &cpu_attrs[1].attr.attr, &cpu_attrs[2].attr.attr, &dev_attr_kernel_max.attr, &dev_attr_offline.attr, &dev_attr_isolated.attr, #ifdef CONFIG_NO_HZ_FULL &dev_attr_nohz_full.attr, #endif #ifdef CONFIG_GENERIC_CPU_AUTOPROBE &dev_attr_modalias.attr, #endif NULL }; To that end: - the .is_visible() method is implemented, and IS_ENABLED(), rather than #ifdef, is used to determine the visibility of the attribute. - the DEVICE_ATTR() attributes are moved outside of #ifdefs, so that those structs are always present for the cpu_root_attrs[]. - the function body of the callback functions are now wrapped with IS_ENABLED(); as the callback function must exist now that the attribute is always compiled-in (though not necessarily visible). No functionality change intended. Signed-off-by: Eric DeVolder --- drivers/base/cpu.c | 125 +++++++++++++++++++++++++++---------------- include/linux/tick.h | 2 +- 2 files changed, 81 insertions(+), 46 deletions(-) diff --git a/drivers/base/cpu.c b/drivers/base/cpu.c index c1815b9dae68..2455cbcebc87 100644 --- a/drivers/base/cpu.c +++ b/drivers/base/cpu.c @@ -82,24 +82,27 @@ void unregister_cpu(struct cpu *cpu) per_cpu(cpu_sys_devices, logical_cpu) = NULL; return; } +#endif /* CONFIG_HOTPLUG_CPU */ -#ifdef CONFIG_ARCH_CPU_PROBE_RELEASE static ssize_t cpu_probe_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { - ssize_t cnt; - int ret; + if (IS_ENABLED(CONFIG_ARCH_CPU_PROBE_RELEASE)) { + ssize_t cnt; + int ret; - ret = lock_device_hotplug_sysfs(); - if (ret) - return ret; + ret = lock_device_hotplug_sysfs(); + if (ret) + return ret; - cnt = arch_cpu_probe(buf, count); + cnt = arch_cpu_probe(buf, count); - unlock_device_hotplug(); - return cnt; + unlock_device_hotplug(); + return cnt; + } + return 0; } static ssize_t cpu_release_store(struct device *dev, @@ -107,23 +110,24 @@ static ssize_t cpu_release_store(struct device *dev, const char *buf, size_t count) { - ssize_t cnt; - int ret; + if (IS_ENABLED(CONFIG_ARCH_CPU_PROBE_RELEASE)) { + ssize_t cnt; + int ret; - ret = lock_device_hotplug_sysfs(); - if (ret) - return ret; + ret = lock_device_hotplug_sysfs(); + if (ret) + return ret; - cnt = arch_cpu_release(buf, count); + cnt = arch_cpu_release(buf, count); - unlock_device_hotplug(); - return cnt; + unlock_device_hotplug(); + return cnt; + } + return 0; } static DEVICE_ATTR(probe, S_IWUSR, NULL, cpu_probe_store); static DEVICE_ATTR(release, S_IWUSR, NULL, cpu_release_store); -#endif /* CONFIG_ARCH_CPU_PROBE_RELEASE */ -#endif /* CONFIG_HOTPLUG_CPU */ #ifdef CONFIG_KEXEC #include @@ -273,14 +277,14 @@ static ssize_t print_cpus_isolated(struct device *dev, } static DEVICE_ATTR(isolated, 0444, print_cpus_isolated, NULL); -#ifdef CONFIG_NO_HZ_FULL static ssize_t print_cpus_nohz_full(struct device *dev, struct device_attribute *attr, char *buf) { - return sysfs_emit(buf, "%*pbl\n", cpumask_pr_args(tick_nohz_full_mask)); + if (IS_ENABLED(CONFIG_NO_HZ_FULL)) + return sysfs_emit(buf, "%*pbl\n", cpumask_pr_args(tick_nohz_full_mask)); + return 0; } static DEVICE_ATTR(nohz_full, 0444, print_cpus_nohz_full, NULL); -#endif static void cpu_device_release(struct device *dev) { @@ -301,30 +305,32 @@ static void cpu_device_release(struct device *dev) */ } -#ifdef CONFIG_GENERIC_CPU_AUTOPROBE static ssize_t print_cpu_modalias(struct device *dev, struct device_attribute *attr, char *buf) { int len = 0; - u32 i; - - len += sysfs_emit_at(buf, len, - "cpu:type:" CPU_FEATURE_TYPEFMT ":feature:", - CPU_FEATURE_TYPEVAL); - - for (i = 0; i < MAX_CPU_FEATURES; i++) - if (cpu_have_feature(i)) { - if (len + sizeof(",XXXX\n") >= PAGE_SIZE) { - WARN(1, "CPU features overflow page\n"); - break; + if (IS_ENABLED(CONFIG_GENERIC_CPU_AUTOPROBE)) { + u32 i; + + len += sysfs_emit_at(buf, len, + "cpu:type:" CPU_FEATURE_TYPEFMT ":feature:", + CPU_FEATURE_TYPEVAL); + + for (i = 0; i < MAX_CPU_FEATURES; i++) + if (cpu_have_feature(i)) { + if (len + sizeof(",XXXX\n") >= PAGE_SIZE) { + WARN(1, "CPU features overflow page\n"); + break; + } + len += sysfs_emit_at(buf, len, ",%04X", i); } - len += sysfs_emit_at(buf, len, ",%04X", i); - } - len += sysfs_emit_at(buf, len, "\n"); + len += sysfs_emit_at(buf, len, "\n"); + } return len; } +#ifdef CONFIG_GENERIC_CPU_AUTOPROBE static int cpu_uevent(const struct device *dev, struct kobj_uevent_env *env) { char *buf = kzalloc(PAGE_SIZE, GFP_KERNEL); @@ -451,32 +457,61 @@ struct device *cpu_device_create(struct device *parent, void *drvdata, } EXPORT_SYMBOL_GPL(cpu_device_create); -#ifdef CONFIG_GENERIC_CPU_AUTOPROBE static DEVICE_ATTR(modalias, 0444, print_cpu_modalias, NULL); -#endif static struct attribute *cpu_root_attrs[] = { -#ifdef CONFIG_ARCH_CPU_PROBE_RELEASE &dev_attr_probe.attr, &dev_attr_release.attr, -#endif &cpu_attrs[0].attr.attr, &cpu_attrs[1].attr.attr, &cpu_attrs[2].attr.attr, &dev_attr_kernel_max.attr, &dev_attr_offline.attr, &dev_attr_isolated.attr, -#ifdef CONFIG_NO_HZ_FULL &dev_attr_nohz_full.attr, -#endif -#ifdef CONFIG_GENERIC_CPU_AUTOPROBE &dev_attr_modalias.attr, -#endif NULL }; +static umode_t +cpu_root_attr_is_visible(struct kobject *kobj, + struct attribute *attr, int unused) +{ + umode_t mode = attr->mode; + + if (IS_ENABLED(CONFIG_ARCH_CPU_PROBE_RELEASE)) { + if (attr == &dev_attr_probe.attr) + return mode; + if (attr == &dev_attr_release.attr) + return mode; + } + if (attr == &cpu_attrs[0].attr.attr) + return mode; + if (attr == &cpu_attrs[1].attr.attr) + return mode; + if (attr == &cpu_attrs[2].attr.attr) + return mode; + if (attr == &dev_attr_kernel_max.attr) + return mode; + if (attr == &dev_attr_offline.attr) + return mode; + if (attr == &dev_attr_isolated.attr) + return mode; + if (IS_ENABLED(CONFIG_NO_HZ_FULL)) { + if (attr == &dev_attr_nohz_full.attr) + return mode; + } + if (IS_ENABLED(CONFIG_GENERIC_CPU_AUTOPROBE)) { + if (attr == &dev_attr_modalias.attr) + return mode; + } + + return 0; +} + static const struct attribute_group cpu_root_attr_group = { .attrs = cpu_root_attrs, + .is_visible = cpu_root_attr_is_visible, }; static const struct attribute_group *cpu_root_attr_groups[] = { diff --git a/include/linux/tick.h b/include/linux/tick.h index 9459fef5b857..a05fdd4b21f4 100644 --- a/include/linux/tick.h +++ b/include/linux/tick.h @@ -174,9 +174,9 @@ static inline u64 get_cpu_iowait_time_us(int cpu, u64 *unused) { return -1; } static inline void tick_nohz_idle_stop_tick_protected(void) { } #endif /* !CONFIG_NO_HZ_COMMON */ +extern cpumask_var_t tick_nohz_full_mask; #ifdef CONFIG_NO_HZ_FULL extern bool tick_nohz_full_running; -extern cpumask_var_t tick_nohz_full_mask; static inline bool tick_nohz_full_enabled(void) {