]> git.baikalelectronics.ru Git - kernel.git/commit
mm: introduce offset_in_thp
authorMatthew Wilcox (Oracle) <willy@infradead.org>
Sat, 15 Aug 2020 00:30:43 +0000 (17:30 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sat, 15 Aug 2020 02:56:56 +0000 (19:56 -0700)
commit1dcee7f5db0d58757aedafbb9962612490115f9b
tree1c6b77eeb0209995bf012dcbe90bcd1ef76a1fcc
parent2a54b37549aed02b39825c354bcc2a3d627079a7
mm: introduce offset_in_thp

Mirroring offset_in_page(), this gives you the offset within this
particular page, no matter what size page it is.  It optimises down to
offset_in_page() if CONFIG_TRANSPARENT_HUGEPAGE is not set.

Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Reviewed-by: David Hildenbrand <david@redhat.com>
Reviewed-by: William Kucharski <william.kucharski@oracle.com>
Reviewed-by: Zi Yan <ziy@nvidia.com>
Cc: Mike Kravetz <mike.kravetz@oracle.com>
Cc: "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>
Link: http://lkml.kernel.org/r/20200629151959.15779-8-willy@infradead.org
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
include/linux/mm.h