linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* Access to "vma_kernel_pagesize" from user-space
@ 2022-11-14 19:07 Gerd Rausch
  0 siblings, 0 replies; only message in thread
From: Gerd Rausch @ 2022-11-14 19:07 UTC (permalink / raw)
  To: linux-mm; +Cc: Aron Silverton, Chuck Lever III

Hi,

I'm hoping this is the right forum to ask the following question:

libibverbs uses "madvise(MADV_DONTFORK)" on memory that
was previously registered with "ib_reg_mr".

With hugetlb support (environment variable "RDMAV_HUGEPAGES_SAFE" set),
libibverbs parses "/proc/self/smaps" looking for the virtual-address in question
to determine the proper page-size,
ultimately calling "vma_kernel_pagesize" -> "hugetlb_vm_op_pagesize".

Obviously, parsing "/proc/self/smaps" is rather slow with large processes
that contain many VMAs.

Question is: How to make this faster?

One InfiniBand-specific way out is to create a sysfs entry,
e.g. "/sys/class/infiniband_verbs/vma_pagesize"
and provide an interface (e.g. ioctl) that gives libiverbs the same
information, just a tad faster than parsing "/proc/self/smaps".

But getting access to "vma_kernel_pagesize" is something that is hardly
InfiniBand specific, and perhaps there are other applications/libraries
out there (if not today, perhaps tomorrow) that would like to do the same.

A generic interface from user-space to "vma_kernel_pagesize"
(other than parsing /proc/self/smaps) could have potential benefit.

But which API exactly?

For that I'm seeking input from this forum.

Thanks,

   Gerd


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-11-14 19:07 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-14 19:07 Access to "vma_kernel_pagesize" from user-space Gerd Rausch

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox