From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934123AbcHJSU7 (ORCPT ); Wed, 10 Aug 2016 14:20:59 -0400 Received: from mx0b-0016f401.pphosted.com ([67.231.156.173]:17551 "EHLO mx0b-0016f401.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933672AbcHJSU4 (ORCPT ); Wed, 10 Aug 2016 14:20:56 -0400 Date: Wed, 10 Aug 2016 17:54:03 +0800 From: Jisheng Zhang To: , CC: , Subject: Re: [PATCH] ARM: cpuidle: declare cpuidle_ops __read_mostly Message-ID: <20160810175403.53e218cf@xhacker> In-Reply-To: <1470818997-808-1-git-send-email-jszhang@marvell.com> References: <1470818997-808-1-git-send-email-jszhang@marvell.com> X-Mailer: Claws Mail 3.14.0 (GTK+ 2.24.30; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2016-08-10_07:,, signatures=0 X-Proofpoint-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1604210000 definitions=main-1608100107 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 10 Aug 2016 16:49:57 +0800 Jisheng Zhang wrote: > cpuidle_ops is initialized once by arm_cpuidle_read_ops() during > initialization, and thereafter is mostly read in arm_cpuidle_suspend() > > The fact that it is mostly read and not written to makes it candidates > for __read_mostly declarations. > > Signed-off-by: Jisheng Zhang > --- > arch/arm/kernel/cpuidle.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/arch/arm/kernel/cpuidle.c b/arch/arm/kernel/cpuidle.c > index 7dccc96..762e0929 100644 > --- a/arch/arm/kernel/cpuidle.c > +++ b/arch/arm/kernel/cpuidle.c > @@ -19,7 +19,7 @@ extern struct of_cpuidle_method __cpuidle_method_of_table[]; > static const struct of_cpuidle_method __cpuidle_method_of_table_sentinel > __used __section(__cpuidle_method_of_table_end); > > -static struct cpuidle_ops cpuidle_ops[NR_CPUS]; > +static struct cpuidle_ops cpuidle_ops[NR_CPUS] __read_mostly; oops, I just found that "arm: apply more __ro_after_init" from Kees marked cpuidle_ops as __ro_after_init, that also meet my need, so let's drop my patch. Thanks, Jisheng