linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* Infiniband use of get_user_pages()
@ 2013-04-24 15:38 Jan Kara
  2013-04-24 15:43 ` Christoph Lameter
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Jan Kara @ 2013-04-24 15:38 UTC (permalink / raw)
  To: Roland Dreier, linux-rdma, linux-mm

  Hello,

  when checking users of get_user_pages() (I'm doing some cleanups in that
area to fix filesystem's issues with mmap_sem locking) I've noticed that
infiniband drivers add number of pages obtained from get_user_pages() to
mm->pinned_vm counter. Although this makes some sence, it doesn't match
with any other user of get_user_pages() (e.g. direct IO) so has infiniband
some special reason why it does so?

  Also that seems to be the only real reason why mmap_sem has to be grabbed
in exclusive mode, am I right?

  Another suspicious thing (at least in drivers/infiniband/core/umem.c:
ib_umem_get()) is that arguments of get_user_pages() are like:
                ret = get_user_pages(current, current->mm, cur_base,
                                     min_t(unsigned long, npages,
                                           PAGE_SIZE / sizeof (struct page *)),
                                     1, !umem->writable, page_list, vma_list);
So we always have write argument set to 1 and force argument is set to
!umem->writable. Is that really intentional? My naive guess would be that
arguments should be switched... Although even in that case I fail to see
why 'force' argument should be set. Can someone please explain?

  Finally (and here I may show my ignorance ;), I'd like to ask whether
there's any reason why ib_umem_get() checks for is_vm_hugetlb_page() and
not just whether a page is a huge page?


								Honza
-- 
Jan Kara <jack@suse.cz>
SUSE Labs, CR

--
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>

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2013-04-29 18:44 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-04-24 15:38 Infiniband use of get_user_pages() Jan Kara
2013-04-24 15:43 ` Christoph Lameter
2013-04-24 22:25 ` Roland Dreier
2013-04-25 13:21   ` Jan Kara
2013-04-29 18:44     ` Roland Dreier
2013-04-26 17:19 ` KOSAKI Motohiro

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).