linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: "Franck Bui-Huu" <vagabon.xyz@gmail.com>
To: Jaya Kumar <jayakumar.lkml@gmail.com>
Cc: linux-fbdev-devel@lists.sourceforge.net,
	linux-kernel@vger.kernel.org, linux-mm@kvack.org
Subject: Re: [RFC 2.6.19 1/1] fbdev,mm: hecuba/E-Ink fbdev driver v2
Date: Wed, 20 Dec 2006 09:50:46 +0100	[thread overview]
Message-ID: <cda58cb80612200050h6def9866nf1798753da9d842d@mail.gmail.com> (raw)
In-Reply-To: <45a44e480612162025n5d7c77bdkc825e94f1fb37904@mail.gmail.com>

On 12/17/06, Jaya Kumar <jayakumar.lkml@gmail.com> wrote:
> Ok. I now see what you mean. In typical cases, only one path is used
> to write. Meaning an app will decide to use the mmap path or the slow
> write path and the kernel only ever reads from its pte entry (unless
> fbcon is used which is not suited for this type of display).

Even if the kernel does only reads, you can be in trouble. For
example, the kernel access (by reading) to a data A through the cache
line 1. The application access (by writing a new value) data A through
the cahe line 5. Now it's time to update your frame buffer, so the
kernel access to data A through the cache line 1 which still contains
the _stall_ value.

Note that flushing data  before the kernel access it does not solve
any problems. If the kernel is allowed to write into the frame buffer,
the kernel don't know which line stores the up to date data...

> But you
> are right that it is possible for a situation to arise where one app
> does mmap and another is doing write.

I would say that should be a safe case. Nornally the kernel takes care
to flush caches between context switches (depending on your cache
architecture). But it's only a guess, I haven't checked the code...

> My hope is that something takes
> care of flushing the data cache for me in this case. Do you recommend
> I add something to force that?

Well I'm not the right person to answer this question. I haven't
looked at how Linux handles cache consistency yet. Knowing that I can
give you only 2 recommandations:

    - disable the cache when accessing your frame buffer (kernel and
applications).

    - when mmaping your frame buffer , be sure that the virtual
address returned by
      mmap() to the application shares the same cache lines than the
ones the kernel
      is using.

Hoping it helps,
-- 
               Franck

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  reply	other threads:[~2006-12-20  8:50 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-12-11 10:46 jayakumar.lkml
2006-12-11 16:37 ` Franck Bui-Huu
2006-12-11 23:54   ` Jaya Kumar
2006-12-13  8:38     ` Franck Bui-Huu
2006-12-17  4:25       ` Jaya Kumar
2006-12-20  8:50         ` Franck Bui-Huu [this message]
2006-12-22  9:57           ` Franck Bui-Huu
2006-12-28  3:53             ` Jaya Kumar

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=cda58cb80612200050h6def9866nf1798753da9d842d@mail.gmail.com \
    --to=vagabon.xyz@gmail.com \
    --cc=jayakumar.lkml@gmail.com \
    --cc=linux-fbdev-devel@lists.sourceforge.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.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