How can I know a page is pinned from the struct page?

Viewed 65

I want to know whether a page is pinned in the physical memory, i.e., not swappable or migratable.

From this post, I know get_user_pages() is commonly used to pin userspace memory in drivers to do DMA. It increases the refcnt of the struct page, which means somebody is operating on the physical page and the page should not be operated.

Are there other circumstances, like memory allocated by "kmalloc" or "vmmaloc" are used for DMA and should be pinned.

0 Answers
Related