[PATCH 4/4] mm: swap: remove stale comment stale comment in cluster_alloc_swap_entry()

Kemeng Shi posted 4 patches 6 months, 3 weeks ago
[PATCH 4/4] mm: swap: remove stale comment stale comment in cluster_alloc_swap_entry()
Posted by Kemeng Shi 6 months, 3 weeks ago
As cluster_next_cpu was already dropped, the associated comment is stale
now.

Signed-off-by: Kemeng Shi <shikemeng@huaweicloud.com>
---
 mm/swapfile.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/mm/swapfile.c b/mm/swapfile.c
index 63ab9f14b2c6..8525515fb06c 100644
--- a/mm/swapfile.c
+++ b/mm/swapfile.c
@@ -956,9 +956,8 @@ static unsigned long cluster_alloc_swap_entry(struct swap_info_struct *si, int o
 	}
 
 	/*
-	 * We don't have free cluster but have some clusters in
-	 * discarding, do discard now and reclaim them, then
-	 * reread cluster_next_cpu since we dropped si->lock
+	 * We don't have free cluster but have some clusters in discarding,
+	 * do discard now and reclaim them.
 	 */
 	if ((si->flags & SWP_PAGE_DISCARD) && swap_do_scheduled_discard(si))
 		goto new_cluster;
-- 
2.30.0
Re: [PATCH 4/4] mm: swap: remove stale comment stale comment in cluster_alloc_swap_entry()
Posted by Baoquan He 6 months, 2 weeks ago
On 05/22/25 at 08:25pm, Kemeng Shi wrote:
> As cluster_next_cpu was already dropped, the associated comment is stale
> now.
> 
> Signed-off-by: Kemeng Shi <shikemeng@huaweicloud.com>
> ---
>  mm/swapfile.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)

Reviewed-by: Baoquan He <bhe@redhat.com>

> 
> diff --git a/mm/swapfile.c b/mm/swapfile.c
> index 63ab9f14b2c6..8525515fb06c 100644
> --- a/mm/swapfile.c
> +++ b/mm/swapfile.c
> @@ -956,9 +956,8 @@ static unsigned long cluster_alloc_swap_entry(struct swap_info_struct *si, int o
>  	}
>  
>  	/*
> -	 * We don't have free cluster but have some clusters in
> -	 * discarding, do discard now and reclaim them, then
> -	 * reread cluster_next_cpu since we dropped si->lock
> +	 * We don't have free cluster but have some clusters in discarding,
> +	 * do discard now and reclaim them.
>  	 */
>  	if ((si->flags & SWP_PAGE_DISCARD) && swap_do_scheduled_discard(si))
>  		goto new_cluster;
> -- 
> 2.30.0
>
Re: [PATCH 4/4] mm: swap: remove stale comment stale comment in cluster_alloc_swap_entry()
Posted by Kairui Song 6 months, 3 weeks ago
On Thu, May 22, 2025 at 11:32 AM Kemeng Shi <shikemeng@huaweicloud.com> wrote:
>
> As cluster_next_cpu was already dropped, the associated comment is stale
> now.
>
> Signed-off-by: Kemeng Shi <shikemeng@huaweicloud.com>
> ---
>  mm/swapfile.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/mm/swapfile.c b/mm/swapfile.c
> index 63ab9f14b2c6..8525515fb06c 100644
> --- a/mm/swapfile.c
> +++ b/mm/swapfile.c
> @@ -956,9 +956,8 @@ static unsigned long cluster_alloc_swap_entry(struct swap_info_struct *si, int o
>         }
>
>         /*
> -        * We don't have free cluster but have some clusters in
> -        * discarding, do discard now and reclaim them, then
> -        * reread cluster_next_cpu since we dropped si->lock
> +        * We don't have free cluster but have some clusters in discarding,
> +        * do discard now and reclaim them.
>          */
>         if ((si->flags & SWP_PAGE_DISCARD) && swap_do_scheduled_discard(si))
>                 goto new_cluster;
> --
> 2.30.0
>

Nice.

Reviewed-by: Kairui Song <kasong@tencent.com>