All of lore.kernel.org
 help / color / mirror / Atom feed
From: "H. Peter Anvin" <hpa@zytor.com>
To: Shaohua Li <shaohua.li@intel.com>
Cc: lkml <linux-kernel@vger.kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	Ingo Molnar <mingo@elte.hu>,
	"Pallipadi, Venkatesh" <venkatesh.pallipadi@intel.com>
Subject: Re: [patch]pageattr: cache flush before tlb flush
Date: Mon, 18 Aug 2008 22:09:46 -0700	[thread overview]
Message-ID: <48AA559A.6060903@zytor.com> (raw)
In-Reply-To: <1219026451.16428.4.camel@sli10-desk.sh.intel.com>

Shaohua Li wrote:
> clflush uses a virtual address but cache line is physical indexed in
> x86. In my understanding, clflush will do some pagetable walk, so doing
> cache flush first should reduce some pagetable walk.
> 
> Signed-off-by: Shaohua Li <shaohua.li@intel.com>

I would say NAK on this.

Doing the CLFLUSH first does cut down on page table walking, but opens a 
hole in the sequencing: first set PAT to an uncachable mode, then flush.

If an unlucky prefetch comes in during this window, then you will have a 
dirty cache again.

So no, this is not a good idea.

	-hpa

  reply	other threads:[~2008-08-19  5:14 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-18  2:27 [patch]pageattr: cache flush before tlb flush Shaohua Li
2008-08-19  5:09 ` H. Peter Anvin [this message]
2008-08-19  5:24   ` Li, Shaohua
2008-08-19  6:38 ` Andi Kleen

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=48AA559A.6060903@zytor.com \
    --to=hpa@zytor.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=shaohua.li@intel.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.