linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mm/page_table_check: Drop all redundant EXPORT_SYMBOL()
@ 2022-04-20  6:02 Anshuman Khandual
  2022-04-20 16:54 ` Pasha Tatashin
  0 siblings, 1 reply; 5+ messages in thread
From: Anshuman Khandual @ 2022-04-20  6:02 UTC (permalink / raw)
  To: linux-mm; +Cc: Anshuman Khandual, Pasha Tatashin, Andrew Morton, linux-kernel

Function definitions need not be exported via EXPORT_SYMBOL() mechanism. In
this case these functions just get called only inside their wrappers. Even
__page_table_check_zero() gets called without such an export. Just drop all
these redundant EXPORT_SYMBOL().

Cc: Pasha Tatashin <pasha.tatashin@soleen.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: linux-mm@kvack.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Anshuman Khandual <anshuman.khandual@arm.com>
---
This applies on v5.18-rc3

 mm/page_table_check.c | 6 ------
 1 file changed, 6 deletions(-)

diff --git a/mm/page_table_check.c b/mm/page_table_check.c
index 2458281bff89..5c2a96159832 100644
--- a/mm/page_table_check.c
+++ b/mm/page_table_check.c
@@ -167,7 +167,6 @@ void __page_table_check_pte_clear(struct mm_struct *mm, unsigned long addr,
 				       PAGE_SIZE >> PAGE_SHIFT);
 	}
 }
-EXPORT_SYMBOL(__page_table_check_pte_clear);
 
 void __page_table_check_pmd_clear(struct mm_struct *mm, unsigned long addr,
 				  pmd_t pmd)
@@ -180,7 +179,6 @@ void __page_table_check_pmd_clear(struct mm_struct *mm, unsigned long addr,
 				       PMD_PAGE_SIZE >> PAGE_SHIFT);
 	}
 }
-EXPORT_SYMBOL(__page_table_check_pmd_clear);
 
 void __page_table_check_pud_clear(struct mm_struct *mm, unsigned long addr,
 				  pud_t pud)
@@ -193,7 +191,6 @@ void __page_table_check_pud_clear(struct mm_struct *mm, unsigned long addr,
 				       PUD_PAGE_SIZE >> PAGE_SHIFT);
 	}
 }
-EXPORT_SYMBOL(__page_table_check_pud_clear);
 
 void __page_table_check_pte_set(struct mm_struct *mm, unsigned long addr,
 				pte_t *ptep, pte_t pte)
@@ -208,7 +205,6 @@ void __page_table_check_pte_set(struct mm_struct *mm, unsigned long addr,
 				     pte_write(pte));
 	}
 }
-EXPORT_SYMBOL(__page_table_check_pte_set);
 
 void __page_table_check_pmd_set(struct mm_struct *mm, unsigned long addr,
 				pmd_t *pmdp, pmd_t pmd)
@@ -223,7 +219,6 @@ void __page_table_check_pmd_set(struct mm_struct *mm, unsigned long addr,
 				     pmd_write(pmd));
 	}
 }
-EXPORT_SYMBOL(__page_table_check_pmd_set);
 
 void __page_table_check_pud_set(struct mm_struct *mm, unsigned long addr,
 				pud_t *pudp, pud_t pud)
@@ -238,7 +233,6 @@ void __page_table_check_pud_set(struct mm_struct *mm, unsigned long addr,
 				     pud_write(pud));
 	}
 }
-EXPORT_SYMBOL(__page_table_check_pud_set);
 
 void __page_table_check_pte_clear_range(struct mm_struct *mm,
 					unsigned long addr,
-- 
2.20.1


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

* Re: [PATCH] mm/page_table_check: Drop all redundant EXPORT_SYMBOL()
  2022-04-20  6:02 [PATCH] mm/page_table_check: Drop all redundant EXPORT_SYMBOL() Anshuman Khandual
@ 2022-04-20 16:54 ` Pasha Tatashin
  2022-04-21  3:23   ` Matthew Wilcox
  0 siblings, 1 reply; 5+ messages in thread
From: Pasha Tatashin @ 2022-04-20 16:54 UTC (permalink / raw)
  To: Anshuman Khandual; +Cc: linux-mm, Andrew Morton, LKML

On Wed, Apr 20, 2022 at 2:01 AM Anshuman Khandual
<anshuman.khandual@arm.com> wrote:
>
> Function definitions need not be exported via EXPORT_SYMBOL() mechanism. In
> this case these functions just get called only inside their wrappers. Even
> __page_table_check_zero() gets called without such an export. Just drop all
> these redundant EXPORT_SYMBOL().
>
> Cc: Pasha Tatashin <pasha.tatashin@soleen.com>
> Cc: Andrew Morton <akpm@linux-foundation.org>
> Cc: linux-mm@kvack.org
> Cc: linux-kernel@vger.kernel.org
> Signed-off-by: Anshuman Khandual <anshuman.khandual@arm.com>
> ---
> This applies on v5.18-rc3
>
>  mm/page_table_check.c | 6 ------
>  1 file changed, 6 deletions(-)
>
> diff --git a/mm/page_table_check.c b/mm/page_table_check.c
> index 2458281bff89..5c2a96159832 100644
> --- a/mm/page_table_check.c
> +++ b/mm/page_table_check.c
> @@ -167,7 +167,6 @@ void __page_table_check_pte_clear(struct mm_struct *mm, unsigned long addr,
>                                        PAGE_SIZE >> PAGE_SHIFT);
>         }
>  }
> -EXPORT_SYMBOL(__page_table_check_pte_clear);
>
>  void __page_table_check_pmd_clear(struct mm_struct *mm, unsigned long addr,
>                                   pmd_t pmd)
> @@ -180,7 +179,6 @@ void __page_table_check_pmd_clear(struct mm_struct *mm, unsigned long addr,
>                                        PMD_PAGE_SIZE >> PAGE_SHIFT);
>         }
>  }
> -EXPORT_SYMBOL(__page_table_check_pmd_clear);
>
>  void __page_table_check_pud_clear(struct mm_struct *mm, unsigned long addr,
>                                   pud_t pud)
> @@ -193,7 +191,6 @@ void __page_table_check_pud_clear(struct mm_struct *mm, unsigned long addr,
>                                        PUD_PAGE_SIZE >> PAGE_SHIFT);
>         }
>  }
> -EXPORT_SYMBOL(__page_table_check_pud_clear);
>
>  void __page_table_check_pte_set(struct mm_struct *mm, unsigned long addr,
>                                 pte_t *ptep, pte_t pte)
> @@ -208,7 +205,6 @@ void __page_table_check_pte_set(struct mm_struct *mm, unsigned long addr,
>                                      pte_write(pte));
>         }
>  }
> -EXPORT_SYMBOL(__page_table_check_pte_set);

Hi Anshuman,

See this:
https://lore.kernel.org/all/20211124234754.l5co34dUK%25akpm@linux-foundation.org/

The rest of EXPORTs were added to be symmetric, and allow other
drivers to use set_*p**()/clear_p** calls.

Pasha

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

* Re: [PATCH] mm/page_table_check: Drop all redundant EXPORT_SYMBOL()
  2022-04-20 16:54 ` Pasha Tatashin
