Re: [RFC PATCH] x86: Use ACCESS_ONCE() for atomic_read()

2014-09-23 Thread Pranith Kumar
On Mon, Sep 22, 2014 at 4:07 PM, Peter Zijlstra wrote: > On Mon, Sep 22, 2014 at 03:53:09PM -0400, Pranith Kumar wrote: >> Use the much easier to read ACCESS_ONCE() which is basically the same thing >> as >> the cast to volatile. >> >> Please note the chang

[PATCH] perf: Use ACCESS_ONCE() instead of volatile cast

2014-09-23 Thread Pranith Kumar
Use ACCESS_ONCE() instead of the cast to volatile and read. This is just a style change which is reader friendly. Signed-off-by: Pranith Kumar --- tools/perf/util/session.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/perf/util/session.h b/tools/perf/util/session.h

Re: [PATCH] selftests/memfd: Run test on all architectures

2014-09-17 Thread Pranith Kumar
On Wed, Sep 17, 2014 at 11:36 AM, Shuah Khan wrote: > Hmm. I am seeing failures on x86_64 on top of Linus's tree > (without this patch) > > make -C tools/testing/selftests/memfd/make: Entering directory > `/lkml/linus_git_3.14/tools/testing/selftests/memfd' > gcc -D_FILE_OFFSET_BITS=64 > -I../../

[RFC PATCH 1/3] rcu: Add early boot self tests

2014-09-17 Thread Pranith Kumar
Add early boot self tests for RCU under CONFIG_PROVE_RCU. Currently the only test is adding a dummy callback which increments a counter which we then later verify after calling rcu_barrier*(). Signed-off-by: Pranith Kumar --- kernel/rcu/rcu.h| 2 ++ kernel/rcu/tiny.c | 4 ++- kernel

[RFC PATCH 2/3] doc: Document RCU self test boot params

2014-09-17 Thread Pranith Kumar
Document the RCU self test boot parameters in kernel-parameters.txt. Signed-off-by: Pranith Kumar --- Documentation/kernel-parameters.txt | 12 1 file changed, 12 insertions(+) diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt index c403957

[RFC PATCH 3/3] rcutorture: Enable RCU self test in configs

2014-09-17 Thread Pranith Kumar
Add config and boot parameters to enable the self tests in rcutorture testing. Signed-off-by: Pranith Kumar --- tools/testing/selftests/rcutorture/configs/rcu/TINY02 | 2 ++ tools/testing/selftests/rcutorture/configs/rcu/TINY02.boot | 2 ++ tools/testing/selftests/rcutorture/configs/rcu

[RFC PATCH 0/3] Early boot self tests for RCU

2014-09-17 Thread Pranith Kumar
they occur in the future. I enabled the selftests in a few rcutorture configurations. Thanks! -- Pranith Pranith Kumar (3): rcu: Add early boot self tests doc: Document RCU self test boot params rcutorture: Enable RCU self test in configs Documentation/kernel-parameters.txt

[RFC PATCH 0/3] Early boot self tests for RCU

2014-09-17 Thread Pranith Kumar
they occur in the future. I enabled the selftests in a few rcutorture configurations. Thanks! -- Pranith Pranith Kumar (3): rcu: Add early boot self tests doc: Document RCU self test boot params rcutorture: Enable RCU self test in configs Documentation/kernel-parameters.txt

BUG in ext4_setattr

