linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Michel Lespinasse <walken@google.com>
To: Will Huck <will.huckk@gmail.com>
Cc: Gil Weber <gilw@cse-semaphore.com>,
	"linux-mm@kvack.org" <linux-mm@kvack.org>,
	Michal Hocko <mhocko@suse.cz>,
	Johannes Weiner <hannes@cmpxchg.org>,
	Hugh Dickins <hughd@google.com>
Subject: Re: mmap sync issue
Date: Sat, 16 Mar 2013 17:42:06 -0700	[thread overview]
Message-ID: <CANN689HX9rhecNv3RsDn8QZO8iUrMsQQBgnhUDb5AdyfWgyFag@mail.gmail.com> (raw)
In-Reply-To: <514502B6.2090804@gmail.com>

On Sat, Mar 16, 2013 at 4:39 PM, Will Huck <will.huckk@gmail.com> wrote:
> On 03/15/2013 07:39 PM, Gil Weber wrote:
>> I am experiencing an issue with my device driver. I am using mmap and
>> ioctl to share information with my user space application.
>> The thing is that the shared memory does not seems to be synced. Do check
>> this, I have done a simple test:

So if I got this right, the issue is that the vmalloc_area is
virtually aliased between the kernel and the user space mapping, so
that coherency is not guaranteed on architectures that use virtually
aliased caches.

fs/aio.c does something similar to what you want with their ring
buffer. The kernel doesn't access the ring buffer through a vmalloc
area like you're trying to do; instead it uses kmap_atomic() ..
kunmap_atomic() whenever it wants to access it.

I don't actually consider myself an expert in this area but I believe
the above should solve your problem :)

-- 
Michel "Walken" Lespinasse
A program is never fully debugged until the last user dies.

--
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:[~2013-03-17  0:42 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-15 11:39 Gil Weber
2013-03-16 23:39 ` Will Huck
2013-03-17  0:42   ` Michel Lespinasse [this message]
2013-03-18  2:33     ` Hugh Dickins

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=CANN689HX9rhecNv3RsDn8QZO8iUrMsQQBgnhUDb5AdyfWgyFag@mail.gmail.com \
    --to=walken@google.com \
    --cc=gilw@cse-semaphore.com \
    --cc=hannes@cmpxchg.org \
    --cc=hughd@google.com \
    --cc=linux-mm@kvack.org \
    --cc=mhocko@suse.cz \
    --cc=will.huckk@gmail.com \
    /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