diff mbox series

[01/10] mm: Remove PageActive

Message ID 20240821193445.2294269-2-willy@infradead.org (mailing list archive)
State New
Headers show
Series Simplify the page flags a little | expand

Commit Message

Matthew Wilcox Aug. 21, 2024, 7:34 p.m. UTC
This flag is now only used on folios, so we can remove all the page
accessors.

Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
---
 include/linux/page-flags.h | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

Comments

kernel test robot Aug. 22, 2024, 1:22 p.m. UTC | #1
Hi Matthew,

kernel test robot noticed the following build errors:

[auto build test ERROR on akpm-mm/mm-everything]
[also build test ERROR on arm64/for-next/core tip/x86/core tip/x86/mm linus/master v6.11-rc4 next-20240822]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Matthew-Wilcox-Oracle/mm-Remove-PageActive/20240822-033717
base:   https://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm.git mm-everything
patch link:    https://lore.kernel.org/r/20240821193445.2294269-2-willy%40infradead.org
patch subject: [PATCH 01/10] mm: Remove PageActive
config: powerpc-allmodconfig (https://download.01.org/0day-ci/archive/20240822/202408222044.zZMToCKk-lkp@intel.com/config)
compiler: powerpc64-linux-gcc (GCC) 14.1.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240822/202408222044.zZMToCKk-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202408222044.zZMToCKk-lkp@intel.com/

All errors (new ones prefixed by >>):

   arch/powerpc/mm/pgtable-frag.c: In function 'pte_free_defer':
>> arch/powerpc/mm/pgtable-frag.c:142:9: error: implicit declaration of function 'SetPageActive' [-Wimplicit-function-declaration]
     142 |         SetPageActive(page);
         |         ^~~~~~~~~~~~~


vim +/SetPageActive +142 arch/powerpc/mm/pgtable-frag.c

32cc0b7c9d508e Hugh Dickins 2023-07-11  135  
32cc0b7c9d508e Hugh Dickins 2023-07-11  136  #ifdef CONFIG_TRANSPARENT_HUGEPAGE
32cc0b7c9d508e Hugh Dickins 2023-07-11  137  void pte_free_defer(struct mm_struct *mm, pgtable_t pgtable)
32cc0b7c9d508e Hugh Dickins 2023-07-11  138  {
32cc0b7c9d508e Hugh Dickins 2023-07-11  139  	struct page *page;
32cc0b7c9d508e Hugh Dickins 2023-07-11  140  
32cc0b7c9d508e Hugh Dickins 2023-07-11  141  	page = virt_to_page(pgtable);
32cc0b7c9d508e Hugh Dickins 2023-07-11 @142  	SetPageActive(page);
kernel test robot Aug. 22, 2024, 3:47 p.m. UTC | #2
Hi Matthew,

kernel test robot noticed the following build errors:

[auto build test ERROR on akpm-mm/mm-everything]
[also build test ERROR on arm64/for-next/core tip/x86/core tip/x86/mm linus/master v6.11-rc4 next-20240822]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Matthew-Wilcox-Oracle/mm-Remove-PageActive/20240822-033717
base:   https://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm.git mm-everything
patch link:    https://lore.kernel.org/r/20240821193445.2294269-2-willy%40infradead.org
patch subject: [PATCH 01/10] mm: Remove PageActive
config: powerpc-allyesconfig (https://download.01.org/0day-ci/archive/20240822/202408222357.ksCAhSZQ-lkp@intel.com/config)
compiler: clang version 20.0.0git (https://github.com/llvm/llvm-project 26670e7fa4f032a019d23d56c6a02926e854e8af)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240822/202408222357.ksCAhSZQ-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202408222357.ksCAhSZQ-lkp@intel.com/

All errors (new ones prefixed by >>):

   In file included from arch/powerpc/mm/pgtable-frag.c:10:
   In file included from include/linux/mm.h:2199:
   include/linux/vmstat.h:504:43: warning: arithmetic between different enumeration types ('enum zone_stat_item' and 'enum numa_stat_item') [-Wenum-enum-conversion]
     504 |         return vmstat_text[NR_VM_ZONE_STAT_ITEMS +
         |                            ~~~~~~~~~~~~~~~~~~~~~ ^
     505 |                            item];
         |                            ~~~~
   include/linux/vmstat.h:511:43: warning: arithmetic between different enumeration types ('enum zone_stat_item' and 'enum numa_stat_item') [-Wenum-enum-conversion]
     511 |         return vmstat_text[NR_VM_ZONE_STAT_ITEMS +
         |                            ~~~~~~~~~~~~~~~~~~~~~ ^
     512 |                            NR_VM_NUMA_EVENT_ITEMS +
         |                            ~~~~~~~~~~~~~~~~~~~~~~
   include/linux/vmstat.h:518:36: warning: arithmetic between different enumeration types ('enum node_stat_item' and 'enum lru_list') [-Wenum-enum-conversion]
     518 |         return node_stat_name(NR_LRU_BASE + lru) + 3; // skip "nr_"
         |                               ~~~~~~~~~~~ ^ ~~~
   include/linux/vmstat.h:524:43: warning: arithmetic between different enumeration types ('enum zone_stat_item' and 'enum numa_stat_item') [-Wenum-enum-conversion]
     524 |         return vmstat_text[NR_VM_ZONE_STAT_ITEMS +
         |                            ~~~~~~~~~~~~~~~~~~~~~ ^
     525 |                            NR_VM_NUMA_EVENT_ITEMS +
         |                            ~~~~~~~~~~~~~~~~~~~~~~
>> arch/powerpc/mm/pgtable-frag.c:142:2: error: call to undeclared function 'SetPageActive'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
     142 |         SetPageActive(page);
         |         ^
   4 warnings and 1 error generated.


vim +/SetPageActive +142 arch/powerpc/mm/pgtable-frag.c

32cc0b7c9d508e Hugh Dickins 2023-07-11  135  
32cc0b7c9d508e Hugh Dickins 2023-07-11  136  #ifdef CONFIG_TRANSPARENT_HUGEPAGE
32cc0b7c9d508e Hugh Dickins 2023-07-11  137  void pte_free_defer(struct mm_struct *mm, pgtable_t pgtable)
32cc0b7c9d508e Hugh Dickins 2023-07-11  138  {
32cc0b7c9d508e Hugh Dickins 2023-07-11  139  	struct page *page;
32cc0b7c9d508e Hugh Dickins 2023-07-11  140  
32cc0b7c9d508e Hugh Dickins 2023-07-11  141  	page = virt_to_page(pgtable);
32cc0b7c9d508e Hugh Dickins 2023-07-11 @142  	SetPageActive(page);
Andrew Morton Aug. 22, 2024, 6:24 p.m. UTC | #3
On Thu, 22 Aug 2024 21:22:43 +0800 kernel test robot <lkp@intel.com> wrote:

>    arch/powerpc/mm/pgtable-frag.c: In function 'pte_free_defer':
> >> arch/powerpc/mm/pgtable-frag.c:142:9: error: implicit declaration of function 'SetPageActive' [-Wimplicit-function-declaration]
>      142 |         SetPageActive(page);
>          |         ^~~~~~~~~~~~~

this, I assume?

--- a/arch/powerpc/mm/pgtable-frag.c~mm-remove-pageactive-fix
+++ a/arch/powerpc/mm/pgtable-frag.c
@@ -136,10 +136,10 @@ void pte_fragment_free(unsigned long *ta
 #ifdef CONFIG_TRANSPARENT_HUGEPAGE
 void pte_free_defer(struct mm_struct *mm, pgtable_t pgtable)
 {
-	struct page *page;
+	struct folio *folio;
 
-	page = virt_to_page(pgtable);
-	SetPageActive(page);
+	folio = virt_to_folio(pgtable);
+	folio_set_active(folio);
 	pte_fragment_free((unsigned long *)pgtable, 0);
 }
 #endif /* CONFIG_TRANSPARENT_HUGEPAGE */
Matthew Wilcox Aug. 22, 2024, 6:34 p.m. UTC | #4
On Thu, Aug 22, 2024 at 11:24:24AM -0700, Andrew Morton wrote:
> On Thu, 22 Aug 2024 21:22:43 +0800 kernel test robot <lkp@intel.com> wrote:
> 
> >    arch/powerpc/mm/pgtable-frag.c: In function 'pte_free_defer':
> > >> arch/powerpc/mm/pgtable-frag.c:142:9: error: implicit declaration of function 'SetPageActive' [-Wimplicit-function-declaration]
> >      142 |         SetPageActive(page);
> >          |         ^~~~~~~~~~~~~
> 
> this, I assume?

It's a good quick fix.  I don't think this use of PG_active is
documented anywhere, so I'll send a patch to fix that too.

> --- a/arch/powerpc/mm/pgtable-frag.c~mm-remove-pageactive-fix
> +++ a/arch/powerpc/mm/pgtable-frag.c
> @@ -136,10 +136,10 @@ void pte_fragment_free(unsigned long *ta
>  #ifdef CONFIG_TRANSPARENT_HUGEPAGE
>  void pte_free_defer(struct mm_struct *mm, pgtable_t pgtable)
>  {
> -	struct page *page;
> +	struct folio *folio;
>  
> -	page = virt_to_page(pgtable);
> -	SetPageActive(page);
> +	folio = virt_to_folio(pgtable);
> +	folio_set_active(folio);
>  	pte_fragment_free((unsigned long *)pgtable, 0);
>  }
>  #endif /* CONFIG_TRANSPARENT_HUGEPAGE */
> _
>
diff mbox series

Patch

diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h
index 0c738bda5d98..65171b8fd661 100644
--- a/include/linux/page-flags.h
+++ b/include/linux/page-flags.h
@@ -510,8 +510,9 @@  PAGEFLAG(Dirty, dirty, PF_HEAD) TESTSCFLAG(Dirty, dirty, PF_HEAD)
 	__CLEARPAGEFLAG(Dirty, dirty, PF_HEAD)
 PAGEFLAG(LRU, lru, PF_HEAD) __CLEARPAGEFLAG(LRU, lru, PF_HEAD)
 	TESTCLEARFLAG(LRU, lru, PF_HEAD)
-PAGEFLAG(Active, active, PF_HEAD) __CLEARPAGEFLAG(Active, active, PF_HEAD)
-	TESTCLEARFLAG(Active, active, PF_HEAD)
+FOLIO_FLAG(active, FOLIO_HEAD_PAGE)
+	__FOLIO_CLEAR_FLAG(active, FOLIO_HEAD_PAGE)
+	FOLIO_TEST_CLEAR_FLAG(active, FOLIO_HEAD_PAGE)
 PAGEFLAG(Workingset, workingset, PF_HEAD)
 	TESTCLEARFLAG(Workingset, workingset, PF_HEAD)
 PAGEFLAG(Checked, checked, PF_NO_COMPOUND)	   /* Used by some filesystems */