* [PATCH] x86, tlb: small cleanup for native_flush_tlb_others @ 2011-03-14 6:55 Xiao Guangrong 2011-03-14 12:33 ` Ingo Molnar 0 siblings, 1 reply; 5+ messages in thread From: Xiao Guangrong @ 2011-03-14 6:55 UTC (permalink / raw) To: Ingo Molnar; +Cc: hpa, LKML Use smp_processor_id instead of get_cpu and put_cpu since the caller has already disabled preemption Signed-off-by: Xiao Guangrong <xiaoguangrong@cn.fujitsu.com> --- arch/x86/mm/tlb.c | 3 +-- 1 files changed, 1 insertions(+), 2 deletions(-) diff --git a/arch/x86/mm/tlb.c b/arch/x86/mm/tlb.c index 6acc724..92849d0 100644 --- a/arch/x86/mm/tlb.c +++ b/arch/x86/mm/tlb.c @@ -211,11 +211,10 @@ void native_flush_tlb_others(const struct cpumask *cpumask, if (is_uv_system()) { unsigned int cpu; - cpu = get_cpu(); + cpu = smp_processor_id(); cpumask = uv_flush_tlb_others(cpumask, mm, va, cpu); if (cpumask) flush_tlb_others_ipi(cpumask, mm, va); - put_cpu(); return; } flush_tlb_others_ipi(cpumask, mm, va); -- 1.7.4 ^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] x86, tlb: small cleanup for native_flush_tlb_others 2011-03-14 6:55 [PATCH] x86, tlb: small cleanup for native_flush_tlb_others Xiao Guangrong @ 2011-03-14 12:33 ` Ingo Molnar 2011-03-14 12:39 ` Ingo Molnar 2011-03-15 1:57 ` Xiao Guangrong 0 siblings, 2 replies; 5+ messages in thread From: Ingo Molnar @ 2011-03-14 12:33 UTC (permalink / raw) To: Xiao Guangrong; +Cc: hpa, LKML * Xiao Guangrong <xiaoguangrong@cn.fujitsu.com> wrote: > Use smp_processor_id instead of get_cpu and put_cpu since > the caller has already disabled preemption > > Signed-off-by: Xiao Guangrong <xiaoguangrong@cn.fujitsu.com> > --- > arch/x86/mm/tlb.c | 3 +-- > 1 files changed, 1 insertions(+), 2 deletions(-) > > diff --git a/arch/x86/mm/tlb.c b/arch/x86/mm/tlb.c > index 6acc724..92849d0 100644 > --- a/arch/x86/mm/tlb.c > +++ b/arch/x86/mm/tlb.c > @@ -211,11 +211,10 @@ void native_flush_tlb_others(const struct cpumask *cpumask, > if (is_uv_system()) { > unsigned int cpu; > > - cpu = get_cpu(); > + cpu = smp_processor_id(); > cpumask = uv_flush_tlb_others(cpumask, mm, va, cpu); > if (cpumask) > flush_tlb_others_ipi(cpumask, mm, va); > - put_cpu(); > return; There's multiple callers. Could you please update the changelog with the list of callers and a statement that all of them disable preemption already? Thanks, Ingo ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] x86, tlb: small cleanup for native_flush_tlb_others 2011-03-14 12:33 ` Ingo Molnar @ 2011-03-14 12:39 ` Ingo Molnar 2011-03-15 1:57 ` Xiao Guangrong 1 sibling, 0 replies; 5+ messages in thread From: Ingo Molnar @ 2011-03-14 12:39 UTC (permalink / raw) To: Xiao Guangrong; +Cc: hpa, LKML Also, the title of the patch should be something like 'small micro-optimization' - as it's not just a cleanup, it has side-effects on the code. Thanks, Ingo ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] x86, tlb: small cleanup for native_flush_tlb_others 2011-03-14 12:33 ` Ingo Molnar 2011-03-14 12:39 ` Ingo Molnar @ 2011-03-15 1:57 ` Xiao Guangrong 2011-03-15 7:49 ` [tip:x86/mm] x86, tlb, UV: Do small micro-optimization for native_flush_tlb_others() tip-bot for Xiao Guangrong 1 sibling, 1 reply; 5+ messages in thread From: Xiao Guangrong @ 2011-03-15 1:57 UTC (permalink / raw) To: Ingo Molnar; +Cc: hpa, LKML On 03/14/2011 08:33 PM, Ingo Molnar wrote: > > * Xiao Guangrong <xiaoguangrong@cn.fujitsu.com> wrote: > >> Use smp_processor_id instead of get_cpu and put_cpu since >> the caller has already disabled preemption >> >> Signed-off-by: Xiao Guangrong <xiaoguangrong@cn.fujitsu.com> >> --- >> arch/x86/mm/tlb.c | 3 +-- >> 1 files changed, 1 insertions(+), 2 deletions(-) >> >> diff --git a/arch/x86/mm/tlb.c b/arch/x86/mm/tlb.c >> index 6acc724..92849d0 100644 >> --- a/arch/x86/mm/tlb.c >> +++ b/arch/x86/mm/tlb.c >> @@ -211,11 +211,10 @@ void native_flush_tlb_others(const struct cpumask *cpumask, >> if (is_uv_system()) { >> unsigned int cpu; >> >> - cpu = get_cpu(); >> + cpu = smp_processor_id(); >> cpumask = uv_flush_tlb_others(cpumask, mm, va, cpu); >> if (cpumask) >> flush_tlb_others_ipi(cpumask, mm, va); >> - put_cpu(); >> return; > > There's multiple callers. Could you please update the changelog with the list of > callers and a statement that all of them disable preemption already? > Thanks Ingo, there is the new version. From: Xiao Guangrong <xiaoguangrong@cn.fujitsu.com> Subject: [PATCH] x86, tlb: small micro-optimization for native_flush_tlb_others native_flush_tlb_others is called from: flush_tlb_current_task flush_tlb_mm flush_tlb_page All these functions disable preemption explicitly, so we can use smp_processor_id instead of get_cpu and put_cpu Signed-off-by: Xiao Guangrong <xiaoguangrong@cn.fujitsu.com> --- arch/x86/mm/tlb.c | 3 +-- 1 files changed, 1 insertions(+), 2 deletions(-) diff --git a/arch/x86/mm/tlb.c b/arch/x86/mm/tlb.c index 6acc724..92849d0 100644 --- a/arch/x86/mm/tlb.c +++ b/arch/x86/mm/tlb.c @@ -211,11 +211,10 @@ void native_flush_tlb_others(const struct cpumask *cpumask, if (is_uv_system()) { unsigned int cpu; - cpu = get_cpu(); + cpu = smp_processor_id(); cpumask = uv_flush_tlb_others(cpumask, mm, va, cpu); if (cpumask) flush_tlb_others_ipi(cpumask, mm, va); - put_cpu(); return; } flush_tlb_others_ipi(cpumask, mm, va); -- 1.7.4 ^ permalink raw reply related [flat|nested] 5+ messages in thread
* [tip:x86/mm] x86, tlb, UV: Do small micro-optimization for native_flush_tlb_others() 2011-03-15 1:57 ` Xiao Guangrong @ 2011-03-15 7:49 ` tip-bot for Xiao Guangrong 0 siblings, 0 replies; 5+ messages in thread From: tip-bot for Xiao Guangrong @ 2011-03-15 7:49 UTC (permalink / raw) To: linux-tip-commits Cc: linux-kernel, hpa, mingo, cpw, xiaoguangrong, tglx, mingo Commit-ID: 25542c646afbf14c43fa7d2b443055cadb73b07a Gitweb: http://git.kernel.org/tip/25542c646afbf14c43fa7d2b443055cadb73b07a Author: Xiao Guangrong <xiaoguangrong@cn.fujitsu.com> AuthorDate: Tue, 15 Mar 2011 09:57:37 +0800 Committer: Ingo Molnar <mingo@elte.hu> CommitDate: Tue, 15 Mar 2011 08:30:34 +0100 x86, tlb, UV: Do small micro-optimization for native_flush_tlb_others() native_flush_tlb_others() is called from: flush_tlb_current_task() flush_tlb_mm() flush_tlb_page() All these functions disable preemption explicitly, so we can use smp_processor_id() instead of get_cpu() and put_cpu(). Signed-off-by: Xiao Guangrong <xiaoguangrong@cn.fujitsu.com> Cc: Cliff Wickman <cpw@sgi.com> LKML-Reference: <4D7EC791.4040003@cn.fujitsu.com> Signed-off-by: Ingo Molnar <mingo@elte.hu> --- arch/x86/mm/tlb.c | 3 +-- 1 files changed, 1 insertions(+), 2 deletions(-) diff --git a/arch/x86/mm/tlb.c b/arch/x86/mm/tlb.c index 55272d7..d6c0418 100644 --- a/arch/x86/mm/tlb.c +++ b/arch/x86/mm/tlb.c @@ -208,11 +208,10 @@ void native_flush_tlb_others(const struct cpumask *cpumask, if (is_uv_system()) { unsigned int cpu; - cpu = get_cpu(); + cpu = smp_processor_id(); cpumask = uv_flush_tlb_others(cpumask, mm, va, cpu); if (cpumask) flush_tlb_others_ipi(cpumask, mm, va); - put_cpu(); return; } flush_tlb_others_ipi(cpumask, mm, va); ^ permalink raw reply related [flat|nested] 5+ messages in thread
end of thread, other threads:[~2011-03-15 7:49 UTC | newest] Thread overview: 5+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2011-03-14 6:55 [PATCH] x86, tlb: small cleanup for native_flush_tlb_others Xiao Guangrong 2011-03-14 12:33 ` Ingo Molnar 2011-03-14 12:39 ` Ingo Molnar 2011-03-15 1:57 ` Xiao Guangrong 2011-03-15 7:49 ` [tip:x86/mm] x86, tlb, UV: Do small micro-optimization for native_flush_tlb_others() tip-bot for Xiao Guangrong
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox