Re: sys_mlock/sys_munlock

Petr Vandrovec (VANDROVE@vc.cvut.cz)
Sat, 7 Oct 2000 00:00:55 MET-1


On 6 Oct 00 at 17:45, Atul Mukker. wrote:
> Hi,
> Can i use sys_mlock and sys_munlock in my driver module to lock/unlock the
> user address pages.
>
> Thanks
>
> P.S. Please mark your mail CC to atulm@ami.com

VMware's vmmon and in-kernel raw devices (and kiobufs) use simple
incrementing/decrementing page count - first cause pagein (vmmon uses
get_user(), kiobufs something more sophisticated), then use get_page
on that page. To release, use put_page().

But do not forget to look at my today's report about page->mapping == NULL...
If you'll do it with shared-mapped pages, and someone truncates file
they are mapped from, bad things can happen under 2.4.0 :-(
Best regards,
Petr Vandrovec
vandrove@vc.cvut.cz

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/