linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mm: Export PageHeadHuge()
@ 2021-08-20 16:14 David Howells
  2021-08-20 17:35 ` Christoph Hellwig
  0 siblings, 1 reply; 8+ messages in thread
From: David Howells @ 2021-08-20 16:14 UTC (permalink / raw)
  To: willy; +Cc: linux-mm, linux-fsdevel, linux-kernel

Export PageHeadHuge() - it's used by folio_test_hugetlb() and thence by
folio_file_page() and folio_contains().

Signed-off-by: David Howells <dhowells@redhat.com>
---

 mm/hugetlb.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/mm/hugetlb.c b/mm/hugetlb.c
index 68eead0259cc..ad6ef6d2c0bc 100644
--- a/mm/hugetlb.c
+++ b/mm/hugetlb.c
@@ -1717,6 +1717,7 @@ int PageHeadHuge(struct page *page_head)
 
 	return page_head[1].compound_dtor == HUGETLB_PAGE_DTOR;
 }
+EXPORT_SYMBOL(PageHeadHuge);
 
 /*
  * Find and lock address space (mapping) in write mode.



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

* Re: [PATCH] mm: Export PageHeadHuge()
  2021-08-20 16:14 [PATCH] mm: Export PageHeadHuge() David Howells
@ 2021-08-20 17:35 ` Christoph Hellwig
  0 siblings, 0 replies; 8+ messages in thread
From: Christoph Hellwig @ 2021-08-20 17:35 UTC (permalink / raw)
  To: David Howells; +Cc: willy, linux-mm, linux-fsdevel, linux-kernel

On Fri, Aug 20, 2021 at 05:14:47PM +0100, David Howells wrote:
> Export PageHeadHuge() - it's used by folio_test_hugetlb() and thence by
> folio_file_page() and folio_contains().

.. none of which are used in modular code in linux-next.

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

* Re: [PATCH] mm: Export PageHeadHuge()
  2022-02-28 13:22 David Howells
@ 2022-02-28 13:41 ` Christoph Hellwig
  0 siblings, 0 replies; 8+ messages in thread
From: Christoph Hellwig @ 2022-02-28 13:41 UTC (permalink / raw)
  To: David Howells; +Cc: torvalds, akpm, willy, kirill, linux-mm, linux-kernel

On Mon, Feb 28, 2022 at 01:22:56PM +0000, David Howells wrote:
>     
> Export PageHeadHuge() - it's used by folio_test_hugetlb() and thence by
> such as folio_file_page() and folio_contains().  Matthew suggested I use
> the first of those instead of doing the same calculation manually - but
> I can't call it from a module.
> 
> Kirill suggested rearranging things to put it in a header, but that
> introduces header dependencies because of where constants are defined.
> 
> Signed-off-by: David Howells <dhowells@redhat.com>
> cc: willy@infradead.org
> Link: https://lore.kernel.org/r/163707085314.3221130.14783857863702203440.stgit@warthog.procyon.org.uk/
> 
> ---
>  mm/hugetlb.c |    1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/mm/hugetlb.c b/mm/hugetlb.c
> index 61895cc01d09..5768df43b05c 100644
> --- a/mm/hugetlb.c
> +++ b/mm/hugetlb.c
> @@ -1854,6 +1854,7 @@ int PageHeadHuge(struct page *page_head)
>  
>  	return page_head[1].compound_dtor == HUGETLB_PAGE_DTOR;
>  }
> +EXPORT_SYMBOL(PageHeadHuge);

EXPORT_SYMBOL_GPL for anything hugepage related, please.

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

* [PATCH] mm: Export PageHeadHuge()
@ 2022-02-28 13:22 David Howells
  2022-02-28 13:41 ` Christoph Hellwig
  0 siblings, 1 reply; 8+ messages in thread
From: David Howells @ 2022-02-28 13:22 UTC (permalink / raw)
  To: torvalds, akpm; +Cc: dhowells, willy, kirill, linux-mm, linux-kernel

    
Export PageHeadHuge() - it's used by folio_test_hugetlb() and thence by
such as folio_file_page() and folio_contains().  Matthew suggested I use
the first of those instead of doing the same calculation manually - but
I can't call it from a module.

Kirill suggested rearranging things to put it in a header, but that
introduces header dependencies because of where constants are defined.

Signed-off-by: David Howells <dhowells@redhat.com>
cc: willy@infradead.org
Link: https://lore.kernel.org/r/163707085314.3221130.14783857863702203440.stgit@warthog.procyon.org.uk/

---
 mm/hugetlb.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/mm/hugetlb.c b/mm/hugetlb.c
index 61895cc01d09..5768df43b05c 100644
--- a/mm/hugetlb.c
+++ b/mm/hugetlb.c
@@ -1854,6 +1854,7 @@ int PageHeadHuge(struct page *page_head)
 
 	return page_head[1].compound_dtor == HUGETLB_PAGE_DTOR;
 }