2014-09-18 Thread Pranith Kumar
Hi, The following splat occurs in the latest rc5+ kernel. I am not sure this is enough information. Please let me know what options to enable to get more meaningful info. Thanks! [ 6382.247836] [ cut here ] [ 6382.248011] Kernel BUG at c00b1a70 [verbose debug info unavail

Re: [RFC PATCH 1/3] rcu: Add early boot self tests

2014-09-18 Thread Pranith Kumar
On Thu, Sep 18, 2014 at 5:29 PM, Paul E. McKenney wrote: >> +static int rcu_self_test_counter; >> +static struct rcu_head head; > > This needs to be within the individual functions, because otherwise the > lists get messed up when you to multiple tests during the same boot... > Hmm, I thought th

Re: BUG in ext4_setattr

2014-09-18 Thread Pranith Kumar
On Thu, Sep 18, 2014 at 2:19 PM, Theodore Ts'o wrote: > On Thu, Sep 18, 2014 at 12:01:00PM -0400, Pranith Kumar wrote: >> >> The following splat occurs in the latest rc5+ kernel. I am not sure >> this is enough information. Please let me know what options to enable >

[PATCH v2 1/1] rcu: Add early boot self tests

2014-09-19 Thread Pranith Kumar
Add early boot self tests for RCU under CONFIG_PROVE_RCU. Currently the only test is adding a dummy callback which increments a counter which we then later verify after calling rcu_barrier*(). Signed-off-by: Pranith Kumar --- kernel/rcu/rcu.h| 2 ++ kernel/rcu/tiny.c | 4 ++- kernel

[PATCH v2 3/3] rcutorture: Enable RCU self test in configs

2014-09-19 Thread Pranith Kumar
Add config and boot parameters to enable the self tests in rcutorture testing. Signed-off-by: Pranith Kumar --- tools/testing/selftests/rcutorture/configs/rcu/TINY02 | 2 ++ tools/testing/selftests/rcutorture/configs/rcu/TINY02.boot | 2 ++ tools/testing/selftests/rcutorture/configs/rcu

[PATCH v2 2/3] doc: Document RCU self test boot params

2014-09-19 Thread Pranith Kumar
Document the RCU self test boot parameters in kernel-parameters.txt. Signed-off-by: Pranith Kumar --- Documentation/kernel-parameters.txt | 9 + 1 file changed, 9 insertions(+) diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt index c403957

[PATCH v2 0/3] Early boot self tests for RCU

2014-09-19 Thread Pranith Kumar
. I enabled the selftests in a few rcutorture configurations. Thanks! -- Pranith v2: removed srcu tests and updated according to feedback Pranith Kumar (3): rcu: Add early boot self tests doc: Document RCU self test boot params rcutorture: Enable RCU self test in configs Documentation

[RFC PATCH] rcu: Change use of __this_cpu ops on a bool type

2014-09-19 Thread Pranith Kumar
let us silence it anyways. Signed-off-by: Pranith Kumar --- kernel/rcu/tree.c| 12 kernel/rcu/tree_plugin.h | 6 -- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c index bc085e5..85f228a 100644 --- a/kernel/rcu/tree.c

Re: [RFC PATCH] rcu: Change use of __this_cpu ops on a bool type

2014-09-19 Thread Pranith Kumar
On Fri, Sep 19, 2014 at 4:57 PM, Josh Triplett wrote: > On Fri, Sep 19, 2014 at 01:26:03PM -0400, Pranith Kumar wrote: >> __this_cpu_{read/write}() uses sizeof() to determine the size of the >> variable. >> Using this operation on a bool type causes sparse to complain

[PATCH] rcu: Remove redundant CONFIG_PREEMPT_RCU option

2014-09-21 Thread Pranith Kumar
PREEMPT_RCU and TREE_PREEMPT_RCU serve the same function after TINY_PREEMPT_RCU has been removed. This patch removes CONFIG_PREEMPT_RCU and uses CONFIG_TREE_PREEMPT_RCU in its place. Signed-off-by: Pranith Kumar --- arch/xtensa/configs/s6105_defconfig | 2 +- include/linux

Re: [PATCH tip/core/rcu 0/2] Signal-related changes for 3.19

2014-10-28 Thread Pranith Kumar
buggy" freeing of sighand by > __cleanup_sighand() without an RCU grace period really isn't > buggy, courtesy of Oleg Nesterov. Reviewed-by: Pranith Kumar > > Thanx, Paul > > -

Re: [PATCH tip/core/rcu 0/9] Per-CPU-variable updates

2014-10-29 Thread Pranith Kumar
variables. > > 3-9.Remove "cpu" arguments from a number of RCU functions that are > only ever invoked on that CPU, and use appropriate "this_"-style > accesssors for the per-CPU variables. >

Re: [PATCH tip/core/rcu 10/10] cpu: Avoid puts_pending overflow

2014-10-29 Thread Pranith Kumar
: Paul E. McKenney This patch seems to be missing in the cover letter. Reviewed-by: Pranith Kumar > --- > kernel/cpu.c | 19 +-- > 1 file changed, 13 insertions(+), 6 deletions(-) > > diff --git a/kernel/cpu.c b/kernel/cpu.c > index 90a3d017b90c..5d220234b3ca 10064

Re: [PATCH tip/core/rcu 0/5] Documentation updates for 3.19

2014-10-29 Thread Pranith Kumar
eference instructions. Later Alpha CPUs are OK. > (The official Alpha maintainers have thus far been silent > on this patch.) > > 2. Document the new RCU self-test boot parameters, courtesy of > Pranith Kumar. > > 3. Records that short-circu

Re: [PATCH tip/core/rcu 0/6] Torture-test changes for 3.19

2014-10-29 Thread Pranith Kumar
U, courtesy > of Pranith Kumar. > > 3. Enable early-boot callback-posting self-tests in rcutorture, > courtesy of Pranith Kumar. > > 4. Remove old-version rcutorture configuration files, courtesy > of Pranith Kumar. > > 5. Remove the

[RFC PATCH 00/16] Replace smp_read_barrier_depends() with lockless_derefrence()

2014-11-13 Thread Pranith Kumar
. I will send in separate patches/questions regarding them. Pranith Kumar (16): crypto: caam - Remove unnecessary smp_read_barrier_depends() doc: memory-barriers.txt: Document use of lockless_dereference() drivers: dma: Replace smp_read_barrier_depends() with lockless_dereference

[PATCH 14/16] slab: Replace smp_read_barrier_depends() with lockless_dereference()

2014-11-13 Thread Pranith Kumar
Recently lockless_dereference() was added which can be used in place of hard-coding smp_read_barrier_depends(). The following PATCH makes the change. Signed-off-by: Pranith Kumar --- mm/slab.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mm/slab.h b/mm/slab.h index

[PATCH 04/16] dcache: Replace smp_read_barrier_depends() with lockless_dereference()

2014-11-13 Thread Pranith Kumar
Recently lockless_dereference() was added which can be used in place of hard-coding smp_read_barrier_depends(). The following PATCH makes the change. Signed-off-by: Pranith Kumar --- fs/dcache.c | 7 ++- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/fs/dcache.c b/fs/dcache.c

[PATCH 16/16] rxrpc: Replace smp_read_barrier_depends() with lockless_dereference()

2014-11-13 Thread Pranith Kumar
Recently lockless_dereference() was added which can be used in place of hard-coding smp_read_barrier_depends(). The following PATCH makes the change. Signed-off-by: Pranith Kumar --- net/rxrpc/ar-ack.c | 22 +- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a

[PATCH 15/16] netfilter: Replace smp_read_barrier_depends() with lockless_dereference()

2014-11-13 Thread Pranith Kumar
Recently lockless_dereference() was added which can be used in place of hard-coding smp_read_barrier_depends(). The following PATCH makes the change. Signed-off-by: Pranith Kumar --- net/ipv4/netfilter/arp_tables.c | 3 +-- net/ipv4/netfilter/ip_tables.c | 3 +-- net/ipv6/netfilter

[PATCH 10/16] perf: Replace smp_read_barrier_depends() with lockless_dereference()

2014-11-13 Thread Pranith Kumar
Recently lockless_dereference() was added which can be used in place of hard-coding smp_read_barrier_depends(). The following PATCH makes the change. Signed-off-by: Pranith Kumar --- kernel/events/core.c| 3 +-- kernel/events/uprobes.c | 8 2 files changed, 5 insertions(+), 6

[PATCH 11/16] seccomp: Replace smp_read_barrier_depends() with lockless_dereference()

2014-11-13 Thread Pranith Kumar
Recently lockless_dereference() was added which can be used in place of hard-coding smp_read_barrier_depends(). The following PATCH makes the change. Signed-off-by: Pranith Kumar --- kernel/seccomp.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/kernel/seccomp.c b

[PATCH 13/16] ksm: Replace smp_read_barrier_depends() with lockless_dereference()

2014-11-13 Thread Pranith Kumar
Recently lockless_dereference() was added which can be used in place of hard-coding smp_read_barrier_depends(). The following PATCH makes the change. Signed-off-by: Pranith Kumar --- mm/ksm.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/mm/ksm.c b/mm/ksm.c index

[PATCH 09/16] percpu: Replace smp_read_barrier_depends() with lockless_dereference()

2014-11-13 Thread Pranith Kumar
Recently lockless_dereference() was added which can be used in place of hard-coding smp_read_barrier_depends(). The following PATCH makes the change. Signed-off-by: Pranith Kumar --- include/linux/percpu-refcount.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/include

[PATCH 07/16] hyperv: Replace smp_read_barrier_depends() with lockless_dereference()

2014-11-13 Thread Pranith Kumar
Recently lockless_dereference() was added which can be used in place of hard-coding smp_read_barrier_depends(). The following PATCH makes the change. Signed-off-by: Pranith Kumar --- include/linux/hyperv.h | 9 - 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/include

[PATCH 12/16] task_work: Replace smp_read_barrier_depends() with lockless_dereference()

2014-11-13 Thread Pranith Kumar
Recently lockless_dereference() was added which can be used in place of hard-coding smp_read_barrier_depends(). The following PATCH makes the change. Signed-off-by: Pranith Kumar --- kernel/task_work.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/kernel/task_work.c b

[PATCH 06/16] assoc_array: Replace smp_read_barrier_depends() with lockless_dereference()

2014-11-13 Thread Pranith Kumar
code with smp_read_barrier_depends(). Signed-off-by: Pranith Kumar --- include/linux/assoc_array_priv.h | 11 +++ lib/assoc_array.c| 7 --- security/keys/keyring.c | 6 -- 3 files changed, 7 insertions(+), 17 deletions(-) diff --git a/inc

[PATCH 08/16] rcupdate: Replace smp_read_barrier_depends() with lockless_dereference()

2014-11-13 Thread Pranith Kumar
Recently lockless_dereference() was added which can be used in place of hard-coding smp_read_barrier_depends(). The following PATCH makes the change. Signed-off-by: Pranith Kumar --- include/linux/rcupdate.h | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/include

[PATCH 03/16] drivers: dma: Replace smp_read_barrier_depends() with lockless_dereference()

2014-11-13 Thread Pranith Kumar
Recently lockless_dereference() was added which can be used in place of hard-coding smp_read_barrier_depends(). The following PATCH makes the change. Signed-off-by: Pranith Kumar --- drivers/dma/ioat/dma_v2.c | 3 +-- drivers/dma/ioat/dma_v3.c | 3 +-- 2 files changed, 2 insertions(+), 4

[PATCH 02/16] doc: memory-barriers.txt: Document use of lockless_dereference()

2014-11-13 Thread Pranith Kumar
Recently lockless_dereference() was added which can be used in place of hard-coding smp_read_barrier_depends(). The following PATCH makes the change. Signed-off-by: Pranith Kumar --- Documentation/memory-barriers.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a

[PATCH 05/16] overlayfs: Replace smp_read_barrier_depends() with lockless_dereference()

2014-11-13 Thread Pranith Kumar
Recently lockless_dereference() was added which can be used in place of hard-coding smp_read_barrier_depends(). The following PATCH makes the change. Signed-off-by: Pranith Kumar --- fs/overlayfs/super.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/fs/overlayfs/super.c

[PATCH 01/16] crypto: caam - Remove unnecessary smp_read_barrier_depends()

2014-11-13 Thread Pranith Kumar
Recently lockless_dereference() was added which can be used in place of hard-coding smp_read_barrier_depends(). The following PATCH makes the change. Signed-off-by: Pranith Kumar --- drivers/crypto/caam/jr.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/crypto/caam/jr.c b

Re: [PATCH 16/16] rxrpc: Replace smp_read_barrier_depends() with lockless_dereference()

2014-11-13 Thread Pranith Kumar
On 11/13/2014 03:47 PM, David Howells wrote: > Pranith Kumar wrote: > >> Recently lockless_dereference() was added which can be used in place of >> hard-coding smp_read_barrier_depends(). The following PATCH makes the change. > > Actually, the use of smp_read_barri

[RFC PATCH] printk: Use ACCESS_ONCE() instead of a volatile type

2014-11-13 Thread Pranith Kumar
volatile accesses entirely here, but for now make a safer change of using ACCESS_ONCE(). Signed-off-by: Pranith Kumar --- kernel/printk/printk.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/kernel/printk/printk.c b/kernel/printk/printk.c index e748971..4790191 100644

Re: [RFC PATCH] printk: Use ACCESS_ONCE() instead of a volatile type

2014-11-13 Thread Pranith Kumar
On Thu, Nov 13, 2014 at 10:47 PM, Steven Rostedt wrote: > On Thu, 13 Nov 2014 22:21:21 -0500 > Pranith Kumar wrote: > >> Remove volatile type qualifier and use ACCESS_ONCE() in its place for each >> access. Using volatile is not recommended as documented in >> Docume

Re: [PATCH 09/16] percpu: Replace smp_read_barrier_depends() with lockless_dereference()

2014-11-14 Thread Pranith Kumar
On Fri, Nov 14, 2014 at 8:14 AM, Tejun Heo wrote: > > How should this be routed? There's a pending change on the same > region of code and if this patch is routed outside percpu tree it'd > cause a conflict and I can't route this as lockless_dereference() > isn't in the mainline yet. Maybe expos

Re: [RFC PATCH] printk: Use ACCESS_ONCE() instead of a volatile type

2014-11-14 Thread Pranith Kumar
On 11/14/2014 11:39 AM, Alex Elder wrote: > On 11/13/2014 11:24 PM, Steven Rostedt wrote: >> On Thu, 13 Nov 2014 23:57:22 -0500 >> Steven Rostedt wrote: >> >>> That assignment is what it is initialized to at boot up. I can't see >>> any optimization that would cause gcc to modify that. Especially

[RFC PATCH] cpuidle: Use a lighter barrier in snooze_loop()

2014-11-15 Thread Pranith Kumar
Using smp_mb() here so that the bit clear is not reordered is an overkill. It is more appropriate to use smp_mb__after_atomic() which ensures that the bit clear is not reordered. Signed-off-by: Pranith Kumar --- drivers/cpuidle/cpuidle-powernv.c | 3 ++- 1 file changed, 2 insertions(+), 1

Re: [PATCH tip/core/rcu 3/9] drivers/md: Use rcu_dereference() for accessing rcu pointer

2014-11-21 Thread Pranith Kumar
On 11/21/2014 08:31 AM, Kirill A. Shutemov wrote: > On Tue, Oct 28, 2014 at 03:09:56PM -0700, Paul E. McKenney wrote: >> From: Pranith Kumar >> >> Got Paul's email wrong the first time. >> >> The map field in 'struct mapped_device' is an rcu point

[PATCH v2 1/9] doc: memory-barriers.txt: Document use of lockless_dereference()

2014-11-21 Thread Pranith Kumar
Recently lockless_dereference() was added which can be used in place of hard-coding smp_read_barrier_depends(). The following PATCH makes the change. Signed-off-by: Pranith Kumar --- Documentation/memory-barriers.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a

[PATCH v2 2/9] drivers: dma: Replace smp_read_barrier_depends() with lockless_dereference()

2014-11-21 Thread Pranith Kumar
Recently lockless_dereference() was added which can be used in place of hard-coding smp_read_barrier_depends(). The following PATCH makes the change. Signed-off-by: Pranith Kumar --- drivers/dma/ioat/dma_v2.c | 3 +-- drivers/dma/ioat/dma_v3.c | 3 +-- 2 files changed, 2 insertions(+), 4

[PATCH v2 9/9] netfilter: Replace smp_read_barrier_depends() with lockless_dereference()

2014-11-21 Thread Pranith Kumar
Recently lockless_dereference() was added which can be used in place of hard-coding smp_read_barrier_depends(). The following PATCH makes the change. Signed-off-by: Pranith Kumar --- net/ipv4/netfilter/arp_tables.c | 3 +-- net/ipv4/netfilter/ip_tables.c | 3 +-- net/ipv6/netfilter

[PATCH v2 3/9] dcache: Replace smp_read_barrier_depends() with lockless_dereference()

2014-11-21 Thread Pranith Kumar
Recently lockless_dereference() was added which can be used in place of hard-coding smp_read_barrier_depends(). The following PATCH makes the change. Signed-off-by: Pranith Kumar --- fs/dcache.c | 7 ++- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/fs/dcache.c b/fs/dcache.c

[PATCH v2 8/9] task_work: Replace smp_read_barrier_depends() with lockless_dereference()

2014-11-21 Thread Pranith Kumar
Recently lockless_dereference() was added which can be used in place of hard-coding smp_read_barrier_depends(). The following PATCH makes the change. Signed-off-by: Pranith Kumar --- kernel/task_work.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/kernel/task_work.c b

[PATCH v2 4/9] hyperv: Replace smp_read_barrier_depends() with lockless_dereference()

2014-11-21 Thread Pranith Kumar
Recently lockless_dereference() was added which can be used in place of hard-coding smp_read_barrier_depends(). The following PATCH makes the change. Signed-off-by: Pranith Kumar --- include/linux/hyperv.h | 9 - 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/include

[PATCH v2 7/9] seccomp: Replace smp_read_barrier_depends() with lockless_dereference()

2014-11-21 Thread Pranith Kumar
Recently lockless_dereference() was added which can be used in place of hard-coding smp_read_barrier_depends(). The following PATCH makes the change. Signed-off-by: Pranith Kumar --- kernel/seccomp.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/kernel/seccomp.c b

[PATCH v2 6/9] perf: Replace smp_read_barrier_depends() with lockless_dereference()

2014-11-21 Thread Pranith Kumar
Recently lockless_dereference() was added which can be used in place of hard-coding smp_read_barrier_depends(). The following PATCH makes the change. Signed-off-by: Pranith Kumar --- kernel/events/core.c| 3 +-- kernel/events/uprobes.c | 8 2 files changed, 5 insertions(+), 6

[PATCH v2 5/9] percpu: Replace smp_read_barrier_depends() with lockless_dereference()

2014-11-21 Thread Pranith Kumar
Recently lockless_dereference() was added which can be used in place of hard-coding smp_read_barrier_depends(). The following PATCH makes the change. Signed-off-by: Pranith Kumar --- include/linux/percpu-refcount.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/include

[PATCH v2 0/9] Replace smp_read_barrier_depends() with lockless_derefrence()

2014-11-21 Thread Pranith Kumar
. I will send in separate patches/questions regarding them. Pranith Kumar (9): doc: memory-barriers.txt: Document use of lockless_dereference() drivers: dma: Replace smp_read_barrier_depends() with lockless_dereference() dcache: Replace smp_read_barrier_depends() with lockless_dereference

Re: [PATCH v2 7/9] seccomp: Replace smp_read_barrier_depends() with lockless_dereference()

2014-11-21 Thread Pranith Kumar
On 11/21/2014 11:33 AM, Kees Cook wrote: > On Fri, Nov 21, 2014 at 7:06 AM, Pranith Kumar wrote: >> Recently lockless_dereference() was added which can be used in place of >> hard-coding smp_read_barrier_depends(). The following PATCH makes the change. >> >> S

[RFC PATCH] rcu: Add sparse check for RCU_INIT_POINTER()

2014-09-25 Thread Pranith Kumar
Add a sparse check when RCU_INIT_POINTER() is used to assign a non __rcu annotated pointer. Signed-off-by: Pranith Kumar --- include/linux/rcupdate.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h index a4a819f..a033d8b 100644 --- a

Re: [RFC PATCH] rcu: Add sparse check for RCU_INIT_POINTER()

2014-09-25 Thread Pranith Kumar
On Thu, Sep 25, 2014 at 2:10 PM, wrote: > On Thu, Sep 25, 2014 at 02:03:34PM -0400, Pranith Kumar wrote: >> Add a sparse check when RCU_INIT_POINTER() is used to assign a non __rcu >> annotated pointer. >> >> Signed-off-by: Pranith Kumar > > Have you checked

[PATCH] dm: sparse: Annotate field with __rcu for checking

2014-09-25 Thread Pranith Kumar
Annotate the map field with __rcu since this is a rcu pointer which is checked by sparse. Signed-off-by: Pranith Kumar --- drivers/md/dm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/md/dm.c b/drivers/md/dm.c index 32b958d..746411b 100644 --- a/drivers/md/dm.c

[PATCH] drivers/md: Use rcu_dereference() for accessing rcu pointer

2014-09-28 Thread Pranith Kumar
The map field in 'struct mapped_device' is an rcu pointer. Use rcu_dereference() while accessing it. Signed-off-by: Pranith Kumar --- drivers/md/dm.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/md/dm.c b/drivers/md/dm.c index 746411b..fbdf0bb 10

[RESEND PATCH] drivers/md: Use rcu_dereference() for accessing rcu pointer

2014-09-28 Thread Pranith Kumar
Got Paul's email wrong the first time. The map field in 'struct mapped_device' is an rcu pointer. Use rcu_dereference() while accessing it. Signed-off-by: Pranith Kumar --- drivers/md/dm.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/md/dm

Re: [PATCH tip/core/rcu 06/17] rcu: Eliminate read-modify-write ACCESS_ONCE() calls

2014-07-08 Thread Pranith Kumar
ore, but not both. In a few > cases, ACCESS_ONCE() was not critical, for example, for maintaining > statisitics. In these cases, ACCESS_ONCE() has been dispensed with > entirely. > Is there any reason why |=, &= cannot be replaced similarly? Also there are a few more in tree_plugi

[PATCH 1/1] rcutorture: fixes for printing message buffer

2014-07-11 Thread Pranith Kumar
script as follows: $ dmesg | grep torture > log.txt $ bash parse-torture.sh log.txt test $ There were no warnings which means that parsing went fine. Signed-off-by: Pranith Kumar cc: Joe Perches Link: https://lkml.org/lkml/2014/6/18/604 --- include/linux/torture.h | 2 +- kernel/

Re: [PATCH 1/1] rcutorture: fixes for printing message buffer

2014-07-11 Thread Pranith Kumar
On Fri, Jul 11, 2014 at 4:37 PM, Joe Perches wrote: > On Fri, 2014-07-11 at 16:30 -0400, Pranith Kumar wrote: >> Use snprintf() instead of sprintf() for writing to the message buffer. >> Also use vmalloc() for the allocation of the message buffer. Since >> pr_alert() i

[PATCH 1/1] rcutorture: use bash shell for all the test scripts

2014-07-11 Thread Pranith Kumar
explicitly. Signed-off-by: Pranith Kumar --- tools/testing/selftests/rcutorture/bin/config2frag.sh | 4 ++-- tools/testing/selftests/rcutorture/bin/configcheck.sh | 4 ++-- tools/testing/selftests/rcutorture/bin/configinit.sh | 4 ++-- tools/testing/selftests/rcutorture/bin/kvm

Re: [RFC PATCH 1/1] rcu: use atomic_read(v) instead of atomic_add_return(0, v)

2014-07-11 Thread Pranith Kumar
On Fri, Jul 11, 2014 at 5:43 AM, Paul E. McKenney wrote: > On Thu, Jul 10, 2014 at 09:17:33PM -0400, Pranith Kumar wrote: >> On Wed, Jul 9, 2014 at 3:56 PM, Paul E. McKenney >> wrote: >> >> > OK, so ->dynticks_snap is accessed by only one task, namely the &g

Re: [PATCH 1/1] rcutorture: use bash shell for all the test scripts

2014-07-11 Thread Pranith Kumar
On Fri, Jul 11, 2014 at 7:23 PM, wrote: > On Fri, Jul 11, 2014 at 05:31:27PM -0400, Pranith Kumar wrote: >> Some of the scripts encode a default /bin/sh shell. On systems which use >> dash as >> default shell, these scripts fail as they are bash scripts. I encountered >

[PATCH 1/1] rcutorture: set executable bit and drop bash from Usage

2014-07-11 Thread Pranith Kumar
This patch is on top of the previous changes. Set the executable bit on test scripts config2frag.sh and kvm.sh Since #!/bin/bash is set in all the scripts, drop it from the usage line as the scripts can be invoked directly. Signed-off-by: Pranith Kumar --- tools/testing/selftests/rcutorture

[PATCH 1/1] scripts/get_maintainer: increase threshold for --follow to reduce time

2014-07-12 Thread Pranith Kumar
. Time take dropped from 24 sec to 12 sec after this change. It can be reduced further by increasing the threshold, but I think 90% is sufficient. Signed-off-by: Pranith Kumar --- scripts/get_maintainer.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts

[PATCH 1/1] doc: fix docbook generation

2014-07-12 Thread Pranith Kumar
kernel/timer.c and kernel/hrtimer.c have moved to kernel/time directory. This causes docbook generation to fail. The following commit fixes it by updating the references. Signed-off-by: Pranith Kumar --- Documentation/DocBook/device-drivers.tmpl | 4 ++-- 1 file changed, 2 insertions(+), 2

Re: [PATCH 1/1] rcutorture: fixes for printing message buffer

2014-07-14 Thread Pranith Kumar
On 07/11/2014 04:37 PM, Joe Perches wrote: > On Fri, 2014-07-11 at 16:30 -0400, Pranith Kumar wrote: >> Use snprintf() instead of sprintf() for writing to the message buffer. >> Also use vmalloc() for the allocation of the message buffer. Since >> pr_alert() is >> li

Re: [RFC PATCH 1/1] rcu: use atomic_read(v) instead of atomic_add_return(0, v)

2014-07-14 Thread Pranith Kumar
On Sat, Jul 12, 2014 at 8:08 AM, Paul E. McKenney wrote: > > They ensure that any RCU read-side critical sections that took place before > the current (or previous) idle/userspace period on the remote CPU in > question are seen as having completed before the completion of the current > grace period

Re: [PATCH RFC tip/core/rcu 2/2] rcu: Create rcuo kthreads only for onlined CPUs

2014-07-14 Thread Pranith Kumar
On 07/14/2014 06:06 AM, Paul E. McKenney wrote: > From: "Paul E. McKenney" > > RCU currently uses for_each_possible_cpu() to spawn rcuo kthreads, > which can result in more rcuo kthreads than one would expect, for > example, derRichard reported 64 CPUs worth of rcuo kthreads on an > 8-CPU image.

[PATCH 1/1] doc: cpu-hotplug.txt: Minor grammar fix

2014-07-14 Thread Pranith Kumar
fix minor grammar in sentence Signed-off-by: Pranith Kumar --- Documentation/cpu-hotplug.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/cpu-hotplug.txt b/Documentation/cpu-hotplug.txt index a0b005d..2ec86f6 100644 --- a/Documentation/cpu-hotplug.txt +++ b

[PATCH 2/3] rcu: Remove stale comment in tree.c

2014-07-15 Thread Pranith Kumar
This commit removes a stale comment in rcu/tree.c. FYI, an updated comment exists a few lines below this. Signed-off-by: Pranith Kumar --- kernel/rcu/tree.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c index a1abaa8..e67246e 100644 --- a/kernel/rcu

[PATCH 1/3] rcu: tiny.c: Update reference to tree.c

2014-07-15 Thread Pranith Kumar
This commit updates the references to rcutree.c which is now rcu/tree.c Signed-off-by: Pranith Kumar --- kernel/rcu/tiny.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kernel/rcu/tiny.c b/kernel/rcu/tiny.c index d9efcc1..6bd785c 100644 --- a/kernel/rcu/tiny.c +++ b

[PATCH 3/3] rcu: Use rcu_num_nodes instead of NUM_RCU_NODES

2014-07-15 Thread Pranith Kumar
NUM_RCU_NODES to rcu_num_nodes. Signed-off-by: Pranith Kumar --- kernel/rcu/tree_plugin.h | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/kernel/rcu/tree_plugin.h b/kernel/rcu/tree_plugin.h index cedb020..17ccb62 100644 --- a/kernel/rcu/tree_plugin.h +++ b/kernel/rcu

Re: [PATCH 2/3] rcu: Remove stale comment in tree.c

2014-07-15 Thread Pranith Kumar
On 07/15/2014 06:53 PM, j...@joshtriplett.org wrote: > On Tue, Jul 15, 2014 at 06:31:48PM -0400, Pranith Kumar wrote: >> This commit removes a stale comment in rcu/tree.c. >> FYI, an updated comment exists a few lines below this. >> >> Signed-off-by: Pranith Kumar &g

[PATCH v3] memfd_test: Make it work on 32-bit systems

2014-09-03 Thread Pranith Kumar
This test currently fails on 32-bit systems since we use u64 type to pass the flags to fcntl. This commit changes this to use 'unsigned int' type for flags to fcntl making it work on 32-bit systems. Signed-off-by: Pranith Kumar Reviewed-by: David Herrmann --- tools/testing/selft

Re: [PATCH v2] memfd_test: Make it work on 32-bit systems

2014-09-03 Thread Pranith Kumar
On Wed, Sep 3, 2014 at 1:53 AM, David Herrmann wrote: > Sorry for the bike-shedding. Patch looks good, otherwise. With, or > without, this changed, this is: > > Reviewed-by: David Herrmann > Thank you for the review David. I will send in a new patch with your suggested changes. -- Pranith --

Re: Bogus error in checkpatch.pl

2014-09-03 Thread Pranith Kumar
On 09/03/2014 01:34 AM, Joe Perches wrote: > Maybe. Suggest a modified message. > How about the following? diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index b602ed2..bcc384e 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -2143,7 +2143,7 @@ sub process {

Re: [PATCH] selftests/memfd: fix mfd_fail_open() to pass in buf to printf

2014-09-04 Thread Pranith Kumar
On Thu, Sep 4, 2014 at 11:07 AM, Shuah Khan wrote: > mfd_fail_open() doesn't pass in the buffer to printf resulting > in the following warning: > > memfd_test.c: In function ‘mfd_fail_open’: > memfd_test.c:208:3: warning: format ‘%s’ expects a matching ‘char *’ argument > [-Wformat=] >printf(

[PATCH Resend] memfd_test: Add missing argument to printf()

2014-09-04 Thread Pranith Kumar
Add a missing path argument buf to printf() Signed-off-by: Pranith Kumar Reviewed-by: David Herrmann --- tools/testing/selftests/memfd/memfd_test.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/testing/selftests/memfd/memfd_test.c b/tools/testing/selftests/memfd

Question reg. asm/qrwlock.h

2014-09-05 Thread Pranith Kumar
Hi Waiman, I see that in arch/x86/include/asm/qrwlock.h, there is this snippet within #ifndef CONFIG_X86_PPRO_FENCE #define queue_write_unlock queue_write_unlock static inline void queue_write_unlock(struct qrwlock *lock) { barrier(); ACCESS_ONCE(*(u8 *)&lock->cnts) = 0; } #endif

[PATCH] selftests/memfd: Run test on all architectures

2014-09-15 Thread Pranith Kumar
Remove the dependence on x86 to run the memfd test. Verfied on 32-bit powerpc. Signed-off-by: Pranith Kumar --- tools/testing/selftests/memfd/Makefile | 21 - 1 file changed, 21 deletions(-) diff --git a/tools/testing/selftests/memfd/Makefile b/tools/testing/selftests

Re: [PATCH] serial: Fix build failure caused by missing header file

2014-08-25 Thread Pranith Kumar
On Mon, Aug 25, 2014 at 4:13 PM, Greg Kroah-Hartman wrote: > Where is this failing? What arch? What kernel version did it show up > in (i.e. what commit caused this problem?) > This was a randconfig on powerpc. I did not bisect as to which commit introduced this since it is a simple missing he

Re: [PATCH 00/16] rcu: Some minor fixes and cleanups

2014-08-26 Thread Pranith Kumar
On Wed, Jul 23, 2014 at 10:45 AM, Paul E. McKenney wrote: > On Wed, Jul 23, 2014 at 01:09:37AM -0400, Pranith Kumar wrote: >> Hi Paul, >> >> This is a series of minor fixes and cleanup patches which I found while >> studying >> the code. All my previous pending

Re: [PATCH tip/core/rcu 1/2] rcu: Parallelize and economize NOCB kthread wakeups

2014-08-27 Thread Pranith Kumar
On Wed, Aug 27, 2014 at 12:21 PM, Paul E. McKenney wrote: > On Wed, Aug 27, 2014 at 10:13:50AM +0530, Amit Shah wrote: >> >> Yes, this patch helps my case as well. > > Very good!!! > > Pranith, I can take this patch, but would you be willing to invert > the sense of ->nocb_leader_wake (e.g., call

[PATCH] rcu: Make nocb leader kthreads process pending callbacks after spawning

2014-08-27 Thread Pranith Kumar
ads to run immediately after spawning instead of waiting. This is done by inverting the logic of nocb_leader_wake tests to nocb_leader_sleep which allows us to use the default initialization of this flag to 0 to let the kthreads run. Reported-by: Amit Shah Signed-off-by: Pranith Kumar

Re: [PATCH] rcu: Make nocb leader kthreads process pending callbacks after spawning

2014-08-27 Thread Pranith Kumar
On Wed, Aug 27, 2014 at 5:47 PM, Paul E. McKenney wrote: > > Thank you, Pranith, queued. I have also backported to v3.17-rc2, > and am testing both. A sneak preview of the backport is shown below, > please let me know if you see any problems with it. (The reason for > the backport is to submit

Re: [PATCH] doc: memory-barriers.txt: Correct example for reorderings

2014-08-28 Thread Pranith Kumar
On Thu, Aug 28, 2014 at 5:00 PM, Paul E. McKenney wrote: > > I am really confused by the ordering of the new lines, as I would have > expected the "x"s to be replaced with "y"s and vice versa. But the > ordering of the various combinations does not matter, and each line > looks OK. > Since x = A

Re: [PATCH] doc: memory-barriers.txt: Correct example for reorderings

2014-08-28 Thread Pranith Kumar
On Thu, Aug 28, 2014 at 5:39 PM, Paul E. McKenney wrote: > On Thu, Aug 28, 2014 at 05:15:50PM -0400, Pranith Kumar wrote: >> On Thu, Aug 28, 2014 at 5:00 PM, Paul E. McKenney >> wrote: >> > >> > I am really confused by the ordering of the new lines, as I would

[RFC PATCH] powerpc: Wire up three syscalls

2014-08-29 Thread Pranith Kumar
work? Any advice is really appreciated! :) Signed-off-by: Pranith Kumar --- arch/powerpc/include/asm/systbl.h | 3 +++ arch/powerpc/include/asm/unistd.h | 2 +- arch/powerpc/include/uapi/asm/unistd.h | 3 +++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/arch/powerpc

Re: [RFC PATCH] powerpc: Wire up three syscalls

2014-08-31 Thread Pranith Kumar
Hi Geert, On Sun, Aug 31, 2014 at 4:53 AM, Geert Uytterhoeven wrote: > Hi Pranith, > > On Sat, Aug 30, 2014 at 5:36 AM, Pranith Kumar wrote: >> I see that the three syscalls seccomp, getrandom and memfd_create are not >> wired >> because of which we get a warning wh

Re: [RFC PATCH] powerpc: Wire up three syscalls

2014-08-31 Thread Pranith Kumar
ow? Thanks! -- Pranith From: Pranith Kumar Date: Sun, 31 Aug 2014 13:38:07 -0400 Subject: [PATCH] memfd_test: Make it work on 32-bit systems This test currently fails on 32-bit systems since we use u64 type to pass the flags to fcntl. This commit changes this to use u32 type for flags to f

[PATCH] memfd_test: Add missing argument to printf()

2014-08-31 Thread Pranith Kumar
Add a missing path argument buf to printf() Signed-off-by: Pranith Kumar --- tools/testing/selftests/memfd/memfd_test.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/testing/selftests/memfd/memfd_test.c b/tools/testing/selftests/memfd/memfd_test.c index 3634c90

Re: [RFC PATCH] powerpc: Wire up three syscalls

2014-09-01 Thread Pranith Kumar
Hi David, On Mon, Sep 1, 2014 at 7:33 AM, David Herrmann wrote: > > Nice catch. We changed 'flags' from u64 to "unsigned int" in the last > revision of the series. Patch looks good, but I'd prefer using > "unsigned int" as type, instead of __u32. Just to be consistent with > the syscall interface

[PATCH v2] memfd_test: Make it work on 32-bit systems

2014-09-01 Thread Pranith Kumar
This test currently fails on 32-bit systems since we use u64 type to pass the flags to fcntl. This commit changes this to use 'unsigned int' type for flags to fcntl making it work on 32-bit systems. Signed-off-by: Pranith Kumar --- v2: use 'unsigned int' instead of u32 too

<    1   2   3   4   5   >