[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <f82d7209-73b0-aee0-8098-dbb793ea8a97@redhat.com>
Date: Fri, 15 May 2020 15:39:42 +0200
From: David Hildenbrand <david@...hat.com>
To: Matthew Wilcox <willy@...radead.org>, linux-fsdevel@...r.kernel.org
Cc: linux-mm@...ck.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v4 06/36] mm: Introduce offset_in_thp
On 15.05.20 15:16, Matthew Wilcox wrote:
> From: "Matthew Wilcox (Oracle)" <willy@...radead.org>
>
> 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@...radead.org>
> ---
> include/linux/mm.h | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/include/linux/mm.h b/include/linux/mm.h
> index 088acbda722d..9a55dce6a535 100644
> --- a/include/linux/mm.h
> +++ b/include/linux/mm.h
> @@ -1577,6 +1577,7 @@ static inline void clear_page_pfmemalloc(struct page *page)
> extern void pagefault_out_of_memory(void);
>
> #define offset_in_page(p) ((unsigned long)(p) & ~PAGE_MASK)
> +#define offset_in_thp(page, p) ((unsigned long)(p) & (thp_size(page) - 1))
>
> /*
> * Flags passed to show_mem() and show_free_areas() to suppress output in
>
Reviewed-by: David Hildenbrand <david@...hat.com>
--
Thanks,
David / dhildenb
Powered by blists - more mailing lists