diff mbox series

[5/8] mm/percpu: replace the goto with break

Message ID 20221024081435.204970-6-bhe@redhat.com (mailing list archive)
State New
Headers show
Series Cleanup and optimization patches for percpu | expand

Commit Message

Baoquan He Oct. 24, 2022, 8:14 a.m. UTC
In function pcpu_reclaim_populated(), the line of goto jumping is
unnecessary since the label 'end_chunk' is near the end of the for
loop, use break instead.

Signed-off-by: Baoquan He <bhe@redhat.com>
---
 mm/percpu.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Comments

Dennis Zhou Oct. 24, 2022, 5 p.m. UTC | #1
On Mon, Oct 24, 2022 at 04:14:32PM +0800, Baoquan He wrote:
> In function pcpu_reclaim_populated(), the line of goto jumping is
> unnecessary since the label 'end_chunk' is near the end of the for
> loop, use break instead.
> 
> Signed-off-by: Baoquan He <bhe@redhat.com>
> ---
>  mm/percpu.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/mm/percpu.c b/mm/percpu.c
> index 09e407338573..954abf916c7d 100644
> --- a/mm/percpu.c
> +++ b/mm/percpu.c
> @@ -2167,7 +2167,7 @@ static void pcpu_reclaim_populated(void)
>  			/* reintegrate chunk to prevent atomic alloc failures */
>  			if (pcpu_nr_empty_pop_pages < PCPU_EMPTY_POP_PAGES_HIGH) {
>  				reintegrate = true;
> -				goto end_chunk;
> +				break;
>  			}
>  
>  			/*
> @@ -2203,7 +2203,6 @@ static void pcpu_reclaim_populated(void)
>  			end = -1;
>  		}
>  
> -end_chunk:
>  		/* batch tlb flush per chunk to amortize cost */
>  		if (freed_page_start < freed_page_end) {
>  			spin_unlock_irq(&pcpu_lock);
> -- 
> 2.34.1
> 
> 

Acked-by: Dennis Zhou <dennis@kernel.org>

Thanks,
Dennis
diff mbox series

Patch

diff --git a/mm/percpu.c b/mm/percpu.c
index 09e407338573..954abf916c7d 100644
--- a/mm/percpu.c
+++ b/mm/percpu.c
@@ -2167,7 +2167,7 @@  static void pcpu_reclaim_populated(void)
 			/* reintegrate chunk to prevent atomic alloc failures */
 			if (pcpu_nr_empty_pop_pages < PCPU_EMPTY_POP_PAGES_HIGH) {
 				reintegrate = true;
-				goto end_chunk;
+				break;
 			}
 
 			/*
@@ -2203,7 +2203,6 @@  static void pcpu_reclaim_populated(void)
 			end = -1;
 		}
 
-end_chunk:
 		/* batch tlb flush per chunk to amortize cost */
 		if (freed_page_start < freed_page_end) {
 			spin_unlock_irq(&pcpu_lock);