net: core: use this_cpu_ptr per-cpu helper
Subsystems (2)
PATCH v4 1/9 net: core: use this_cpu_ptr per-cpu helper
From: Shan Wei <[email protected]>
flush_tasklet is a struct, not a pointer in percpu var. so use this_cpu_ptr to get the member pointer.
---
no changes vs v3.
--- net/core/flow.c | 4 +--- 1 files changed, 1 insertions(+), 3 deletions(-)
net/core/flow.c +1 -3
@@ -327,11 +327,9 @@ static void flow_cache_flush_tasklet(unsigned long data)static void flow_cache_flush_per_cpu (void *data) {struct flow_flush_info *info = data; -int cpu;struct tasklet_struct *tasklet; - cpu =smp_processor_id (); - tasklet = &per_cpu_ptr (info->cache->percpu, cpu)->flush_tasklet; + tasklet =this_cpu_ptr (&info->cache->percpu->flush_tasklet); tasklet->data = (unsigned long )info;tasklet_schedule (tasklet); }
Signature · 1 line
1.7.1
Shan Wei said, at 2012/11/13 9:51:
Quoted 7 lines
From: Shan Wei <[email protected]>
flush_taskletis a struct, not a pointer in percpu var. so usethis_cpu_ptrto get the member pointer.Signed-off-by Shan Wei <[email protected]>Reviewed-by Christoph Lameter <[email protected]>
David Miller, would you like to pick it up to your net-next tree?
Quoted 24 lines
---
no changes vs v3.--- net/core/flow.c | 4 +--- 1 files changed, 1 insertions(+), 3 deletions(-)net/core/flow.c +1
-3@@ -327,11 +327,9 @@ static void flow_cache_flush_tasklet(unsigned long data)static void flow_cache_flush_per_cpu (void *data) {struct flow_flush_info *info = data; -int cpu;struct tasklet_struct *tasklet; - cpu =smp_processor_id (); - tasklet = &per_cpu_ptr (info->cache->percpu, cpu)->flush_tasklet; + tasklet =this_cpu_ptr (&info->cache->percpu->flush_tasklet); tasklet->data = (unsigned long )info;tasklet_schedule (tasklet); }
From: Shan Wei <[email protected]>
Date: Fri, 16 Nov 2012 16:38:01 +0800
Quoted 10 lines
Shan Wei said, at 2012/11/13 9:51:
Quoted 7 lines
From: Shan Wei <[email protected]>
flush_taskletis a struct, not a pointer in percpu var. so usethis_cpu_ptrto get the member pointer.Signed-off-by Shan Wei <[email protected]>Reviewed-by Christoph Lameter <[email protected]>David Miller, would you like to pick it up to your net-next tree?
Applied.