linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mm/page-writeback: Use __this_cpu_inc() in account_page_dirtied()
@ 2021-05-12 14:47 Chi Wu
  2021-05-13  8:22 ` Jan Kara
  0 siblings, 1 reply; 2+ messages in thread
From: Chi Wu @ 2021-05-12 14:47 UTC (permalink / raw)
  To: akpm
  Cc: axboe, hcochran, jack, linux-kernel, linux-mm, mszeredi,
	sedat.dilek, tj, Chi Wu

As account_page_dirtied() was always protected by xa_lock_irqsave(),
so using __this_cpu_inc() is better.

Signed-off-by: Chi Wu <wuchi.zero@gmail.com>
---
 mm/page-writeback.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/page-writeback.c b/mm/page-writeback.c
index 0062d5c57d41..e3901d0d329e 100644
--- a/mm/page-writeback.c
+++ b/mm/page-writeback.c
@@ -2436,7 +2436,7 @@ void account_page_dirtied(struct page *page, struct address_space *mapping)
 		inc_wb_stat(wb, WB_DIRTIED);
 		task_io_account_write(PAGE_SIZE);
 		current->nr_dirtied++;
-		this_cpu_inc(bdp_ratelimits);
+		__this_cpu_inc(bdp_ratelimits);
 
 		mem_cgroup_track_foreign_dirty(page, wb);
 	}
-- 
2.17.1


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

* Re: [PATCH] mm/page-writeback: Use __this_cpu_inc() in account_page_dirtied()
  2021-05-12 14:47 [PATCH] mm/page-writeback: Use __this_cpu_inc() in account_page_dirtied() Chi Wu
@ 2021-05-13  8:22 ` Jan Kara
  0 siblings, 0 replies; 2+ messages in thread
From: Jan Kara @ 2021-05-13  8:22 UTC (permalink / raw)
  To: Chi Wu
  Cc: akpm, axboe, hcochran, jack, linux-kernel, linux-mm, mszeredi,
	sedat.dilek, tj

On Wed 12-05-21 22:47:42, Chi Wu wrote:
> As account_page_dirtied() was always protected by xa_lock_irqsave(),
> so using __this_cpu_inc() is better.
> 
> Signed-off-by: Chi Wu <wuchi.zero@gmail.com>

Looks good. You can add:

Reviewed-by: Jan Kara <jack@suse.cz>

								Honza

> ---
>  mm/page-writeback.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/mm/page-writeback.c b/mm/page-writeback.c
> index 0062d5c57d41..e3901d0d329e 100644
> --- a/mm/page-writeback.c
> +++ b/mm/page-writeback.c
> @@ -2436,7 +2436,7 @@ void account_page_dirtied(struct page *page, struct address_space *mapping)
>  		inc_wb_stat(wb, WB_DIRTIED);
>  		task_io_account_write(PAGE_SIZE);
>  		current->nr_dirtied++;
> -		this_cpu_inc(bdp_ratelimits);
> +		__this_cpu_inc(bdp_ratelimits);
>  
>  		mem_cgroup_track_foreign_dirty(page, wb);
>  	}
> -- 
> 2.17.1
> 
-- 
Jan Kara <jack@suse.com>
SUSE Labs, CR

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

end of thread, other threads:[~2021-05-13  8:22 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-12 14:47 [PATCH] mm/page-writeback: Use __this_cpu_inc() in account_page_dirtied() Chi Wu
2021-05-13  8:22 ` Jan Kara

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