All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3] hugetlb: Use a folio in free_hpage_workfn()
@ 2023-08-22 16:28 Matthew Wilcox (Oracle)
  2023-08-22 16:28 ` [PATCH 2/3] hugetlb: Remove a few calls to page_folio() Matthew Wilcox (Oracle)
                   ` (3 more replies)
  0 siblings, 4 replies; 14+ messages in thread
From: Matthew Wilcox (Oracle) @ 2023-08-22 16:28 UTC (permalink / raw)
  To: Mike Kravetz
  Cc: Matthew Wilcox (Oracle), Muchun Song, linux-mm, Sidhartha Kumar

update_and_free_hugetlb_folio puts the memory on hpage_freelist as a folio
so we can take it off the list as a folio.

Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Cc: Sidhartha Kumar <sidhartha.kumar@oracle.com>
---
 mm/hugetlb.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/mm/hugetlb.c b/mm/hugetlb.c
index a82c3104337e..d1c856628bac 100644
--- a/mm/hugetlb.c
+++ b/mm/hugetlb.c
@@ -1786,22 +1786,22 @@ static void free_hpage_workfn(struct work_struct *work)
 	node = llist_del_all(&hpage_freelist);
 
 	while (node) {
-		struct page *page;
+		struct folio *folio;
 		struct hstate *h;
 
-		page = container_of((struct address_space **)node,
-				     struct page, mapping);
+		folio = container_of((struct address_space **)node,
+				     struct folio, mapping);
 		node = node->next;
-		page->mapping = NULL;
+		folio->mapping = NULL;
 		/*
 		 * The VM_BUG_ON_FOLIO(!folio_test_hugetlb(folio), folio) in
 		 * folio_hstate() is going to trigger because a previous call to
 		 * remove_hugetlb_folio() will clear the hugetlb bit, so do
 		 * not use folio_hstate() directly.
 		 */
-		h = size_to_hstate(page_size(page));
+		h = size_to_hstate(folio_size(folio));
 
-		__update_and_free_hugetlb_folio(h, page_folio(page));
+		__update_and_free_hugetlb_folio(h, folio);
 
 		cond_resched();
 	}
-- 
2.40.1



^ permalink raw reply related	[flat|nested] 14+ messages in thread
* Re: [PATCH 2/3] hugetlb: Remove a few calls to page_folio()
@ 2023-08-27 20:36 kernel test robot
  0 siblings, 0 replies; 14+ messages in thread
From: kernel test robot @ 2023-08-27 20:36 UTC (permalink / raw)
  To: oe-kbuild; +Cc: lkp, Dan Carpenter

BCC: lkp@intel.com
CC: oe-kbuild-all@lists.linux.dev
In-Reply-To: <20230822162808.4131399-2-willy@infradead.org>
References: <20230822162808.4131399-2-willy@infradead.org>
TO: "Matthew Wilcox (Oracle)" <willy@infradead.org>
TO: Mike Kravetz <mike.kravetz@oracle.com>
CC: "Matthew Wilcox (Oracle)" <willy@infradead.org>
CC: Muchun Song <muchun.song@linux.dev>
CC: linux-mm@kvack.org
CC: Sidhartha Kumar <sidhartha.kumar@oracle.com>

Hi Matthew,

kernel test robot noticed the following build warnings:

[auto build test WARNING on akpm-mm/mm-everything]
[also build test WARNING on linus/master v6.5-rc7 next-20230825]
[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/hugetlb-Remove-a-few-calls-to-page_folio/20230823-002932
base:   https://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm.git mm-everything
patch link:    https://lore.kernel.org/r/20230822162808.4131399-2-willy%40infradead.org
patch subject: [PATCH 2/3] hugetlb: Remove a few calls to page_folio()
:::::: branch date: 5 days ago
:::::: commit date: 5 days ago
config: x86_64-randconfig-161-20230827 (https://download.01.org/0day-ci/archive/20230828/202308280414.vR49R4gm-lkp@intel.com/config)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
reproduce: (https://download.01.org/0day-ci/archive/20230828/202308280414.vR49R4gm-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>
| Reported-by: Dan Carpenter <error27@gmail.com>
| Closes: https://lore.kernel.org/r/202308280414.vR49R4gm-lkp@intel.com/

smatch warnings:
mm/hugetlb.c:2246 remove_pool_huge_page() error: uninitialized symbol 'folio'.

vim +/folio +2246 mm/hugetlb.c

b2261026825ed34 Joonsoo Kim             2013-09-11  2216  
e8c5c8249878fb6 Lee Schermerhorn        2009-09-21  2217  /*
10c6ec49802b177 Mike Kravetz            2021-05-04  2218   * Remove huge page from pool from next node to free.  Attempt to keep
10c6ec49802b177 Mike Kravetz            2021-05-04  2219   * persistent huge pages more or less balanced over allowed nodes.
10c6ec49802b177 Mike Kravetz            2021-05-04  2220   * This routine only 'removes' the hugetlb page.  The caller must make
10c6ec49802b177 Mike Kravetz            2021-05-04  2221   * an additional call to free the page to low level allocators.
e8c5c8249878fb6 Lee Schermerhorn        2009-09-21  2222   * Called with hugetlb_lock locked.
e8c5c8249878fb6 Lee Schermerhorn        2009-09-21  2223   */
10c6ec49802b177 Mike Kravetz            2021-05-04  2224  static struct page *remove_pool_huge_page(struct hstate *h,
10c6ec49802b177 Mike Kravetz            2021-05-04  2225  						nodemask_t *nodes_allowed,
6ae11b278bca1cd Lee Schermerhorn        2009-12-14  2226  						 bool acct_surplus)
e8c5c8249878fb6 Lee Schermerhorn        2009-09-21  2227  {
b2261026825ed34 Joonsoo Kim             2013-09-11  2228  	int nr_nodes, node;
cfd5082b514765f Sidhartha Kumar         2022-11-29  2229  	struct folio *folio;
e8c5c8249878fb6 Lee Schermerhorn        2009-09-21  2230  
9487ca60fd7fa2c Mike Kravetz            2021-05-04  2231  	lockdep_assert_held(&hugetlb_lock);
b2261026825ed34 Joonsoo Kim             2013-09-11  2232  	for_each_node_mask_to_free(h, nr_nodes, node, nodes_allowed) {
685f345708096ed Lee Schermerhorn        2009-09-21  2233  		/*
685f345708096ed Lee Schermerhorn        2009-09-21  2234  		 * If we're returning unused surplus pages, only examine
685f345708096ed Lee Schermerhorn        2009-09-21  2235  		 * nodes with surplus pages.
685f345708096ed Lee Schermerhorn        2009-09-21  2236  		 */
b2261026825ed34 Joonsoo Kim             2013-09-11  2237  		if ((!acct_surplus || h->surplus_huge_pages_node[node]) &&
b2261026825ed34 Joonsoo Kim             2013-09-11  2238  		    !list_empty(&h->hugepage_freelists[node])) {
e601ce76a2aabd2 Matthew Wilcox (Oracle  2023-08-22  2239) 			folio = list_entry(h->hugepage_freelists[node].next,
e601ce76a2aabd2 Matthew Wilcox (Oracle  2023-08-22  2240) 					  struct folio, lru);
cfd5082b514765f Sidhartha Kumar         2022-11-29  2241  			remove_hugetlb_folio(h, folio, acct_surplus);
9a76db099709388 Lee Schermerhorn        2009-12-14  2242  			break;
e8c5c8249878fb6 Lee Schermerhorn        2009-09-21  2243  		}
b2261026825ed34 Joonsoo Kim             2013-09-11  2244  	}
e8c5c8249878fb6 Lee Schermerhorn        2009-09-21  2245  
e601ce76a2aabd2 Matthew Wilcox (Oracle  2023-08-22 @2246) 	return &folio->page;
e8c5c8249878fb6 Lee Schermerhorn        2009-09-21  2247  }
e8c5c8249878fb6 Lee Schermerhorn        2009-09-21  2248  

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

^ permalink raw reply	[flat|nested] 14+ messages in thread
* Re: [PATCH 2/3] hugetlb: Remove a few calls to page_folio()
@ 2023-10-13  2:53 kernel test robot
  0 siblings, 0 replies; 14+ messages in thread
From: kernel test robot @ 2023-10-13  2:53 UTC (permalink / raw)
  To: oe-kbuild; +Cc: lkp, Dan Carpenter

BCC: lkp@intel.com
CC: oe-kbuild-all@lists.linux.dev
In-Reply-To: <20230822162808.4131399-2-willy@infradead.org>
References: <20230822162808.4131399-2-willy@infradead.org>
TO: "Matthew Wilcox (Oracle)" <willy@infradead.org>
TO: Mike Kravetz <mike.kravetz@oracle.com>
CC: "Matthew Wilcox (Oracle)" <willy@infradead.org>
CC: Muchun Song <muchun.song@linux.dev>
CC: linux-mm@kvack.org
CC: Sidhartha Kumar <sidhartha.kumar@oracle.com>

Hi Matthew,

kernel test robot noticed the following build warnings:

[auto build test WARNING on akpm-mm/mm-everything]
[also build test WARNING on linus/master v6.6-rc5]
[cannot apply to next-20231012]
[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/hugetlb-Remove-a-few-calls-to-page_folio/20230823-002932
base:   https://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm.git mm-everything
patch link:    https://lore.kernel.org/r/20230822162808.4131399-2-willy%40infradead.org
patch subject: [PATCH 2/3] hugetlb: Remove a few calls to page_folio()
:::::: branch date: 7 weeks ago
:::::: commit date: 7 weeks ago
config: x86_64-randconfig-161-20230827 (https://download.01.org/0day-ci/archive/20231013/202310131039.ZgssYfIB-lkp@intel.com/config)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
reproduce: (https://download.01.org/0day-ci/archive/20231013/202310131039.ZgssYfIB-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>
| Reported-by: Dan Carpenter <error27@gmail.com>
| Closes: https://lore.kernel.org/r/202310131039.ZgssYfIB-lkp@intel.com/

smatch warnings:
mm/hugetlb.c:2246 remove_pool_huge_page() error: uninitialized symbol 'folio'.

vim +/folio +2246 mm/hugetlb.c

b2261026825ed3 Joonsoo Kim             2013-09-11  2216  
e8c5c8249878fb Lee Schermerhorn        2009-09-21  2217  /*
10c6ec49802b17 Mike Kravetz            2021-05-04  2218   * Remove huge page from pool from next node to free.  Attempt to keep
10c6ec49802b17 Mike Kravetz            2021-05-04  2219   * persistent huge pages more or less balanced over allowed nodes.
10c6ec49802b17 Mike Kravetz            2021-05-04  2220   * This routine only 'removes' the hugetlb page.  The caller must make
10c6ec49802b17 Mike Kravetz            2021-05-04  2221   * an additional call to free the page to low level allocators.
e8c5c8249878fb Lee Schermerhorn        2009-09-21  2222   * Called with hugetlb_lock locked.
e8c5c8249878fb Lee Schermerhorn        2009-09-21  2223   */
10c6ec49802b17 Mike Kravetz            2021-05-04  2224  static struct page *remove_pool_huge_page(struct hstate *h,
10c6ec49802b17 Mike Kravetz            2021-05-04  2225  						nodemask_t *nodes_allowed,
6ae11b278bca1c Lee Schermerhorn        2009-12-14  2226  						 bool acct_surplus)
e8c5c8249878fb Lee Schermerhorn        2009-09-21  2227  {
b2261026825ed3 Joonsoo Kim             2013-09-11  2228  	int nr_nodes, node;
cfd5082b514765 Sidhartha Kumar         2022-11-29  2229  	struct folio *folio;
e8c5c8249878fb Lee Schermerhorn        2009-09-21  2230  
9487ca60fd7fa2 Mike Kravetz            2021-05-04  2231  	lockdep_assert_held(&hugetlb_lock);
b2261026825ed3 Joonsoo Kim             2013-09-11  2232  	for_each_node_mask_to_free(h, nr_nodes, node, nodes_allowed) {
685f345708096e Lee Schermerhorn        2009-09-21  2233  		/*
685f345708096e Lee Schermerhorn        2009-09-21  2234  		 * If we're returning unused surplus pages, only examine
685f345708096e Lee Schermerhorn        2009-09-21  2235  		 * nodes with surplus pages.
685f345708096e Lee Schermerhorn        2009-09-21  2236  		 */
b2261026825ed3 Joonsoo Kim             2013-09-11  2237  		if ((!acct_surplus || h->surplus_huge_pages_node[node]) &&
b2261026825ed3 Joonsoo Kim             2013-09-11  2238  		    !list_empty(&h->hugepage_freelists[node])) {
e601ce76a2aabd Matthew Wilcox (Oracle  2023-08-22  2239) 			folio = list_entry(h->hugepage_freelists[node].next,
e601ce76a2aabd Matthew Wilcox (Oracle  2023-08-22  2240) 					  struct folio, lru);
cfd5082b514765 Sidhartha Kumar         2022-11-29  2241  			remove_hugetlb_folio(h, folio, acct_surplus);
9a76db09970938 Lee Schermerhorn        2009-12-14  2242  			break;
e8c5c8249878fb Lee Schermerhorn        2009-09-21  2243  		}
b2261026825ed3 Joonsoo Kim             2013-09-11  2244  	}
e8c5c8249878fb Lee Schermerhorn        2009-09-21  2245  
e601ce76a2aabd Matthew Wilcox (Oracle  2023-08-22 @2246) 	return &folio->page;
e8c5c8249878fb Lee Schermerhorn        2009-09-21  2247  }
e8c5c8249878fb Lee Schermerhorn        2009-09-21  2248  

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

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

end of thread, other threads:[~2023-10-13  9:06 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-08-22 16:28 [PATCH 1/3] hugetlb: Use a folio in free_hpage_workfn() Matthew Wilcox (Oracle)
2023-08-22 16:28 ` [PATCH 2/3] hugetlb: Remove a few calls to page_folio() Matthew Wilcox (Oracle)
2023-08-23 22:41   ` Mike Kravetz
2023-08-24  2:59   ` Muchun Song
2023-08-24 13:59   ` kernel test robot
2023-10-13  9:06   ` Dan Carpenter
2023-08-22 16:28 ` [PATCH 3/3] hugetlb: Convert remove_pool_huge_page() to return a folio Matthew Wilcox (Oracle)
2023-08-23 22:48   ` Mike Kravetz
2023-08-24  1:10     ` Matthew Wilcox
2023-08-24  2:38       ` Muchun Song
2023-08-23 22:37 ` [PATCH 1/3] hugetlb: Use a folio in free_hpage_workfn() Mike Kravetz
2023-08-24  2:58 ` Muchun Song
  -- strict thread matches above, loose matches on Subject: below --
2023-08-27 20:36 [PATCH 2/3] hugetlb: Remove a few calls to page_folio() kernel test robot
2023-10-13  2:53 kernel test robot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.