From: ebiederm@xmission.com (Eric W. Biederman)
To: Anton Blanchard <anton@linuxcare.com.au>
Cc: Ralf Baechle <ralf@uni-koblenz.de>,
linux-kernel@vger.kernel.org, linux-mm@frodo.biederman.org
Subject: Re: Caches, page coloring, virtual indexed caches, and more
Date: 17 Jan 2001 01:35:56 -0700 [thread overview]
Message-ID: <m1ae8qfudv.fsf@frodo.biederman.org> (raw)
In-Reply-To: <Pine.LNX.4.10.10101101100001.4457-100000@penguin.transmeta.com> <E14GR38-0000nM-00@the-village.bc.nu> <20010111005657.B2243@khan.acc.umu.se> <20010112035620.B1254@bacchus.dhis.org> <m17l40hhtd.fsf@frodo.biederman.org> <20010115005315.D1656@bacchus.dhis.org> <m1snmlfbrx.fsf_-_@frodo.biederman.org> <20010115095432.A14351@bacchus.dhis.org> <20010115235340.B31461@linuxcare.com> <m1itnfg7rk.fsf@frodo.biederman.org> <20010117154301.B7525@linuxcare.com>
In-Reply-To: Anton Blanchard's message of "Wed, 17 Jan 2001 15:43:01 +1100"
Anton Blanchard <anton@linuxcare.com.au> writes:
> Hi,
>
> > Where do you do this? And how do you handle the case of aliases with kseg,
> > the giant kernel mapping.
>
> Aliases between user and kernel mappings of a page are handled by
> flush_page_to_ram the old interface) or {copy,clear}_user_page,
> flush_dcache_page and update_mmu_cache (new interface). Sparc64 already
> uses the new interface and there are patches for ppc and ia64 to use it.
>
> The new interface allows flushes to be avoided, leading to rather nice
> performance increases.
>
> See Documentation/cachetlb.txt for more info.
Thanks,
Well they are a step in the right direction....
But they are still racy, especially on SMP.
The bad case is:
Process A in kernel space calls flush_dcache_page.
Then process B in a separate thread writes to the first word in a
cache line. The Process A writes to the last word in the cache line.
Assuming the virtual addresses from Process A and Process B are of a
different color this gives two non overlapping writes with a well
defined meaning, which the kernel gets wrong. In particular the ram
will only see one write or the other not both.
What it looks like to me is that SHMLBA needs to be extended to normal
mmapings, making all pages in user space
(page->index << PAGE_SHIFT) % SHMLBA
virtually aligned.
And whenever we access a page in the page cache that is not
appropriately virtually aligned in the fixed kernel mapping,
we can use the kmap infrastructure to map it to a better kernel
location. If we reuse the same optimizations from flush_dcache_page
it shouldn't be any worse, and in the pathological cases it will be
faster. While removing the races seen above.
Any thoughts?
Eric
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/
next prev parent reply other threads:[~2001-01-17 10:15 UTC|newest]
Thread overview: 79+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-01-08 5:29 Subtle MM bug Wayne Whitney
2001-01-08 5:42 ` Andi Kleen
2001-01-08 6:04 ` Linus Torvalds
2001-01-08 17:44 ` Rik van Riel
2001-01-08 18:02 ` Linus Torvalds
2001-01-08 17:16 ` Rik van Riel
2001-01-08 17:58 ` Linus Torvalds
2001-01-08 23:41 ` Zlatko Calusic
2001-01-09 2:58 ` Linus Torvalds
2001-01-09 6:20 ` Eric W. Biederman
2001-01-09 7:27 ` Linus Torvalds
2001-01-09 11:38 ` Eric W. Biederman
2001-01-09 12:29 ` Zlatko Calusic
2001-01-09 18:47 ` Linus Torvalds
2001-01-09 19:09 ` Daniel Phillips
2001-01-09 19:29 ` Trond Myklebust
2001-01-10 17:32 ` Andi Kleen
2001-01-10 19:31 ` Alan Cox
2001-01-10 19:33 ` Andi Kleen
2001-01-10 19:40 ` Alan Cox
2001-01-10 19:43 ` Andi Kleen
2001-01-10 19:48 ` Alan Cox
2001-01-10 19:48 ` Andi Kleen
2001-01-11 9:51 ` Trond Myklebust
2001-01-10 20:11 ` Linus Torvalds
2001-01-11 12:56 ` Stephen C. Tweedie
2001-01-11 13:10 ` Andi Kleen
2001-01-11 13:12 ` Trond Myklebust
2001-01-11 14:13 ` Stephen C. Tweedie
2001-01-11 19:03 ` Alexander Viro
2001-01-11 19:47 ` Stephen C. Tweedie
2001-01-11 19:57 ` Alexander Viro
2001-01-11 16:50 ` Albert D. Cahalan
2001-01-11 17:35 ` Stephen C. Tweedie
2001-01-11 19:38 ` Albert D. Cahalan
2001-01-11 19:01 ` Alexander Viro
2001-01-09 19:37 ` Linus Torvalds
2001-01-17 8:46 ` Rik van Riel
2001-01-25 22:51 ` Daniel Phillips
2001-01-09 19:53 ` Simon Kirby
2001-01-09 20:08 ` Linus Torvalds
2001-01-09 20:10 ` Zlatko Calusic
2001-01-10 1:45 ` David Woodhouse
2001-01-10 2:26 ` Andrea Arcangeli
2001-01-10 6:57 ` Linus Torvalds
2001-01-10 11:46 ` David Woodhouse
2001-01-10 14:56 ` Andrea Arcangeli
2001-01-10 17:46 ` Eric W. Biederman
2001-01-10 18:33 ` Andrea Arcangeli
2001-01-17 14:26 ` Rik van Riel
2001-01-10 19:03 ` Linus Torvalds
2001-01-10 19:27 ` David S. Miller
2001-01-10 19:36 ` Alan Cox
2001-01-10 23:56 ` David Weinehall
2001-01-11 0:24 ` Alan Cox
2001-01-12 5:56 ` Ralf Baechle
2001-01-12 16:10 ` Eric W. Biederman
2001-01-12 21:11 ` Russell King
2001-01-15 2:56 ` Ralf Baechle
2001-01-15 6:59 ` Eric W. Biederman
2001-01-15 2:53 ` Ralf Baechle
2001-01-15 8:41 ` Caches, page coloring, virtual indexed caches, and more Eric W. Biederman
2001-01-15 11:54 ` Ralf Baechle
2001-01-15 12:53 ` Anton Blanchard
2001-01-15 17:41 ` Ralf Baechle
2001-01-17 4:36 ` Anton Blanchard
2001-01-16 9:34 ` Eric W. Biederman
2001-01-17 4:43 ` Anton Blanchard
2001-01-17 8:35 ` Eric W. Biederman [this message]
2001-01-15 17:16 ` Eric W. Biederman
2001-01-16 4:58 ` Ralf Baechle
2001-01-15 18:22 ` Jamie Lokier
2001-01-15 12:51 ` Anton Blanchard
2001-01-17 14:28 ` Subtle MM bug Rik van Riel
2001-01-18 1:23 ` Linus Torvalds
2001-01-18 11:48 ` Rik van Riel
2001-01-10 17:03 ` Linus Torvalds
2001-01-11 14:36 ` Jim Gettys
2001-01-08 21:30 ` Wayne Whitney
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=m1ae8qfudv.fsf@frodo.biederman.org \
--to=ebiederm@xmission.com \
--cc=anton@linuxcare.com.au \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@frodo.biederman.org \
--cc=ralf@uni-koblenz.de \
/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