linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: James Bottomley <James.Bottomley@steeleye.com>
To: "David S. Miller" <davem@redhat.com>
Cc: hugh@veritas.com, willy@debian.org,
	Linux Kernel <linux-kernel@vger.kernel.org>,
	PARISC list <parisc-linux@lists.parisc-linux.org>,
	drepper@redhat.com
Subject: Re: [parisc-linux] Re: Problems with kernel mmap (failing tst-mmap-eofsync in glibc on parisc)
Date: 23 Aug 2003 18:11:16 -0500	[thread overview]
Message-ID: <1061680279.1785.534.camel@mulgrave> (raw)
In-Reply-To: <20030823155312.63f996f6.davem@redhat.com>

On Sat, 2003-08-23 at 17:53, David S. Miller wrote:
> BTW, what gains to you really get from this optimization?
> 
> How often do writes happen to files while private mappings
> to it exist? :-)  This is one of the reasons I think this
> discussion is a bit silly.
> 
> What specific cases does your optimization help, and how common is it?
> Show us some numbers.

Not having to flush the private mappings is a huge optimisation.  Our
current flush_dcache_page implementation allows us only to flush a
single page and get all the aliased caches updated because we carefully
align MAP_SHARED areas (by supplying our own arch_get_unmapped_area()).

However, the alignment constraint is 4MB to get this property of the
virtually aliased caches, so we can't afford to align all mappings like
this (for our 32 bit userspace, anyway).

If we were to have to flush the private i_mmap list, we'd have to do a
page flush for *every* entry in the list (that's 256 instructions per
page at a cache width of 16 bytes).  This would be a horrific overhead.

using the VM_MAYSHARE to carry the read only shared mapping semantics
indication still allows us to align correctly, but the only additional
overhead we incur is to walk the i_mmap list to find VM_MAYSHARE
mappings as well as i_mmap_shared.  Since we can key of VM_MAYSHARE to
do the alignment, we still only need flush the first one we come to.

This all works as long as we can agree there are no pathological mmap
cases that force us to flush *all* the i_mmap mappings...which is what I
think the discussion has come down to.

James



  reply	other threads:[~2003-08-23 23:11 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-08-22 14:40 Problems with kernel mmap (failing tst-mmap-eofsync in glibc on parisc) James Bottomley
2003-08-22 16:14 ` David S. Miller
2003-08-22 16:34   ` [parisc-linux] " Matthew Wilcox
2003-08-22 16:39     ` David S. Miller
2003-08-22 17:41       ` Matthew Wilcox
2003-08-22 17:36         ` David S. Miller
2003-08-22 18:01           ` David S. Miller
2003-08-22 18:34             ` Hugh Dickins
2003-08-22 18:31               ` David S. Miller
2003-08-22 18:56                 ` James Bottomley
2003-08-22 19:19                   ` David S. Miller
2003-08-22 22:27                     ` James Bottomley
2003-08-22 22:41                       ` David S. Miller
2003-08-23  1:09                         ` James Bottomley
2003-08-23  7:22                           ` Hugh Dickins
2003-08-23 15:59                             ` James Bottomley
2003-08-23 21:44                             ` David S. Miller
2003-08-23 21:43                           ` David S. Miller
2003-08-23 22:21                             ` James Bottomley
2003-08-23 22:51                               ` David S. Miller
2003-08-23 23:01                                 ` James Bottomley
2003-08-23 22:53                               ` David S. Miller
2003-08-23 23:11                                 ` James Bottomley [this message]
2003-08-24  0:22                                   ` David S. Miller
     [not found]                                     ` <1061702282.1992.1153.camel@mulgrave>
     [not found]                                       ` <20030823222300.4695a0c4.davem@redhat.com>
2003-08-24 16:54                                         ` James Bottomley
2003-08-22 18:41               ` James Bottomley
2003-08-22 19:02                 ` Hugh Dickins
2003-08-22 19:09                 ` Randolph Chung
2003-08-22 16:42     ` Russell King
2003-08-22 16:39       ` David S. Miller

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=1061680279.1785.534.camel@mulgrave \
    --to=james.bottomley@steeleye.com \
    --cc=davem@redhat.com \
    --cc=drepper@redhat.com \
    --cc=hugh@veritas.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=parisc-linux@lists.parisc-linux.org \
    --cc=willy@debian.org \
    /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).