public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Manfred Spraul <manfred@colorfullife.com>
To: Rik van Riel <riel@conectiva.com.br>
Cc: linux-kernel@vger.kernel.org, davem@redhat.com
Subject: Re: [PATCH] flush_cache_page while pte valid
Date: Tue, 12 Nov 2002 21:53:14 +0100	[thread overview]
Message-ID: <3DD16A3A.8040108@colorfullife.com> (raw)

>
>
>>
>> The flush merely writes back the data, a copy-back operation, fully L2
>> cache coherent.  All cpus will see correct data if an intermittant
>> store occurs.
>
>The CPUs will, but the harddisk might not.
>  
>
The lost dirty bit can only happen on cpus where the hardware maintains 
a dirty bit. I doubt that the sparc cpus do that in hardware.

But like Hugh I don't understand how the cache writeback works on SMP.

cpu1:                cpu 2
                        access a mmaping, pte loaded into TLB
try_to_unmap_one()
flush_cache_page();
                        access the mmaping again. pte either still from
                        tlb, or reloaded from pte.
ptep_get_and_clear();
                        access the mmaping again, using the tlb
flush_tlb()
                        ??? How will the cpu write back now?

If the write back happens based on the tlb, then I don't understand why 
it's needed at all.

Regarding the dirty bit:
The assumption for the dirty bit is that the i386 cpu are the only cpus 
in the world (TM) that maintain the dirty bit in hardware, and tests on 
several i386 cpus have shown that the tlb walker retests the present bit 
before setting the dirty bit. Software tlb implementations must emulate 
that.

Thus it's guaranteed that
- if the dirty bit is not set in the result of ptep_get_and_clear, then 
no write operation has happened or will happen.
- if the dirty bit is set, then write operations could happen until the 
tlb flush.
- there will be no spuriously set dirty bits in the page tables.

--
    Manfred


             reply	other threads:[~2002-11-12 20:46 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-11-12 20:53 Manfred Spraul [this message]
2002-11-12 22:01 ` [PATCH] flush_cache_page while pte valid David S. Miller
  -- strict thread matches above, loose matches on Subject: below --
2002-11-12 21:32 Ulrich Weigand
2002-11-12  1:08 Ulrich Weigand
2002-11-11 21:20 Manfred Spraul
2002-11-12  0:37 ` Russell King
2002-11-11 18:25 Hugh Dickins
2002-11-11 18:35 ` Andrew Morton
2002-11-11 23:19 ` David S. Miller
2002-11-12  6:53   ` Hugh Dickins
2002-11-12  6:53     ` David S. Miller
2002-11-12 14:49       ` Rik van Riel
2002-11-12 21:45         ` David S. Miller
2002-11-12 17:43       ` Hugh Dickins
2002-11-12 21:51         ` David S. Miller
2002-11-12 22:59           ` Hugh Dickins

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=3DD16A3A.8040108@colorfullife.com \
    --to=manfred@colorfullife.com \
    --cc=davem@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=riel@conectiva.com.br \
    /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