* [PATCH v3 1/2] x86: Define early read-mostly per-cpu macros
@ 2012-05-20 15:19 Vlad Zolotarov
2012-05-21 8:46 ` Ingo Molnar
0 siblings, 1 reply; 5+ messages in thread
From: Vlad Zolotarov @ 2012-05-20 15:19 UTC (permalink / raw)
To: linux-kernel, Thomas Gleixner, Ingo Molnar, H. Peter Anvin, Ingo Molnar
Cc: Shai Fultheim (Shai@ScaleMP.com), Ido Yariv
Some read-mostly per-cpu data may need to be declared or defined early,
so it can be initialized and accessed before per_cpu areas are
allocated.
Only the data that resides in the per_cpu areas should be read-mostly,
as there is little benefit in optimizing cache lines on initialization.
Signed-off-by: Vlad Zolotarov <vlad@scalemp.com>
Signed-off-by: Ido Yariv <ido@wizery.com>
Signed-off-by: Shai Fultheim <shai@scalemp.com>
---
arch/x86/include/asm/percpu.h | 17 +++++++++++++++++
1 files changed, 17 insertions(+), 0 deletions(-)
diff --git a/arch/x86/include/asm/percpu.h b/arch/x86/include/asm/percpu.h
index 7a11910..8b5c8e0 100644
--- a/arch/x86/include/asm/percpu.h
+++ b/arch/x86/include/asm/percpu.h
@@ -555,6 +555,12 @@ DECLARE_PER_CPU(unsigned long, this_cpu_off);
{ [0 ... NR_CPUS-1] = _initvalue }; \
__typeof__(_type) *_name##_early_ptr __refdata = _name##_early_map
+#define DEFINE_EARLY_PER_CPU_READ_MOSTLY(_type, _name, _initvalue) \
+ DEFINE_PER_CPU_READ_MOSTLY(_type, _name) = _initvalue; \
+ __typeof__(_type) _name##_early_map[NR_CPUS] __initdata = \
+ { [0 ... NR_CPUS-1] = _initvalue }; \
+ __typeof__(_type) *_name##_early_ptr __refdata = _name##_early_map
+
#define EXPORT_EARLY_PER_CPU_SYMBOL(_name) \
EXPORT_PER_CPU_SYMBOL(_name)
@@ -563,6 +569,11 @@ DECLARE_PER_CPU(unsigned long, this_cpu_off);
extern __typeof__(_type) *_name##_early_ptr; \
extern __typeof__(_type) _name##_early_map[]
+#define DECLARE_EARLY_PER_CPU_READ_MOSTLY(_type, _name) \
+ DECLARE_PER_CPU_READ_MOSTLY(_type, _name); \
+ extern __typeof__(_type) *_name##_early_ptr; \
+ extern __typeof__(_type) _name##_early_map[]
+
#define early_per_cpu_ptr(_name) (_name##_early_ptr)
#define early_per_cpu_map(_name, _idx) (_name##_early_map[_idx])
#define early_per_cpu(_name, _cpu) \
@@ -574,12 +585,18 @@ DECLARE_PER_CPU(unsigned long, this_cpu_off);
#define DEFINE_EARLY_PER_CPU(_type, _name, _initvalue) \
DEFINE_PER_CPU(_type, _name) = _initvalue
+#define DEFINE_EARLY_PER_CPU_READ_MOSTLY(_type, _name, _initvalue) \
+ DEFINE_PER_CPU_READ_MOSTLY(_type, _name) = _initvalue
+
#define EXPORT_EARLY_PER_CPU_SYMBOL(_name) \
EXPORT_PER_CPU_SYMBOL(_name)
#define DECLARE_EARLY_PER_CPU(_type, _name) \
DECLARE_PER_CPU(_type, _name)
+#define DECLARE_EARLY_PER_CPU_READ_MOSTLY(_type, _name) \
+ DECLARE_PER_CPU_READ_MOSTLY(_type, _name)
+
#define early_per_cpu(_name, _cpu) per_cpu(_name, _cpu)
#define early_per_cpu_ptr(_name) NULL
/* no early_per_cpu_map() */
--
1.7.5.4
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH v3 1/2] x86: Define early read-mostly per-cpu macros
2012-05-20 15:19 [PATCH v3 1/2] x86: Define early read-mostly per-cpu macros Vlad Zolotarov
@ 2012-05-21 8:46 ` Ingo Molnar
2012-05-21 11:12 ` Vlad Zolotarov
0 siblings, 1 reply; 5+ messages in thread
From: Ingo Molnar @ 2012-05-21 8:46 UTC (permalink / raw)
To: Vlad Zolotarov
Cc: linux-kernel, Thomas Gleixner, Ingo Molnar, H. Peter Anvin,
Shai Fultheim (Shai@ScaleMP.com),
Ido Yariv
* Vlad Zolotarov <vlad@scalemp.com> wrote:
> Some read-mostly per-cpu data may need to be declared or defined early,
> so it can be initialized and accessed before per_cpu areas are
> allocated.
>
> Only the data that resides in the per_cpu areas should be read-mostly,
> as there is little benefit in optimizing cache lines on initialization.
>
> Signed-off-by: Vlad Zolotarov <vlad@scalemp.com>
> Signed-off-by: Ido Yariv <ido@wizery.com>
> Signed-off-by: Shai Fultheim <shai@scalemp.com>
That's not a valid signoff chain. If you send me a patch then
you should be the last SOB - but as the author you should be the
first SOB as well. I edited the two SOBs to be Acked-by's.
Thanks,
Ingo
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v3 1/2] x86: Define early read-mostly per-cpu macros
2012-05-21 8:46 ` Ingo Molnar
@ 2012-05-21 11:12 ` Vlad Zolotarov
2012-05-21 12:28 ` Ingo Molnar
0 siblings, 1 reply; 5+ messages in thread
From: Vlad Zolotarov @ 2012-05-21 11:12 UTC (permalink / raw)
To: Ingo Molnar
Cc: linux-kernel, Thomas Gleixner, Ingo Molnar, H. Peter Anvin,
Shai Fultheim (Shai@ScaleMP.com),
Ido Yariv
On Monday, May 21, 2012 10:46:26 AM Ingo Molnar wrote:
> * Vlad Zolotarov <vlad@scalemp.com> wrote:
> > Some read-mostly per-cpu data may need to be declared or defined early,
> > so it can be initialized and accessed before per_cpu areas are
> > allocated.
> >
> > Only the data that resides in the per_cpu areas should be read-mostly,
> > as there is little benefit in optimizing cache lines on initialization.
> >
> > Signed-off-by: Vlad Zolotarov <vlad@scalemp.com>
> > Signed-off-by: Ido Yariv <ido@wizery.com>
> > Signed-off-by: Shai Fultheim <shai@scalemp.com>
>
> That's not a valid signoff chain. If you send me a patch then
> you should be the last SOB - but as the author you should be the
> first SOB as well. I edited the two SOBs to be Acked-by's.
Thanks, Ingo. I understand. However the "history" of this patch is not as
simple as u represent. ;)
It was originally written by Ido and I just posted it (then I put my SOB at
the end of SOB list). But after u noted that it didn't compile on !SMP i
reworked it but yet Ido did at least half of the coding, so I put my SOB at
the first place (as I was the last one writing the code) and then Ido's as he
actually wrote the code in this patch as well and I do wanted to give him a
credit.
Do u still think changing his (Ido's) SOB to Acked-by was the right thing to
do?
Thanks,
vlad
>
> Thanks,
>
> Ingo
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v3 1/2] x86: Define early read-mostly per-cpu macros
2012-05-21 11:12 ` Vlad Zolotarov
@ 2012-05-21 12:28 ` Ingo Molnar
2012-05-21 13:27 ` Vlad Zolotarov
0 siblings, 1 reply; 5+ messages in thread
From: Ingo Molnar @ 2012-05-21 12:28 UTC (permalink / raw)
To: Vlad Zolotarov
Cc: linux-kernel, Thomas Gleixner, Ingo Molnar, H. Peter Anvin,
Shai Fultheim (Shai@ScaleMP.com),
Ido Yariv
* Vlad Zolotarov <vlad@scalemp.com> wrote:
> On Monday, May 21, 2012 10:46:26 AM Ingo Molnar wrote:
> > * Vlad Zolotarov <vlad@scalemp.com> wrote:
> > > Some read-mostly per-cpu data may need to be declared or defined early,
> > > so it can be initialized and accessed before per_cpu areas are
> > > allocated.
> > >
> > > Only the data that resides in the per_cpu areas should be read-mostly,
> > > as there is little benefit in optimizing cache lines on initialization.
> > >
> > > Signed-off-by: Vlad Zolotarov <vlad@scalemp.com>
> > > Signed-off-by: Ido Yariv <ido@wizery.com>
> > > Signed-off-by: Shai Fultheim <shai@scalemp.com>
> >
> > That's not a valid signoff chain. If you send me a patch then
> > you should be the last SOB - but as the author you should be the
> > first SOB as well. I edited the two SOBs to be Acked-by's.
>
> Thanks, Ingo. I understand. However the "history" of this
> patch is not as simple as u represent. ;)
>
> It was originally written by Ido and I just posted it (then I
> put my SOB at the end of SOB list). But after u noted that it
> didn't compile on !SMP i reworked it but yet Ido did at least
> half of the coding, so I put my SOB at the first place (as I
> was the last one writing the code) and then Ido's as he
> actually wrote the code in this patch as well and I do wanted
> to give him a credit.
The proper way to do that is to add a "Originally-From: " tag,
or to keep him as the author (and first SOB) and desccribe your
own changes as comments between the SOBs:
Signed-off-by: Original Author
[ cleaned up the code a bit ]
Signed-off-by: Second Author
[ restructured it ]
Signed-off-by: You
> Do u still think changing his (Ido's) SOB to Acked-by was the
> right thing to do?
If they agree with it then you can send it to me that way - or
the above way, or you can add any extra authors in a copyright
notice - but the signoff chain should be a chain, with the
primary author as the first SOB and the person sending me the
patch being the last SOB.
Thanks,
Ingo
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v3 1/2] x86: Define early read-mostly per-cpu macros
2012-05-21 12:28 ` Ingo Molnar
@ 2012-05-21 13:27 ` Vlad Zolotarov
0 siblings, 0 replies; 5+ messages in thread
From: Vlad Zolotarov @ 2012-05-21 13:27 UTC (permalink / raw)
To: Ingo Molnar
Cc: linux-kernel, Thomas Gleixner, Ingo Molnar, H. Peter Anvin,
Shai Fultheim (Shai@ScaleMP.com),
Ido Yariv
> >
> > Thanks, Ingo. I understand. However the "history" of this
> > patch is not as simple as u represent. ;)
> >
> > It was originally written by Ido and I just posted it (then I
> > put my SOB at the end of SOB list). But after u noted that it
> > didn't compile on !SMP i reworked it but yet Ido did at least
> > half of the coding, so I put my SOB at the first place (as I
> > was the last one writing the code) and then Ido's as he
> > actually wrote the code in this patch as well and I do wanted
> > to give him a credit.
>
> The proper way to do that is to add a "Originally-From: " tag,
> or to keep him as the author (and first SOB) and desccribe your
> own changes as comments between the SOBs:
>
> Signed-off-by: Original Author
> [ cleaned up the code a bit ]
> Signed-off-by: Second Author
> [ restructured it ]
> Signed-off-by: You
>
> > Do u still think changing his (Ido's) SOB to Acked-by was the
> > right thing to do?
>
> If they agree with it then you can send it to me that way - or
> the above way, or you can add any extra authors in a copyright
> notice - but the signoff chain should be a chain, with the
> primary author as the first SOB and the person sending me the
> patch being the last SOB.
Got it. I think the "above" way would describe the reality in the most exact
manner and would give the credit in the most exact manner.
I'd like to respin the series if it's still possible.
Pls., let me know.
thanks,
vlad
>
> Thanks,
>
> Ingo
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2012-05-21 13:27 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-05-20 15:19 [PATCH v3 1/2] x86: Define early read-mostly per-cpu macros Vlad Zolotarov
2012-05-21 8:46 ` Ingo Molnar
2012-05-21 11:12 ` Vlad Zolotarov
2012-05-21 12:28 ` Ingo Molnar
2012-05-21 13:27 ` Vlad Zolotarov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).