Re: mmap coherency kernel to user

From: Wolfgang Mes (wolfgang_at_iksw-muees.de)
Date: 08/31/05


Date: Wed, 31 Aug 2005 19:08:58 +0200

Hi eransha,

eransha wrote:
> I have written a driver that implements mmap using the nopage method.
> I handle the nopage simply by supplying a page that i get from
> get_free_page.
>
> As a user I'm using mmap (share mode) to get the page. I write to the
> memory, then I cout its contents (in user mode), then I invoke an ioctl
> that simply prints the content of the first bytes of the page, from the
> kernel point of view.
>
> The problem is that the kernel doesn't get updated often enough. i.e.
> if I wait a second and invoke the ioctl I might see the new value, but
> if I don't wait at all I see an older value.
>
> I guess the problem has to do with cache coherency, but I couldn't find
> a way to solve it

I don't think it is a cache problem. After all, the cache is the same for
user and kernel space.

Post some code.

best regards
Wolfgang



Relevant Pages

  • Re: strange mmap behaviour on arm
    ... I have written a driver that implements mmap using the nopage method. ... memory, then I cout its contents, then I invoke an ioctl ... The problem is that the kernel doesn't get updated often enough. ...
    (comp.sys.arm)
  • strange mmap behaviour on arm
    ... I have written a driver that implements mmap using the nopage method. ... memory, then I cout its contents, then I invoke an ioctl ... The problem is that the kernel doesn't get updated often enough. ...
    (comp.sys.arm)
  • Re: mmap coherency kernel to user
    ... > eransha wrote: ... >> I have written a driver that implements mmap using the nopage method. ... > I don't think it is a cache problem. ...
    (comp.os.linux.embedded)
  • mmap coherency kernel to user
    ... I have written a driver that implements mmap using the nopage method. ... memory, then I cout its contents, then I invoke an ioctl ... The problem is that the kernel doesn't get updated often enough. ...
    (comp.os.linux.embedded)
  • Re: [RFC 2.6.19 1/1] fbdev,mm: hecuba/E-Ink fbdev driver v2
    ... Meaning an app will decide to use the mmap path or the slow ... the kernel access to a data A through the cache ... If the kernel is allowed to write into the frame buffer, ...
    (Linux-Kernel)