[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: mm->mmap_sem



On Sat, 25 Sep 1999, James Simmons wrote:

>framebuffer while the accel engine is running. Since many low end cards
>lock if you access the framebuffer and accel engine at the same time. 

I see your point.

>Note /dev/fb and /dev/gfx both can be opened by different processes.

If they are two threads and so if they are sharing the same process MM,
you can simply alloc the spinlock in the .data segment (trivial global
variable).

If the two process are not threads (so if they are not sharing the same
MM) then alloc the spinlock (or in general the memory you want to use as
an atomic lock) in a shared shm segment.

>Will this work for mmap regions as well?

Sure: you only need to always acquire the spinlock before accessing the
region of virtual memory. It doesn't metter which kind of memory you are
going to access.

Andrea

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://humbolt.geo.uu.nl/Linux-MM/