Re: [RFC] powerpc/mm: honor O_SYNC flag for memory map
From: Li Yang <hidden>
Date: 2009-11-20 09:23:26
On Fri, Nov 20, 2009 at 5:03 PM, Benjamin Herrenschmidt [off-list ref] wrote:
On Fri, 2009-11-20 at 11:00 +0800, Li Yang-R58472 wrote:quoted
Because there is no way to set mapped memory as cacheable if the memory is not managed by Linux kernel. =C2=A0While, it's not rare in real syste=
m
quoted
to allocate some dedicated memory to a certain application which is not managed by kernel and then mmap'ed the memory to the application. =C2=A0=
The
quoted
memory should be cacheable but we can't map it to be cacheable due to this intelligent setting. =C2=A0And it is a big hit to the performance. Moreover, the standard O_SYNC flag suggest that user has the control over cacheablity, but actually we had not.You need to be a bit more careful tho. You must not allow RAM managed by the kernel to be mapped non-cachable.
Even if the user explicitly sets the O_SYNC flag? IMHO, it's a bug of the application if it uses O_SYNC on main memory to be mmap'ed later. And we don't need to cover up the bug. - Leo