+EXPORT_SYMBOL(PageHeadHuge);
 
 /*
  * Find and lock address space (mapping) in write mode.


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

* Re: [PATCH] mm: Export PageHeadHuge()
  2021-11-17 13:20   ` Matthew Wilcox
@ 2021-11-17 14:01     ` Kirill A. Shutemov
  0 siblings, 0 replies; 8+ messages in thread
From: Kirill A. Shutemov @ 2021-11-17 14:01 UTC (permalink / raw)
  To: Matthew Wilcox; +Cc: David Howells, linux-mm, torvalds, linux-kernel

On Wed, Nov 17, 2021 at 01:20:02PM +0000, Matthew Wilcox wrote:
> On Wed, Nov 17, 2021 at 11:36:23AM +0300, Kirill A. Shutemov wrote:
> > On Tue, Nov 16, 2021 at 01:54:13PM +0000, David Howells wrote:
> > > Export PageHeadHuge() - it's used by folio_test_hugetlb() and thence by
> > > folio_file_page() and folio_contains().
> > 
> > Maybe move it to page-flag.h instead? It is trivial enough.
> 
> HUGETLB_PAGE_DTOR is defined in mm.h so there's a bit of a dependency
> problem there.

Move enum compound_dtor_id to mm_types.h?

-- 
 Kirill A. Shutemov

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

* Re: [PATCH] mm: Export PageHeadHuge()
  2021-11-17  8:36 ` Kirill A. Shutemov
@ 2021-11-17 13:20   ` Matthew Wilcox
  2021-11-17 14:01     ` Kirill A. Shutemov
  0 siblings, 1 reply; 8+ messages in thread
From: Matthew Wilcox @ 2021-11-17 13:20 UTC (permalink / raw)
  To: Kirill A. Shutemov; +Cc: David Howells, linux-mm, torvalds, linux-kernel

On Wed, Nov 17, 2021 at 11:36:23AM +0300, Kirill A. Shutemov wrote:
> On Tue, Nov 16, 2021 at 01:54:13PM +0000, David Howells wrote:
> > Export PageHeadHuge() - it's used by folio_test_hugetlb() and thence by
> > folio_file_page() and folio_contains().
> 
> Maybe move it to page-flag.h instead? It is trivial enough.

HUGETLB_PAGE_DTOR is defined in mm.h so there's a bit of a dependency
problem there.

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

* Re: [PATCH] mm: Export PageHeadHuge()
  2021-11-16 13:54 David Howells
@ 2021-11-17  8:36 ` Kirill A. Shutemov
  2021-11-17 13:20   ` Matthew Wilcox
  0 siblings, 1 reply; 8+ messages in thread
From: Kirill A. Shutemov @ 2021-11-17  8:36 UTC (permalink / raw)
  To: David Howells; +Cc: willy, linux-mm, torvalds, linux-kernel

On Tue, Nov 16, 2021 at 01:54:13PM +0000, David Howells wrote:
> Export PageHeadHuge() - it's used by folio_test_hugetlb() and thence by
> folio_file_page() and folio_contains().

Maybe move it to page-flag.h instead? It is trivial enough.

-- 
 Kirill A. Shutemov

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

* [PATCH] mm: Export PageHeadHuge()
@ 2021-11-16 13:54 David Howells
  2021-11-17  8:36 ` Kirill A. Shutemov
  0 siblings, 1 reply; 8+ messages in thread
From: David Howells @ 2021-11-16 13:54 UTC (permalink / raw)
  To: willy; +Cc: linux-mm, torvalds, dhowells, linux-kernel

Export PageHeadHuge() - it's used by folio_test_hugetlb() and thence by
folio_file_page() and folio_contains().

Signed-off-by: David Howells <dhowells@redhat.com>
cc: linux-mm@kvack.org
---

 mm/hugetlb.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/mm/hugetlb.c b/mm/hugetlb.c
index e09159c957e3..16f2e5d5f1a9 100644
--- a/mm/hugetlb.c
+++ b/mm/hugetlb.c
@@ -1852,6 +1852,7 @@ int PageHeadHuge(struct page *page_head)
 
 	return page_head[1].compound_dtor == HUGETLB_PAGE_DTOR;
 }
+EXPORT_SYMBOL(PageHeadHuge);
 
 /*
  * Find and lock address space (mapping) in write mode.



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

end of thread, other threads:[~2022-02-28 13:41 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-20 16:14 [PATCH] mm: Export PageHeadHuge() David Howells
2021-08-20 17:35 ` Christoph Hellwig
2021-11-16 13:54 David Howells
2021-11-17  8:36 ` Kirill A. Shutemov
2021-11-17 13:20   ` Matthew Wilcox
2021-11-17 14:01     ` Kirill A. Shutemov
2022-02-28 13:22 David Howells
2022-02-28 13:41 ` Christoph Hellwig

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