From: Xiao Guangrong <xiaoguangrong@cn.fujitsu.com>
To: Ingo Molnar <mingo@elte.hu>
Cc: hpa@zytor.com, LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] x86, tlb: small cleanup for native_flush_tlb_others
Date: Tue, 15 Mar 2011 09:57:37 +0800 [thread overview]
Message-ID: <4D7EC791.4040003@cn.fujitsu.com> (raw)
In-Reply-To: <20110314123355.GA27477@elte.hu>
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
next prev parent reply other threads:[~2011-03-15 1:56 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
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
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=4D7EC791.4040003@cn.fujitsu.com \
--to=xiaoguangrong@cn.fujitsu.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox