Skip to contentSkip to conversation

arch/x86/mm: sparse 'tlb_single_page_flush_ceiling' warning

PATCH Superseded Jeremiah Mahler 4 participants 5 messages Aug 8, 2014 – Aug 11, 2014

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 arch/x86/mm: sparse 'tlb_single_page_flush_ceiling' warning

A sparse warning is generated about 'tlb_single_page_flush_ceiling' not being declared.

arch/x86/mm/tlb.c:177:15: warning: symbol 'tlb_single_page_flush_ceiling' was not declared. Should it be static?

Since it isn't used anywhere outside this file, fix the warning by making it static.

---
 arch/x86/mm/tlb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/mm/tlb.c +1 -1
index 1fe3398..fff4a4c 100644
@@ -174,7 +174,7 @@ void flush_tlb_current_task(void)
  *
  * This is in units of pages.
  */
-unsigned long tlb_single_page_flush_ceiling = 33;
+static unsigned long tlb_single_page_flush_ceiling = 33;
 
 void flush_tlb_mm_range(struct mm_struct *mm, unsigned long start,
 				unsigned long end, unsigned long vmflag)
Signature · 1 line
2.1.0.rc1
#1 lore raw
Quoted 10 lines · Jeremiah Mahler

A sparse warning is generated about 'tlb_single_page_flush_ceiling' not being declared.

arch/x86/mm/tlb.c:177:15: warning: symbol 'tlb_single_page_flush_ceiling' was not declared. Should it be static?

Since it isn't used anywhere outside this file, fix the warning by making it static.

Seems like __read_mostly would also be in order?

#2 lore raw

PATCH v2 1/1 arch/x86/mm: sparse 'tlb_single_page_flush_ceiling' warning

A sparse warning is generated about 'tlb_single_page_flush_ceiling' not being declared.

arch/x86/mm/tlb.c:177:15: warning: symbol 'tlb_single_page_flush_ceiling' was not declared. Should it be static?

Since it isn't used anywhere outside this file, fix the warning by making it static.

Also, optimize the use of this variable by adding the __read_mostly directive.

---

Notes:
I like the suggestion from David Rientjes, to add __read_mostly. Patch updated.

 arch/x86/mm/tlb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/mm/tlb.c +1 -1
index 1fe3398..bbe5766 100644
@@ -174,7 +174,7 @@ void flush_tlb_current_task(void)
  *
  * This is in units of pages.
  */
-unsigned long tlb_single_page_flush_ceiling = 33;
+static unsigned long tlb_single_page_flush_ceiling __read_mostly = 33;
 
 void flush_tlb_mm_range(struct mm_struct *mm, unsigned long start,
 				unsigned long end, unsigned long vmflag)
Signature · 1 line
2.1.0.rc1
#3 lore raw

[tip:x86/urgent] x86/mm: Fix sparse ' tlb_single_page_flush_ceiling' warning and make the variable read-mostly

x86/mm: Fix sparse 'tlb_single_page_flush_ceiling' warning and make the variable read-mostly
Commit-ID:  86426851c38d3fe84dee34d7daa71d26c174d409
Gitweb:     http://git.kernel.org/tip/86426851c38d3fe84dee34d7daa71d26c174d409
Author:     Jeremiah Mahler <[email protected]>
AuthorDate: Sat, 9 Aug 2014 00:38:33 -0700
Committer:  Ingo Molnar <[email protected]>
CommitDate: Sun, 10 Aug 2014 09:07:18 +0200

x86/mm: Fix sparse 'tlb_single_page_flush_ceiling' warning and make the variable read-mostly

A sparse warning is generated about 'tlb_single_page_flush_ceiling' not being declared.

arch/x86/mm/tlb.c:177:15: warning: symbol 'tlb_single_page_flush_ceiling' was not declared. Should it be static?

Since it isn't used anywhere outside this file, fix the warning by making it static.

Also, optimize the use of this variable by adding the __read_mostly directive, as suggested by David Rientjes.

---
 arch/x86/mm/tlb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/mm/tlb.c +1 -1
index 98b7976..ee61c36 100644
@@ -180,7 +180,7 @@ void flush_tlb_current_task(void)
  *
  * This is in units of pages.
  */
-unsigned long tlb_single_page_flush_ceiling = 33;
+static unsigned long tlb_single_page_flush_ceiling __read_mostly = 33;
 
 void flush_tlb_mm_range(struct mm_struct *mm, unsigned long start,
 				unsigned long end, unsigned long vmflag)
maintainer Acked-by on v2 1/1
#4 lore raw
In reply to Jeremiah Mahler
Quoted 11 lines · Jeremiah Mahler

A sparse warning is generated about 'tlb_single_page_flush_ceiling' not being declared.

arch/x86/mm/tlb.c:177:15: warning: symbol 'tlb_single_page_flush_ceiling' was not declared. Should it be static?

Since it isn't used anywhere outside this file, fix the warning by making it static.

Also, optimize the use of this variable by adding the __read_mostly directive.

Looks fine to me. It's definitely __read_mostly.