LKML Archive mirror
 help / color / mirror / Atom feed
* [PATCH] mm: kill [add|del]_page_to_lru_list()
@ 2023-06-09  1:39 Kefeng Wang
  2023-06-09 17:14 ` Yu Zhao
  2023-06-09 17:18 ` Matthew Wilcox
  0 siblings, 2 replies; 4+ messages in thread
From: Kefeng Wang @ 2023-06-09  1:39 UTC (permalink / raw)
  To: Andrew Morton, linux-mm; +Cc: linux-kernel, Kefeng Wang

Directly call lruvec_del_folio(), and drop unused page interfaces.

Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
---
 include/linux/mm_inline.h | 12 ------------
 mm/compaction.c           |  2 +-
 2 files changed, 1 insertion(+), 13 deletions(-)

diff --git a/include/linux/mm_inline.h b/include/linux/mm_inline.h
index 0e1d239a882c..e9cdeb290841 100644
--- a/include/linux/mm_inline.h
+++ b/include/linux/mm_inline.h
@@ -323,12 +323,6 @@ void lruvec_add_folio(struct lruvec *lruvec, struct folio *folio)
 		list_add(&folio->lru, &lruvec->lists[lru]);
 }
 
-static __always_inline void add_page_to_lru_list(struct page *page,
-				struct lruvec *lruvec)
-{
-	lruvec_add_folio(lruvec, page_folio(page));
-}
-
 static __always_inline
 void lruvec_add_folio_tail(struct lruvec *lruvec, struct folio *folio)
 {
@@ -357,12 +351,6 @@ void lruvec_del_folio(struct lruvec *lruvec, struct folio *folio)
 			-folio_nr_pages(folio));
 }
 
-static __always_inline void del_page_from_lru_list(struct page *page,
-				struct lruvec *lruvec)
-{
-	lruvec_del_folio(lruvec, page_folio(page));
-}
-
 #ifdef CONFIG_ANON_VMA_NAME
 /*
  * mmap_lock should be read-locked when calling anon_vma_name(). Caller should
diff --git a/mm/compaction.c b/mm/compaction.c
index 3398ef3a55fe..66b442d20d01 100644
--- a/mm/compaction.c
+++ b/mm/compaction.c
@@ -1145,7 +1145,7 @@ isolate_migratepages_block(struct compact_control *cc, unsigned long low_pfn,
 			low_pfn += compound_nr(page) - 1;
 
 		/* Successfully isolated */
-		del_page_from_lru_list(page, lruvec);
+		lruvec_del_folio(lruvec, page_folio(page));
 		mod_node_page_state(page_pgdat(page),
 				NR_ISOLATED_ANON + page_is_file_lru(page),
 				thp_nr_pages(page));
-- 
2.35.3


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

* Re: [PATCH] mm: kill [add|del]_page_to_lru_list()
  2023-06-09  1:39 [PATCH] mm: kill [add|del]_page_to_lru_list() Kefeng Wang
@ 2023-06-09 17:14 ` Yu Zhao
  2023-06-09 17:18 ` Matthew Wilcox
  1 sibling, 0 replies; 4+ messages in thread
From: Yu Zhao @ 2023-06-09 17:14 UTC (permalink / raw)
  To: Kefeng Wang; +Cc: Andrew Morton, linux-mm, linux-kernel, Matthew Wilcox

On Thu, Jun 8, 2023 at 7:23 PM Kefeng Wang <wangkefeng.wang@huawei.com> wrote:
>
> Directly call lruvec_del_folio(), and drop unused page interfaces.
>
> Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>

Acked-by: Yu Zhao <yuzhao@google.com>

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

* Re: [PATCH] mm: kill [add|del]_page_to_lru_list()
  2023-06-09  1:39 [PATCH] mm: kill [add|del]_page_to_lru_list() Kefeng Wang
  2023-06-09 17:14 ` Yu Zhao
@ 2023-06-09 17:18 ` Matthew Wilcox
  2023-06-12  1:08   ` Kefeng Wang
  1 sibling, 1 reply; 4+ messages in thread
From: Matthew Wilcox @ 2023-06-09 17:18 UTC (permalink / raw)
  To: Kefeng Wang; +Cc: Andrew Morton, linux-mm, linux-kernel

On Fri, Jun 09, 2023 at 09:39:01AM +0800, Kefeng Wang wrote:
> Directly call lruvec_del_folio(), and drop unused page interfaces.

Convert isolate_migratepages_block() to actually use folios and
then we can kill the interfaces.

> +++ b/mm/compaction.c
> @@ -1145,7 +1145,7 @@ isolate_migratepages_block(struct compact_control *cc, unsigned long low_pfn,
>  			low_pfn += compound_nr(page) - 1;
>  
>  		/* Successfully isolated */
> -		del_page_from_lru_list(page, lruvec);
> +		lruvec_del_folio(lruvec, page_folio(page));

This kind of thing is not encouraged.  It's just churn and gets in
the way of actual conversions.

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

* Re: [PATCH] mm: kill [add|del]_page_to_lru_list()
  2023-06-09 17:18 ` Matthew Wilcox
@ 2023-06-12  1:08   ` Kefeng Wang
  0 siblings, 0 replies; 4+ messages in thread
From: Kefeng Wang @ 2023-06-12  1:08 UTC (permalink / raw)
  To: Matthew Wilcox; +Cc: Andrew Morton, linux-mm, linux-kernel



On 2023/6/10 1:18, Matthew Wilcox wrote:
> On Fri, Jun 09, 2023 at 09:39:01AM +0800, Kefeng Wang wrote:
>> Directly call lruvec_del_folio(), and drop unused page interfaces.
> 
> Convert isolate_migratepages_block() to actually use folios and
> then we can kill the interfaces.
> 
>> +++ b/mm/compaction.c
>> @@ -1145,7 +1145,7 @@ isolate_migratepages_block(struct compact_control *cc, unsigned long low_pfn,
>>   			low_pfn += compound_nr(page) - 1;
>>   
>>   		/* Successfully isolated */
>> -		del_page_from_lru_list(page, lruvec);
>> +		lruvec_del_folio(lruvec, page_folio(page));
> 
> This kind of thing is not encouraged.  It's just churn and gets in
> the way of actual conversions.

Sure, thanks for your suggestion, will convert 
isolate_migratepages_block() firstly.
> 

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

end of thread, other threads:[~2023-06-12  1:08 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-09  1:39 [PATCH] mm: kill [add|del]_page_to_lru_list() Kefeng Wang
2023-06-09 17:14 ` Yu Zhao
2023-06-09 17:18 ` Matthew Wilcox
2023-06-12  1:08   ` Kefeng Wang

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 read-only IMAP folder(s) and NNTP newsgroup(s).