linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alex Shi <alex.shi@intel.com>
To: "H. Peter Anvin" <hpa@zytor.com>
Cc: Tomoki Sekiyama <tomoki.sekiyama.qu@hitachi.com>,
	x86@kernel.org, linux-kernel@vger.kernel.org,
	yrl.pp-manager.tt@hitachi.com, Ingo Molnar <mingo@redhat.com>,
	Thomas Gleixner <tglx@linutronix.de>
Subject: Re: [PATCH] x86: Distinguish TLB shootdown interrupts from other functions call interrupts
Date: Thu, 27 Sep 2012 15:02:21 +0800	[thread overview]
Message-ID: <5063F9FD.8050002@intel.com> (raw)
In-Reply-To: <20120926021128.22212.20440.stgit@hpxw>

>>

>> the 3.6 kernel will closed soon. it will be great to has this patch in.
>> So, could you like to refresh your patch with popular comments format? :)
> 
> Fixed patch is below.
> Thank you for the review again.
> 



Peter:

Maybe the patch doesn't looks perfect for this issue.
So I am wondering if the following patch is better, if we don't care the irq_tlb
was counted again in irq_call?

===
diff --git a/arch/x86/mm/tlb.c b/arch/x86/mm/tlb.c
index 613cd83..2d6d8ed 100644
--- a/arch/x86/mm/tlb.c
+++ b/arch/x86/mm/tlb.c
@@ -98,6 +98,8 @@ static void flush_tlb_func(void *info)
 {
        struct flush_tlb_info *f = info;
 
+       inc_irq_stat(irq_tlb_count);
+
        if (f->flush_mm != this_cpu_read(cpu_tlbstate.active_mm))
                return;
===

Or another solution is also reducing double counted irq_tlb_count from irq_call_count
What's your comments of this?

===
diff --git a/arch/x86/include/asm/hardirq.h b/arch/x86/include/asm/hardirq.h
index d3895db..aac7886 100644
--- a/arch/x86/include/asm/hardirq.h
+++ b/arch/x86/include/asm/hardirq.h
@@ -36,6 +36,7 @@ DECLARE_PER_CPU_SHARED_ALIGNED(irq_cpustat_t, irq_stat);
 #define __ARCH_IRQ_STAT
 
 #define inc_irq_stat(member)   this_cpu_inc(irq_stat.member)
+#define dec_irq_stat(member)    this_cpu_dec(irq_stat.member)
 
 #define local_softirq_pending()        this_cpu_read(irq_stat.__softirq_pending)
 
diff --git a/arch/x86/mm/tlb.c b/arch/x86/mm/tlb.c
index 613cd83..b82bd9f 100644
--- a/arch/x86/mm/tlb.c
+++ b/arch/x86/mm/tlb.c
@@ -98,6 +98,10 @@ static void flush_tlb_func(void *info)
 {
        struct flush_tlb_info *f = info;
 
+       /* remove double counted irq_tlb_count from irq_call_count */
+       dec_irq_stat(irq_call_count);
+       inc_irq_stat(irq_tlb_count);
+
        if (f->flush_mm != this_cpu_read(cpu_tlbstate.active_mm))
                return;
=== 

 
Thanks
    Alex

  parent reply	other threads:[~2012-09-27  7:03 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <50611D82.4010702@intel.com>
2012-09-26  2:11 ` [PATCH] x86: Distinguish TLB shootdown interrupts from other functions call interrupts Tomoki Sekiyama
2012-09-26  2:17   ` Alex Shi
2012-09-27  7:02   ` Alex Shi [this message]
2012-09-28  5:49     ` H. Peter Anvin
2012-09-28  6:08       ` Alex Shi
2012-09-28  6:13   ` [tip:x86/mm] " tip-bot for Tomoki Sekiyama
2012-09-19  9:04 [PATCH] " Tomoki Sekiyama
2012-09-20  1:18 ` Alex Shi
2012-09-20  8:50   ` Tomoki Sekiyama
2012-09-21  8:08     ` Alex Shi
2012-09-24  1:37     ` Alex Shi

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=5063F9FD.8050002@intel.com \
    --to=alex.shi@intel.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=tglx@linutronix.de \
    --cc=tomoki.sekiyama.qu@hitachi.com \
    --cc=x86@kernel.org \
    --cc=yrl.pp-manager.tt@hitachi.com \
    /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;
as well as URLs for NNTP newsgroup(s).