Re: [PATCH] net: rds: fix per-cpu helper usage

2014-01-17 Thread David Miller
From: Gerald Schaefer 
Date: Thu, 16 Jan 2014 16:54:48 +0100

> commit ae4b46e9d "net: rds: use this_cpu_* per-cpu helper" broke per-cpu
> handling for rds. chpfirst is the result of __this_cpu_read(), so it is
> an absolute pointer and not __percpu. Therefore, __this_cpu_write()
> should not operate on chpfirst, but rather on cache->percpu->first, just
> like __this_cpu_read() did before.
> 
> Cc:  # 3.8+
> Signed-off-byd Gerald Schaefer 

Applied and queued up for -stable, thanks.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] net: rds: fix per-cpu helper usage

2014-01-17 Thread David Miller
From: Gerald Schaefer gerald.schae...@de.ibm.com
Date: Thu, 16 Jan 2014 16:54:48 +0100

 commit ae4b46e9d net: rds: use this_cpu_* per-cpu helper broke per-cpu
 handling for rds. chpfirst is the result of __this_cpu_read(), so it is
 an absolute pointer and not __percpu. Therefore, __this_cpu_write()
 should not operate on chpfirst, but rather on cache-percpu-first, just
 like __this_cpu_read() did before.
 
 Cc: sta...@vger.kernel.org # 3.8+
 Signed-off-byd Gerald Schaefer gerald.schae...@de.ibm.com

Applied and queued up for -stable, thanks.
--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] net: rds: fix per-cpu helper usage

2014-01-16 Thread Gerald Schaefer
commit ae4b46e9d "net: rds: use this_cpu_* per-cpu helper" broke per-cpu
handling for rds. chpfirst is the result of __this_cpu_read(), so it is
an absolute pointer and not __percpu. Therefore, __this_cpu_write()
should not operate on chpfirst, but rather on cache->percpu->first, just
like __this_cpu_read() did before.

Cc:  # 3.8+
Signed-off-byd Gerald Schaefer 
---
 net/rds/ib_recv.c | 7 +++
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/net/rds/ib_recv.c b/net/rds/ib_recv.c
index 8eb9501..b7ebe23 100644
--- a/net/rds/ib_recv.c
+++ b/net/rds/ib_recv.c
@@ -421,8 +421,7 @@ static void rds_ib_recv_cache_put(struct list_head 
*new_item,
 struct rds_ib_refill_cache *cache)
 {
unsigned long flags;
-   struct list_head *old;
-   struct list_head __percpu *chpfirst;
+   struct list_head *old, *chpfirst;
 
local_irq_save(flags);
 
@@ -432,7 +431,7 @@ static void rds_ib_recv_cache_put(struct list_head 
*new_item,
else /* put on front */
list_add_tail(new_item, chpfirst);
 
-   __this_cpu_write(chpfirst, new_item);
+   __this_cpu_write(cache->percpu->first, new_item);
__this_cpu_inc(cache->percpu->count);
 
if (__this_cpu_read(cache->percpu->count) < RDS_IB_RECYCLE_BATCH_COUNT)
@@ -452,7 +451,7 @@ static void rds_ib_recv_cache_put(struct list_head 
*new_item,
} while (old);
 
 
-   __this_cpu_write(chpfirst, NULL);
+   __this_cpu_write(cache->percpu->first, NULL);
__this_cpu_write(cache->percpu->count, 0);
 end:
local_irq_restore(flags);
-- 
1.8.4.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] net: rds: fix per-cpu helper usage

2014-01-16 Thread Gerald Schaefer
commit ae4b46e9d net: rds: use this_cpu_* per-cpu helper broke per-cpu
handling for rds. chpfirst is the result of __this_cpu_read(), so it is
an absolute pointer and not __percpu. Therefore, __this_cpu_write()
should not operate on chpfirst, but rather on cache-percpu-first, just
like __this_cpu_read() did before.

Cc: sta...@vger.kernel.org # 3.8+
Signed-off-byd Gerald Schaefer gerald.schae...@de.ibm.com
---
 net/rds/ib_recv.c | 7 +++
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/net/rds/ib_recv.c b/net/rds/ib_recv.c
index 8eb9501..b7ebe23 100644
--- a/net/rds/ib_recv.c
+++ b/net/rds/ib_recv.c
@@ -421,8 +421,7 @@ static void rds_ib_recv_cache_put(struct list_head 
*new_item,
 struct rds_ib_refill_cache *cache)
 {
unsigned long flags;
-   struct list_head *old;
-   struct list_head __percpu *chpfirst;
+   struct list_head *old, *chpfirst;
 
local_irq_save(flags);
 
@@ -432,7 +431,7 @@ static void rds_ib_recv_cache_put(struct list_head 
*new_item,
else /* put on front */
list_add_tail(new_item, chpfirst);
 
-   __this_cpu_write(chpfirst, new_item);
+   __this_cpu_write(cache-percpu-first, new_item);
__this_cpu_inc(cache-percpu-count);
 
if (__this_cpu_read(cache-percpu-count)  RDS_IB_RECYCLE_BATCH_COUNT)
@@ -452,7 +451,7 @@ static void rds_ib_recv_cache_put(struct list_head 
*new_item,
} while (old);
 
 
-   __this_cpu_write(chpfirst, NULL);
+   __this_cpu_write(cache-percpu-first, NULL);
__this_cpu_write(cache-percpu-count, 0);
 end:
local_irq_restore(flags);
-- 
1.8.4.5

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/