linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mm: Fix PSWPIN counter for large folios swap-in
@ 2024-10-23 21:02 Barry Song
  2024-10-23 21:45 ` David Hildenbrand
  2024-10-24  1:16 ` Baolin Wang
  0 siblings, 2 replies; 3+ messages in thread
From: Barry Song @ 2024-10-23 21:02 UTC (permalink / raw)
  To: akpm, linux-mm
  Cc: linux-kernel, Barry Song, Chris Li, Yosry Ahmed, Baolin Wang,
	David Hildenbrand, Huang, Ying, Kairui Song, Ryan Roberts,
	Kanchana P Sridhar, Usama Arif

From: Barry Song <v-songbaohua@oppo.com>

Similar to PSWPOUT, we should count the number of base pages
instead of large folios.

Fixes: 242d12c98174 ("mm: support large folios swap-in for sync io devices")
Cc: Chris Li <chrisl@kernel.org>
Cc: Yosry Ahmed <yosryahmed@google.com>
Cc: Baolin Wang <baolin.wang@linux.alibaba.com>
Cc: David Hildenbrand <david@redhat.com>
Cc: "Huang, Ying" <ying.huang@intel.com>
Cc: Kairui Song <kasong@tencent.com>
Cc: Ryan Roberts <ryan.roberts@arm.com>
Cc: Kanchana P Sridhar <kanchana.p.sridhar@intel.com>
Cc: Usama Arif <usamaarif642@gmail.com>
Signed-off-by: Barry Song <v-songbaohua@oppo.com>
---
 mm/page_io.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/mm/page_io.c b/mm/page_io.c