@ 2022-04-21  3:23   ` Matthew Wilcox
  2022-04-21  3:32     ` Pasha Tatashin
  0 siblings, 1 reply; 5+ messages in thread
From: Matthew Wilcox @ 2022-04-21  3:23 UTC (permalink / raw)
  To: Pasha Tatashin; +Cc: Anshuman Khandual, linux-mm, Andrew Morton, LKML

On Wed, Apr 20, 2022 at 12:54:08PM -0400, Pasha Tatashin wrote:
> The rest of EXPORTs were added to be symmetric, and allow other
> drivers to use set_*p**()/clear_p** calls.

EXPORT_SYMBOLs actually have a real cost.  We don't add them "for
symmetry".

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

* Re: [PATCH] mm/page_table_check: Drop all redundant EXPORT_SYMBOL()
  2022-04-21  3:23   ` Matthew Wilcox
@ 2022-04-21  3:32     ` Pasha Tatashin
  2022-04-21  3:47       ` Anshuman Khandual
  0 siblings, 1 reply; 5+ messages in thread
From: Pasha Tatashin @ 2022-04-21  3:32 UTC (permalink / raw)
  To: Matthew Wilcox; +Cc: Anshuman Khandual, linux-mm, Andrew Morton, LKML

On Wed, Apr 20, 2022 at 11:23 PM Matthew Wilcox <willy@infradead.org> wrote:
>
> On Wed, Apr 20, 2022 at 12:54:08PM -0400, Pasha Tatashin wrote:
> > The rest of EXPORTs were added to be symmetric, and allow other
> > drivers to use set_*p**()/clear_p** calls.
>
> EXPORT_SYMBOLs actually have a real cost.  We don't add them "for
> symmetry".

Sure, the rest of exports can be removed, but:

> -EXPORT_SYMBOL(__page_table_check_pte_set);

must stay because of

ERROR: modpost: "__page_table_check_pte_set"
[drivers/gpu/drm/i915/i915.ko] undefined!

Pasha

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

* Re: [PATCH] mm/page_table_check: Drop all redundant EXPORT_SYMBOL()
  2022-04-21  3:32     ` Pasha Tatashin
@ 2022-04-21  3:47       ` Anshuman Khandual
  0 siblings, 0 replies; 5+ messages in thread
From: Anshuman Khandual @ 2022-04-21  3:47 UTC (permalink / raw)
  To: Pasha Tatashin, Matthew Wilcox; +Cc: linux-mm, Andrew Morton, LKML



On 4/21/22 09:02, Pasha Tatashin wrote:
> On Wed, Apr 20, 2022 at 11:23 PM Matthew Wilcox <willy@infradead.org> wrote:
>>
>> On Wed, Apr 20, 2022 at 12:54:08PM -0400, Pasha Tatashin wrote:
>>> The rest of EXPORTs were added to be symmetric, and allow other
>>> drivers to use set_*p**()/clear_p** calls.
>>
>> EXPORT_SYMBOLs actually have a real cost.  We don't add them "for
>> symmetry".
> 
> Sure, the rest of exports can be removed, but:
> 
>> -EXPORT_SYMBOL(__page_table_check_pte_set);
> 
> must stay because of
> 
> ERROR: modpost: "__page_table_check_pte_set"
> [drivers/gpu/drm/i915/i915.ko] undefined!

Sure, will resend.

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

end of thread, other threads:[~2022-04-21  3:47 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-20  6:02 [PATCH] mm/page_table_check: Drop all redundant EXPORT_SYMBOL() Anshuman Khandual
2022-04-20 16:54 ` Pasha Tatashin
2022-04-21  3:23   ` Matthew Wilcox
2022-04-21  3:32     ` Pasha Tatashin
2022-04-21  3:47       ` Anshuman Khandual

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