From: arnd@arndb.de (Arnd Bergmann)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] ARM: cpuidle: declare cpuidle_ops __read_mostly
Date: Wed, 10 Aug 2016 12:49:14 +0200 [thread overview]
Message-ID: <2742913.yoAdrazplg@wuerfel> (raw)
In-Reply-To: <20160810175403.53e218cf@xhacker>
On Wednesday, August 10, 2016 5:54:03 PM CEST Jisheng Zhang wrote:
> 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 <jszhang@marvell.com>
> > ---
> > 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.
>
>
Ok, just saw this reply and that matches up with what I just
wrote as well.
Thanks,
Arnd
WARNING: multiple messages have this Message-ID (diff)
From: Arnd Bergmann <arnd@arndb.de>
To: linux-arm-kernel@lists.infradead.org
Cc: Jisheng Zhang <jszhang@marvell.com>,
linux@armlinux.org.uk, daniel.lezcano@linaro.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] ARM: cpuidle: declare cpuidle_ops __read_mostly
Date: Wed, 10 Aug 2016 12:49:14 +0200 [thread overview]
Message-ID: <2742913.yoAdrazplg@wuerfel> (raw)
In-Reply-To: <20160810175403.53e218cf@xhacker>
On Wednesday, August 10, 2016 5:54:03 PM CEST Jisheng Zhang wrote:
> 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 <jszhang@marvell.com>
> > ---
> > 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.
>
>
Ok, just saw this reply and that matches up with what I just
wrote as well.
Thanks,
Arnd
next prev parent reply other threads:[~2016-08-10 10:49 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-10 8:49 [PATCH] ARM: cpuidle: declare cpuidle_ops __read_mostly Jisheng Zhang
2016-08-10 8:49 ` Jisheng Zhang
2016-08-10 8:57 ` Arnd Bergmann
2016-08-10 8:57 ` Arnd Bergmann
2016-08-10 9:19 ` Jisheng Zhang
2016-08-10 9:19 ` Jisheng Zhang
2016-08-10 10:47 ` Arnd Bergmann
2016-08-10 10:47 ` Arnd Bergmann
2016-08-10 11:06 ` Jisheng Zhang
2016-08-10 11:06 ` Jisheng Zhang
2016-08-10 9:54 ` Jisheng Zhang
2016-08-10 9:54 ` Jisheng Zhang
2016-08-10 10:49 ` Arnd Bergmann [this message]
2016-08-10 10:49 ` Arnd Bergmann
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=2742913.yoAdrazplg@wuerfel \
--to=arnd@arndb.de \
--cc=linux-arm-kernel@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.