Re: [PATCH 20/23] mm: percpu: remove unnecessary unlikely()

2018-08-30 Thread Dennis Zhou
On Fri, Aug 31, 2018 at 01:34:26AM +0300, Igor Stoppa wrote:
> WARN_ON() already contains an unlikely(), so it's not necessary to
> wrap it into another.
> 
> Signed-off-by: Igor Stoppa 
> Cc: zijun_hu 
> Cc: Tejun Heo 
> Cc: Christoph Lameter 
> Cc: Dennis Zhou 
> ---
>  mm/percpu.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/mm/percpu.c b/mm/percpu.c
> index a749d4d96e3e..f5c2796fe63e 100644
> --- a/mm/percpu.c
> +++ b/mm/percpu.c
> @@ -2588,7 +2588,7 @@ int __init pcpu_page_first_chunk(size_t reserved_size,
>   BUG_ON(ai->nr_groups != 1);
>   upa = ai->alloc_size/ai->unit_size;
>   nr_g0_units = roundup(num_possible_cpus(), upa);
> - if (unlikely(WARN_ON(ai->groups[0].nr_units != nr_g0_units))) {
> + if (WARN_ON(ai->groups[0].nr_units != nr_g0_units)) {
>   pcpu_free_alloc_info(ai);
>   return -EINVAL;
>   }
> -- 
> 2.17.1
> 

Acked-by: Dennis Zhou 

Thanks,
Dennis


Re: [PATCH 20/23] mm: percpu: remove unnecessary unlikely()

2018-08-30 Thread Dennis Zhou
On Fri, Aug 31, 2018 at 01:34:26AM +0300, Igor Stoppa wrote:
> WARN_ON() already contains an unlikely(), so it's not necessary to
> wrap it into another.
> 
> Signed-off-by: Igor Stoppa 
> Cc: zijun_hu 
> Cc: Tejun Heo 
> Cc: Christoph Lameter 
> Cc: Dennis Zhou 
> ---
>  mm/percpu.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/mm/percpu.c b/mm/percpu.c
> index a749d4d96e3e..f5c2796fe63e 100644
> --- a/mm/percpu.c
> +++ b/mm/percpu.c
> @@ -2588,7 +2588,7 @@ int __init pcpu_page_first_chunk(size_t reserved_size,
>   BUG_ON(ai->nr_groups != 1);
>   upa = ai->alloc_size/ai->unit_size;
>   nr_g0_units = roundup(num_possible_cpus(), upa);
> - if (unlikely(WARN_ON(ai->groups[0].nr_units != nr_g0_units))) {
> + if (WARN_ON(ai->groups[0].nr_units != nr_g0_units)) {
>   pcpu_free_alloc_info(ai);
>   return -EINVAL;
>   }
> -- 
> 2.17.1
> 

Acked-by: Dennis Zhou 

Thanks,
Dennis


[PATCH 20/23] mm: percpu: remove unnecessary unlikely()

2018-08-30 Thread Igor Stoppa
WARN_ON() already contains an unlikely(), so it's not necessary to
wrap it into another.

Signed-off-by: Igor Stoppa 
Cc: zijun_hu 
Cc: Tejun Heo 
Cc: Christoph Lameter 
Cc: Dennis Zhou 
---
 mm/percpu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/percpu.c b/mm/percpu.c
index a749d4d96e3e..f5c2796fe63e 100644
--- a/mm/percpu.c
+++ b/mm/percpu.c
@@ -2588,7 +2588,7 @@ int __init pcpu_page_first_chunk(size_t reserved_size,
BUG_ON(ai->nr_groups != 1);
upa = ai->alloc_size/ai->unit_size;
nr_g0_units = roundup(num_possible_cpus(), upa);
-   if (unlikely(WARN_ON(ai->groups[0].nr_units != nr_g0_units))) {
+   if (WARN_ON(ai->groups[0].nr_units != nr_g0_units)) {
pcpu_free_alloc_info(ai);
return -EINVAL;
}
-- 
2.17.1



[PATCH 20/23] mm: percpu: remove unnecessary unlikely()

2018-08-30 Thread Igor Stoppa
WARN_ON() already contains an unlikely(), so it's not necessary to
wrap it into another.

Signed-off-by: Igor Stoppa 
Cc: zijun_hu 
Cc: Tejun Heo 
Cc: Christoph Lameter 
Cc: Dennis Zhou 
---
 mm/percpu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/percpu.c b/mm/percpu.c
index a749d4d96e3e..f5c2796fe63e 100644
--- a/mm/percpu.c
+++ b/mm/percpu.c
@@ -2588,7 +2588,7 @@ int __init pcpu_page_first_chunk(size_t reserved_size,
BUG_ON(ai->nr_groups != 1);
upa = ai->alloc_size/ai->unit_size;
nr_g0_units = roundup(num_possible_cpus(), upa);
-   if (unlikely(WARN_ON(ai->groups[0].nr_units != nr_g0_units))) {
+   if (WARN_ON(ai->groups[0].nr_units != nr_g0_units)) {
pcpu_free_alloc_info(ai);
return -EINVAL;
}
-- 
2.17.1