Re: BUG: mmapfile/writev spurious zero bytes (x86_64/not i386, bisected, reproducable)

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Bron Gondwana <brong@...>
Cc: Linux Kernel Mailing List <linux-kernel@...>, Nick Piggin <npiggin@...>, Andrew Morton <akpm@...>, Rob Mueller <robm@...>, Andi Kleen <andi@...>, Ingo Molnar <mingo@...>
Date: Wednesday, June 18, 2008 - 12:03 am

On Wed, 18 Jun 2008, Bron Gondwana wrote:

Heh. Congrats ;)


Is there any reason it doesn't use mmap(MAP_SHARED) and make the 
modifications that way too?

Because quite frankly, the mixture of doing mmap() and write() system 
calls is quite fragile - and I'm not saying that just because of this 
particular bug, but because there are all kinds of nasty cache aliasing 
issues with virtually indexed caches etc that just fundamentally mean that 
it's often a mistake to mix mmap with read/write at the same time.

(For the same reason it's not a good idea to mix writing through an mmap() 
and then using read() to read it - again, you can have some nasty aliasing 
going on there).

So this particular issue was definitely a kernel bug (and big thanks for 
making such a good test-case), but in general, it does sound like Cyrus is 
actively trying to dig itself into a nasty hole there.

			Linus
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: BUG: mmapfile/writev spurious zero bytes (x86_64/not i38..., Linus Torvalds, (Wed Jun 18, 12:03 am)