hugeltb: Mark hugelb_max_hstate __read_mostly
Subsystems (2)
PATCH 1/1 hugeltb: Mark hugelb_max_hstate __read_mostly
From: "Aneesh Kumar K.V" <[email protected]>
--- include/linux/hugetlb.h | 2 +- mm/hugetlb.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
include/linux/hugetlb.h +1 -1
@@ -23,7 +23,7 @@ struct hugepage_subpool { };extern spinlock_t hugetlb_lock; -extern int hugetlb_max_hstate; +extern int hugetlb_max_hstate__read_mostly ;#define for_each_hstate (h) \ for ((h) = hstates; (h) < &hstates[hugetlb_max_hstate]; (h)++)
mm/hugetlb.c +1 -1
@@ -37,7 +37,7 @@ const unsigned long hugetlb_zero = 0, hugetlb_infinity = ~0UL;static gfp_t htlb_alloc_mask =GFP_HIGHUSER ;unsigned long hugepages_treat_as_movable; -int hugetlb_max_hstate; +int hugetlb_max_hstate__read_mostly ;unsigned int default_hstate_idx;struct hstate hstates[HUGE_MAX_HSTATE ];
Signature · 7 lines
1.7.10 -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Quoted 13 lines · Aneesh Kumar K.V
From: "Aneesh Kumar K.V" <[email protected]>
Signed-off-by Aneesh Kumar K.V <[email protected]>--- include/linux/hugetlb.h | 2 +- mm/hugetlb.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)include/linux/hugetlb.h +0
-0
include/linux/hugetlb.h struct hugepage_subpool { · line 26
Quoted 5 lines
include/linux/hugetlb.h +1
-1@@ -23,7 +23,7 @@ struct hugepage_subpool { };extern spinlock_t hugetlb_lock; -extern int hugetlb_max_hstate; +extern int hugetlb_max_hstate__read_mostly ;
It should be used only for definition
Signature · 12 lines
Michal Hocko SUSE Labs SUSE LINUX s.r.o. Lihovarska 1060/12 190 00 Praha 9 Czech Republic -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Quoted 16 lines · Michal Hocko
Quoted 15 lines · Aneesh Kumar K.V
From: "Aneesh Kumar K.V" <[email protected]>
Signed-off-by Aneesh Kumar K.V <[email protected]>--- include/linux/hugetlb.h | 2 +- mm/hugetlb.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)include/linux/hugetlb.h +0
-0@@ -23,7 +23,7 @@ struct hugepage_subpool { };
Quoted 5 lines
include/linux/hugetlb.h struct hugepage_subpool { · line 26
Quoted 3 lines
include/linux/hugetlb.h +1
-1extern spinlock_t hugetlb_lock; -extern int hugetlb_max_hstate; +extern int hugetlb_max_hstate__read_mostly ;It should be used only for definition
And a rationale needs to be given. Since this patch had no effect, I would think that the patch is just the expression of the belief of the patcher that something would improve performancewise.
But there seems to no need for this patch otherwise someone would have verified that the patch has the intended beneficial effect on performance.
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Quoted 24 lines · Christoph Lameter
Quoted 16 lines · Michal Hocko
Quoted 15 lines · Aneesh Kumar K.V
From: "Aneesh Kumar K.V" <[email protected]>
Signed-off-by Aneesh Kumar K.V <[email protected]>--- include/linux/hugetlb.h | 2 +- mm/hugetlb.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)include/linux/hugetlb.h +0
-0@@ -23,7 +23,7 @@ struct hugepage_subpool { };Quoted 5 lines
include/linux/hugetlb.h struct hugepage_subpool { · line 26
Quoted 3 lines
include/linux/hugetlb.h +1
-1extern spinlock_t hugetlb_lock; -extern int hugetlb_max_hstate; +extern int hugetlb_max_hstate__read_mostly ;It should be used only for definition
Quoted 7 lines
And a rationale needs to be given. Since this patch had no effect, I would think that the patch is just the expression of the belief of the patcher that something would improve performancewise.
But there seems to no need for this patch otherwise someone would have verified that the patch has the intended beneficial effect on performance.
The variable is never modified after boot.
-aneesh
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Quoted 5 lines · Aneesh Kumar K.V
Quoted 3 lines
But there seems to no need for this patch otherwise someone would have verified that the patch has the intended beneficial effect on performance.
The variable is never modified after boot.
Thats all? There is no performance gain from this change?
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Quoted 9 lines · Christoph Lameter
Quoted 5 lines · Aneesh Kumar K.V
Quoted 3 lines
But there seems to no need for this patch otherwise someone would have verified that the patch has the intended beneficial effect on performance.
The variable is never modified after boot.
Thats all? There is no performance gain from this change?
Is that required in order to put data in the read mostly section?
Signature · 12 lines
Michal Hocko SUSE Labs SUSE LINUX s.r.o. Lihovarska 1060/12 190 00 Praha 9 Czech Republic -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Quoted 3 lines · Michal Hocko
Quoted 1 line
Thats all? There is no performance gain from this change?
Is that required in order to put data in the read mostly section?
I thought so. The read_mostly section is specially designed for data that causes excessive cacheline bounces and has to be grouped with rarely accessed other data. That was at least the intend when we created it.
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Andrew Morton
maintainerQuoted 10 lines · On Fri, 15 Jun 2012 09:50:00 -0500 (CDT) Christoph Lameter <[email protected]> wrote:
Quoted 3 lines · Michal Hocko
Quoted 1 line
Thats all? There is no performance gain from this change?
Is that required in order to put data in the read mostly section?
I thought so. The
read_mostlysection is specially designed for data that causes excessive cacheline bounces and has to be grouped with rarely accessed other data. That was at least the intend when we created it.
The __read_mostly thing really is a bit of a crapshoot. The runtime effects are extremely dependent upon Kconfig settings and toolchain behaviour. I do recall one or two cases where people did fix real-world observed performance issues by adding __read_mostly.
Literally "one or two". We have more than one or two __read_mostly annotations in there!
As that hugelb_max_hstate is write-once, it's a good candidate. I'll apply the patch and hope that it improves someone's kernel somewhere someday. Shrug.
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Quoted 16 lines · Michal Hocko
Quoted 15 lines · Aneesh Kumar K.V
From: "Aneesh Kumar K.V" <[email protected]>
Signed-off-by Aneesh Kumar K.V <[email protected]>--- include/linux/hugetlb.h | 2 +- mm/hugetlb.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)include/linux/hugetlb.h +0
-0@@ -23,7 +23,7 @@ struct hugepage_subpool { };
Quoted 6 lines
include/linux/hugetlb.h struct hugepage_subpool { · line 26
Quoted 3 lines
include/linux/hugetlb.h +1
-1extern spinlock_t hugetlb_lock; -extern int hugetlb_max_hstate; +extern int hugetlb_max_hstate__read_mostly ;It should be used only for definition
I looked at the rest of the source and found multiple place where we specify __read_mostly in extern.
arch/x86/kernel/cpu/perf_event.h extern struct x86_pmu x86_pmu __read_mostly; arch/x86/kernel/cpu/perf_event.h extern u64 __read_mostly hw_cache_event_ids arch/x86/kernel/cpu/perf_event.h extern u64 __read_mostly hw_cache_extra_regs
drivers/gpu/drm/i915/i915_drv.h extern int i915_panel_ignore_lid __read_mostly; drivers/gpu/drm/i915/i915_drv.h extern unsigned int i915_powersave __read_mostly; drivers/gpu/drm/i915/i915_drv.h extern int i915_semaphores __read_mostly; drivers/gpu/drm/i915/i915_drv.h extern unsigned int i915_lvds_downclock __read_mostly; drivers/gpu/drm/i915/i915_drv.h extern int i915_lvds_channel_mode __read_mostly; drivers/gpu/drm/i915/i915_drv.h extern int i915_panel_use_ssc __read_mostly; drivers/gpu/drm/i915/i915_drv.h extern int i915_vbt_sdvo_panel_type __read_mostly; drivers/gpu/drm/i915/i915_drv.h extern int i915_enable_rc6 __read_mostly; drivers/gpu/drm/i915/i915_drv.h extern int i915_enable_fbc __read_mostly; drivers/gpu/drm/i915/i915_drv.h extern bool i915_enable_hangcheck __read_mostly; drivers/gpu/drm/i915/i915_drv.h extern int i915_enable_ppgtt __read_mostly;
-aneesh
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>
Andrew Morton
maintainerQuoted 24 lines · On Fri, 15 Jun 2012 11:40:24 +0530 "Aneesh Kumar K.V"…
Quoted 16 lines · Michal Hocko
Quoted 15 lines · Aneesh Kumar K.V
From: "Aneesh Kumar K.V" <[email protected]>
Signed-off-by Aneesh Kumar K.V <[email protected]>--- include/linux/hugetlb.h | 2 +- mm/hugetlb.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)include/linux/hugetlb.h +0
-0@@ -23,7 +23,7 @@ struct hugepage_subpool { };Quoted 6 lines
include/linux/hugetlb.h struct hugepage_subpool { · line 26
Quoted 3 lines
include/linux/hugetlb.h +1
-1extern spinlock_t hugetlb_lock; -extern int hugetlb_max_hstate; +extern int hugetlb_max_hstate__read_mostly ;It should be used only for definition
Quoted 4 lines
I looked at the rest of the source and found multiple place where we specify
__read_mostlyin extern.
arch/x86/kernel/cpu/perf_event.hextern structx86_pmux86_pmu__read_mostly;
We have had one situation in the past where the lack of a section annotation on a declaration caused an architecture (arm?) to fail to build. iirc the compiler emitted some short-mode relative-addressed opcode to reference the variable, but when the linker came along to resolve the offset it discovered that it exceeded the short-mode addressing range, because that variable was in a section which landed far away from .data.
That's only happened once, and that architecture might have changed, and we're missing the section annotation on many variables anyway, so I'd be inclined to just leave it off - if we ever hit significant problems with this, we have a lot of work to do.
Also, we currently have no automated way of keeping the annotation on the declaration and definition in sync.
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>