Does get_user_pages() lock the pages?

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

 



Hi all,

I'm developing a kernel module which needs to access a buffer in a
process address space. Do get access to it, I use get_user_pages(). In
the book "Linux Device Drivers", 3rd ed., p. 436, it is claimed that
this functions locks the pages in memory, so they can be safely used for
DMA operations.

The following code portion in my module seems to reveal that they are
not locked:

...

down_read( &current->mm->mmap_sem );
get_user_pages( current,
                current->mm,
                pagesize_aligned_addr,
                no_pages,
                1,
                0,
                pages,
                vmas );
up_read( &current->mm->mmap_sem );

for( i = 0; i < no_pages; i++ ) {
    if( PageLocked(pages[i]) ) {
        printk( "    Page is locked" );
    }
    else {
        printk( "    Page is not locked" );
    }
}

...

For each page I get the information that it is not locked. I also looked
at the source code of get_user_pages() (Kernel 2.6.18) and couldn't find
any code that seems to lock the pages, but I'm not familiar with the
code, so maybe I'm mistaken.

So, does get_user_pages() lock the pages?

Thanks for your help!
Boris


-- 
|  _  RWTH | Boris Bierbaum
|_|_`_     | Lehrstuhl fuer Betriebssysteme
   | |_) _  | RWTH Aachen D-52056 Aachen
     |_)(_` | Tel: +49-241-80-27805
        ._) | Fax: +49-241-80-22339

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at http://kernelnewbies.org/FAQ


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux