All of lore.kernel.org
 help / color / mirror / Atom feed
From: Richard Henderson <rth@twiddle.net>
To: David Mosberger <davidm@hpl.hp.com>
Cc: Paul Mackerras <paulus@samba.org>,
	torvalds@transmeta.com, linux-kernel@vger.kernel.org,
	davem@redhat.com
Subject: Re: [PATCH] avoid unnecessary cache flushes
Date: Mon, 3 Sep 2001 13:41:25 -0700	[thread overview]
Message-ID: <20010903134125.B16069@twiddle.net> (raw)
In-Reply-To: <15247.29338.3671.548678@cargo.ozlabs.ibm.com> <20010903131436.A16069@twiddle.net> <15251.59286.154267.431231@napali.hpl.hp.com>
In-Reply-To: <15251.59286.154267.431231@napali.hpl.hp.com>; from davidm@hpl.hp.com on Mon, Sep 03, 2001 at 01:27:02PM -0700

On Mon, Sep 03, 2001 at 01:27:02PM -0700, David Mosberger wrote:
>   >> +		if (!test_bit(PG_arch_1, &page->flags)) {
>   >> +			__flush_dcache_icache((unsigned long)kmap(page));
>   >> +			kunmap(page);
>   >> +			set_bit(PG_arch_1, &page->flags);
> 
>   Richard> Race.  Use test_and_set_bit.
> 
> Nope, the old code is correct: you must turn on PG_arch_1 *after*
> flushing the cache.  Yes, you might sometimes double flush, but that's
> both safe and rare.

You can get a missed flush from

	bit == 0
	flush cache

				modify page
				bit = 0

	bit = 1

unless this is protected from some outer lock of which 
I am not aware.

I do see your point about the early set though.


r~

  reply	other threads:[~2001-09-03 20:41 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-08-31 11:18 [PATCH] avoid unnecessary cache flushes Paul Mackerras
2001-08-31 22:45 ` David S. Miller
2001-09-01  8:35   ` Paul Mackerras
2001-09-01  8:55     ` David S. Miller
2001-09-01 11:47       ` Paul Mackerras
2001-09-01 12:24         ` David S. Miller
2001-09-03 20:14 ` Richard Henderson
2001-09-03 20:27   ` David Mosberger
2001-09-03 20:41     ` Richard Henderson [this message]
2001-09-03 21:00       ` David Mosberger
2001-09-04 16:37         ` Richard Henderson
2001-09-04 17:06           ` David Mosberger
2001-09-04  1:53       ` Paul Mackerras
2001-09-04  2:31         ` Andrea Arcangeli
2001-09-04  4:08           ` Paul Mackerras
2001-09-04 12:58             ` Andrea Arcangeli
2001-09-04 16:44         ` Richard Henderson

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=20010903134125.B16069@twiddle.net \
    --to=rth@twiddle.net \
    --cc=davem@redhat.com \
    --cc=davidm@hpl.hp.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=paulus@samba.org \
    --cc=torvalds@transmeta.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.