linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Thomas Hellstrom <thellstrom@vmware.com>
To: linux-kernel@vger.kernel.org
Cc: mingo@elte.hu, venkatesh.pallipadi@intel.com,
	Thomas Hellstrom <thellstrom@vmware.com>
Subject: [PATCH] x86: Use clflush() instead of wbinvd() whenever possible when changing mapping
Date: Fri, 24 Jul 2009 09:53:01 +0200	[thread overview]
Message-ID: <1248421981-31865-1-git-send-email-thellstrom@vmware.com> (raw)
In-Reply-To: <>

The current code uses wbinvd() when the area to flush is > 4MB. Although this
may be faster than using clflush() the effect of wbinvd() on irq latencies
may be catastrophical on systems with large caches. Therefore use clflush()
whenever possible and accept the slight performance hit.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
---
 arch/x86/mm/pageattr.c |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/arch/x86/mm/pageattr.c b/arch/x86/mm/pageattr.c
index 1b734d7..d4327db 100644
--- a/arch/x86/mm/pageattr.c
+++ b/arch/x86/mm/pageattr.c
@@ -209,13 +209,12 @@ static void cpa_flush_array(unsigned long *start, int numpages, int cache,
 			    int in_flags, struct page **pages)
 {
 	unsigned int i, level;
-	unsigned long do_wbinvd = cache && numpages >= 1024; /* 4M threshold */
 
 	BUG_ON(irqs_disabled());
 
-	on_each_cpu(__cpa_flush_all, (void *) do_wbinvd, 1);
+	on_each_cpu(__cpa_flush_all, (void *) 0UL, 1);
 
-	if (!cache || do_wbinvd)
+	if (!cache)
 		return;
 
 	/*
-- 
1.6.1.3


             reply	other threads:[~2009-07-24  7:52 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-24  7:53 Thomas Hellstrom [this message]
2009-07-24 10:05 ` [PATCH] x86: Use clflush() instead of wbinvd() whenever possible when changing mapping Andi Kleen
2009-07-24 10:21   ` Thomas Hellstrom
2009-07-24 10:58     ` Andi Kleen
2009-07-24 11:14       ` Thomas Hellstrom
2009-07-24 13:16         ` Andi Kleen
2009-07-30  9:07 ` Pavel Machek
2009-08-02 16:22   ` Thomas Hellström

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=1248421981-31865-1-git-send-email-thellstrom@vmware.com \
    --to=thellstrom@vmware.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=venkatesh.pallipadi@intel.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).