On Thu, 19 Jun 2008, Robert Mueller wrote:Pretty much any OS that tries to be make mmap() coherent with regular read/write accesses will automatically also have to be coherent wrt file size updates. IOW, I don't think that cyrus is real any more "wrong" in this than in assuming that you can mix read/write and mmap() accesses. In fact, I suspect that Cyrus is probably _more_ conservative than most, in that it would not be totally unheard of to just do a much bigger mmap(), and not even bother to re-do it until the file grows past that size (ie no 8k/16k granularity, but make it arbitrarily non-granular). Note that if you really want to be portable, you simply must not mix mmap() with *any* other operations without sprinking in a healthy amount of "msync()" or unmapping/remapping entirely. So _in_practice_ - because everybody tries to do a good job - you can actually expect to have mmap() be coherent, even though there are no real guarantees. Yeah. Over the years, the pain from having a non-coherent mmap() generally has pushed everybody into just making mmap() easy to use. Which means that mixing things generally works fine, even if it is not at all _guaranteed_. So I'd expect mmap+write to work and be coherent almost always. But it's still a fairly unusual combination, and I would personally think that using MAP_SHARED and writing through the mmap() would be the less surprising model. Linus --
| Stephen Smalley | Re: [AppArmor 39/45] AppArmor: Profile loading and manipulation, pathname matching |
| Tarkan Erimer | Re: Dual-Licensing Linux Kernel with GPL V2 and GPL V3 |
| Jan Engelhardt | intel iommu (Re: -mm merge plans for 2.6.23) |
| Greg Kroah-Hartman | [PATCH 005/196] Chinese: add translation of SubmittingDrivers |
git: | |
| David Fenyes | sigsetmask()? (LINUX) |
| Stephen Tweedie | Unmounting root (no kidding!) [was: Some Linux problems---solved] |
| Les Andrzejewski | X386/WD90C31/SUMSUNG SYNC MASTER 4 |
| Doug Evans | Re: Stabilizing Linux |
| Gerrit Renker | [PATCH 27/37] dccp: Integration of dynamic feature activation - part 2 (server side) |
| Linus Torvalds | Re: [GIT]: Networking |
| Jarek Poplawski | [PATCH] pkt_sched: Destroy gen estimators under rtnl_lock(). |
| Herbert Xu | Re: [PATCH] myr10ge: again fix lro_gen_skb() alignment |