index a28d28b6b3ce..c69fab5060a1 100644
--- a/mm/page_io.c
+++ b/mm/page_io.c
@@ -574,7 +574,7 @@ static void swap_read_folio_bdev_sync(struct folio *folio,
 	 */
 	get_task_struct(current);
 	count_memcg_folio_events(folio, PSWPIN, folio_nr_pages(folio));
-	count_vm_event(PSWPIN);
+	count_vm_events(PSWPIN, folio_nr_pages(folio));
 	submit_bio_wait(&bio);
 	__end_swap_bio_read(&bio);
 	put_task_struct(current);
@@ -590,7 +590,7 @@ static void swap_read_folio_bdev_async(struct folio *folio,
 	bio->bi_end_io = end_swap_bio_read;
 	bio_add_folio_nofail(bio, folio, folio_size(folio), 0);
 	count_memcg_folio_events(folio, PSWPIN, folio_nr_pages(folio));
-	count_vm_event(PSWPIN);
+	count_vm_events(PSWPIN, folio_nr_pages(folio));
 	submit_bio(bio);
 }
 
-- 
2.39.3 (Apple Git-146)


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

* Re: [PATCH] mm: Fix PSWPIN counter for large folios swap-in
  2024-10-23 21:02 [PATCH] mm: Fix PSWPIN counter for large folios swap-in Barry Song
@ 2024-10-23 21:45 ` David Hildenbrand
  2024-10-24  1:16 ` Baolin Wang
  1 sibling, 0 replies; 3+ messages in thread
From: David Hildenbrand @ 2024-10-23 21:45 UTC (permalink / raw)
  To: Barry Song, akpm, linux-mm
  Cc: linux-kernel, Barry Song, Chris Li, Yosry Ahmed, Baolin Wang,
	Huang, Ying, Kairui Song, Ryan Roberts, Kanchana P Sridhar,
	Usama Arif

On 23.10.24 23:02, Barry Song wrote:
> From: Barry Song <v-songbaohua@oppo.com>
> 
> Similar to PSWPOUT, we should count the number of base pages
> instead of large folios.
> 
> Fixes: 242d12c98174 ("mm: support large folios swap-in for sync io devices")
> Cc: Chris Li <chrisl@kernel.org>
> Cc: Yosry Ahmed <yosryahmed@google.com>
> Cc: Baolin Wang <baolin.wang@linux.alibaba.com>
> Cc: David Hildenbrand <david@redhat.com>
> Cc: "Huang, Ying" <ying.huang@intel.com>
> Cc: Kairui Song <kasong@tencent.com>
> Cc: Ryan Roberts <ryan.roberts@arm.com>
> Cc: Kanchana P Sridhar <kanchana.p.sridhar@intel.com>
> Cc: Usama Arif <usamaarif642@gmail.com>
> Signed-off-by: Barry Song <v-songbaohua@oppo.com>
> ---
>   mm/page_io.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 

Acked-by: David Hildenbrand <david@redhat.com>

-- 
Cheers,

David / dhildenb


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

* Re: [PATCH] mm: Fix PSWPIN counter for large folios swap-in
  2024-10-23 21:02 [PATCH] mm: Fix PSWPIN counter for large folios swap-in Barry Song
  2024-10-23 21:45 ` David Hildenbrand
@ 2024-10-24  1:16 ` Baolin Wang
  1 sibling, 0 replies; 3+ messages in thread
From: Baolin Wang @ 2024-10-24  1:16 UTC (permalink / raw)
  To: Barry Song, akpm, linux-mm
  Cc: linux-kernel, Barry Song, Chris Li, Yosry Ahmed,
	David Hildenbrand, Huang, Ying, Kairui Song, Ryan Roberts,
	Kanchana P Sridhar, Usama Arif



On 2024/10/24 05:02, Barry Song wrote:
> From: Barry Song <v-songbaohua@oppo.com>
> 
> Similar to PSWPOUT, we should count the number of base pages
> instead of large folios.
> 
> Fixes: 242d12c98174 ("mm: support large folios swap-in for sync io devices")
> Cc: Chris Li <chrisl@kernel.org>
> Cc: Yosry Ahmed <yosryahmed@google.com>
> Cc: Baolin Wang <baolin.wang@linux.alibaba.com>
> Cc: David Hildenbrand <david@redhat.com>
> Cc: "Huang, Ying" <ying.huang@intel.com>
> Cc: Kairui Song <kasong@tencent.com>
> Cc: Ryan Roberts <ryan.roberts@arm.com>
> Cc: Kanchana P Sridhar <kanchana.p.sridhar@intel.com>
> Cc: Usama Arif <usamaarif642@gmail.com>
> Signed-off-by: Barry Song <v-songbaohua@oppo.com>

LGTM.
Reviewed-by: Baolin Wang <baolin.wang@linux.alibaba.com>

> ---
>   mm/page_io.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/mm/page_io.c b/mm/page_io.c
> index a28d28b6b3ce..c69fab5060a1 100644
> --- a/mm/page_io.c
> +++ b/mm/page_io.c
> @@ -574,7 +574,7 @@ static void swap_read_folio_bdev_sync(struct folio *folio,
>   	 */
>   	get_task_struct(current);
>   	count_memcg_folio_events(folio, PSWPIN, folio_nr_pages(folio));
> -	count_vm_event(PSWPIN);
> +	count_vm_events(PSWPIN, folio_nr_pages(folio));
>   	submit_bio_wait(&bio);
>   	__end_swap_bio_read(&bio);
>   	put_task_struct(current);
> @@ -590,7 +590,7 @@ static void swap_read_folio_bdev_async(struct folio *folio,
>   	bio->bi_end_io = end_swap_bio_read;
>   	bio_add_folio_nofail(bio, folio, folio_size(folio), 0);
>   	count_memcg_folio_events(folio, PSWPIN, folio_nr_pages(folio));
> -	count_vm_event(PSWPIN);
> +	count_vm_events(PSWPIN, folio_nr_pages(folio));
>   	submit_bio(bio);
>   }
>   

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

end of thread, other threads:[~2024-10-24  1:16 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-23 21:02 [PATCH] mm: Fix PSWPIN counter for large folios swap-in Barry Song
2024-10-23 21:45 ` David Hildenbrand
2024-10-24  1:16 ` Baolin 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 NNTP newsgroup(s).