[PATCH v3 3/5] rcu/tree: Clean up dynticks counter usage

2020-05-04 Thread Joel Fernandes (Google)
do cheaper comparisons with zero instead for the code that keeps the tick on in rcu_nmi_enter_common(). In the next patch, both of the concerns of (2) will be addressed and then we can get rid of dynticks_nmi_nesting, however one step at a time. Signed-off-by: Joel Fernandes (Google) --- kernel/rcu/r

[PATCH v3 5/5] trace: events: rcu: Change description of rcu_dyntick trace event

2020-05-04 Thread Joel Fernandes (Google)
for rcu_dyntick. Similarly, USER, IDLE and IRQ are used for describing context in the rcu_dyntick tracepoints. Since, "KERNEL" is not used for any of the rcu_dyntick tracepoints, remove it from the description. Signed-off-by: Madhuparna Bhowmik Signed-off-by: Joel Fernandes (Google) --

[PATCH v3 2/5] rcu/tree: Add better tracing for dyntick-idle

2020-05-04 Thread Joel Fernandes (Google)
" or "IRQ". (2) Remove the "++=" and "--=" strings and replace them with "StillNonIdle". This is much easier on the eyes, and the -- and ++ are easily apparent in the dynticks_nesting counters we are printing anyway. Signed-off-by: J

[PATCH v3 4/5] rcu/tree: Remove dynticks_nmi_nesting counter

2020-05-04 Thread Joel Fernandes (Google)
have been set to true in the outermost interrupt, so the nested/NMI interrupts will check forced_tick anyway, and bail. Signed-off-by: Joel Fernandes (Google) --- .../Data-Structures/Data-Structures.rst | 31 --- Documentation/RCU/stallwarn.rst | 6 +-- kernel/rcu/tree.c

[PATCH v3 1/5] Revert b8c17e6664c4 ("rcu: Maintain special bits at bottom of ->dynticks counter")

2020-05-04 Thread Joel Fernandes (Google)
This code is unused and can be removed now. Revert was straightforward. Tested with rcutorture on all TREE configurations. Link: http://lore.kernel.org/r/CALCETrWNPOOdTrFabTDd=h7+wc6xj9rjceg6ol1s0rtv5pf...@mail.gmail.com Suggested-by: Andy Lutomirski Signed-off-by: Joel Fernandes (Google

[PATCH v3 0/5] RCU dyntick nesting counter cleanups for rcu -dev

2020-05-04 Thread Joel Fernandes (Google)
is not a simple counter and can be "crowbarred" in common situations. rcutorture testing with all TREE RCU configurations succeed with CONFIG_RCU_EQS_DEBUG=y and CONFIG_PROVE_LOCKING=y. v1->v2: - Rebase on v5.6-rc6 v2->v3: - Rebase on rcu/dev with adjustments for tasks-RCU. Joel Ferna

[tip: perf/core] perf_event: Add support for LSM and SELinux checks

2019-10-18 Thread tip-bot2 for Joel Fernandes (Google)
The following commit has been merged into the perf/core branch of tip: Commit-ID: da97e18458fb42d7c00fac5fd1c56a3896ec666e Gitweb: https://git.kernel.org/tip/da97e18458fb42d7c00fac5fd1c56a3896ec666e Author:Joel Fernandes (Google) AuthorDate:Mon, 14 Oct 2019 13:03:08 -04

[PATCH v2] perf_event: Add support for LSM and SELinux checks

2019-10-14 Thread Joel Fernandes (Google)
...@google.com Cc: kernel-t...@android.com Acked-by: James Morris Co-developed-by: Peter Zijlstra Suggested-by: Peter Zijlstra Signed-off-by: Joel Fernandes (Google) --- Changes since v1: o Fixes from Peter Ziljstra. o Added Ack from James Morris and Co-developed-by tag for Peter. Changes since RFC

[PATCH] perf_event: Add support for LSM and SELinux checks

2019-10-11 Thread Joel Fernandes (Google)
: rsavit...@google.com Cc: je...@google.com Cc: kernel-t...@android.com Signed-off-by: Joel Fernandes (Google) --- Changes since RFC: o Small nits, style changes (James Morris). o Consolidation of code (Peter Zijlstra). arch/x86/events/intel/bts.c | 8 ++-- arch/x86/events/intel/core.c

[PATCH RFC] perf_event: Add support for LSM and SELinux checks

2019-10-09 Thread Joel Fernandes (Google)
: rsavit...@google.com Cc: je...@google.com Cc: kernel-t...@android.com Signed-off-by: Joel Fernandes (Google) --- arch/x86/events/intel/bts.c | 5 +++ arch/x86/events/intel/core.c| 5 +++ arch/x86/events/intel/p4.c | 5 +++ include/linux/lsm_hooks.h | 15

[PATCH] Remove GP_REPLAY state from rcu_sync

2019-10-04 Thread Joel Fernandes (Google)
rg Signed-off-by: Joel Fernandes (Google) --- kernel/rcu/sync.c | 14 ++ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/kernel/rcu/sync.c b/kernel/rcu/sync.c index d4558ab7a07d..4f3aad67992c 100644 --- a/kernel/rcu/sync.c +++ b/kernel/rcu/sync.c @@ -10,7 +10,7 @@

[PATCH] MAINTAINERS: Add me for Linux Kernel memory consistency model (LKMM)

2019-10-02 Thread Joel Fernandes (Google)
Quite interested in the LKMM, I have submitted patches before and used it a lot. I would like to be a part of the maintainers for this project. Cc: Paul McKenney Suggested-by: Alan Stern Signed-off-by: Joel Fernandes (Google) --- MAINTAINERS | 1 + 1 file changed, 1 insertion(+) diff --git

[PATCH v3] mm: emit tracepoint when RSS changes

2019-10-01 Thread Joel Fernandes (Google)
plete type struct trace_entry ent;\ Link: http://lore.kernel.org/r/20190903200905.198642-1-j...@joelfernandes.org Acked-by: Michal Hocko Co-developed-by: Tim Murray Signed-off-by: Tim Murray Signed-off-by: Joel Fernandes (Google) --- v2->v3: Removed optimization for rate limitting and we c

[PATCH] binder: Fix comment headers on binder_alloc_prepare_to_free()

2019-09-30 Thread Joel Fernandes (Google)
binder_alloc_buffer_lookup() doesn't exist and is named "binder_alloc_prepare_to_free()". Correct the code comments to reflect this. Signed-off-by: Joel Fernandes (Google) --- drivers/android/binder_alloc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drive

[PATCH v2] mm: emit tracepoint when RSS changes by threshold

2019-09-03 Thread Joel Fernandes (Google)
Fernandes (Google) --- v1->v2: Added more commit message. Cc: carmenjack...@google.com Cc: mayankgu...@google.com Cc: dan...@google.com Cc: rost...@goodmis.org Cc: minc...@kernel.org Cc: a...@linux-foundation.org Cc: kernel-t...@android.com include/linux/mm.h |

[PATCH] mm: emit tracepoint when RSS changes by threshold

2019-09-03 Thread Joel Fernandes (Google)
by mm_struct. o Keep overhead low by checking if tracing is enabled. o Add some noise reduction and lower overhead by emitting only on threshold changes. Co-developed-by: Tim Murray Signed-off-by: Tim Murray Signed-off-by: Joel Fernandes (Google) --- Cc: carmenjack...@google.com Cc: mayankgu

[PATCH 1/2] pci: Convert to use built-in RCU list checking

2019-08-30 Thread Joel Fernandes (Google)
CONFIG_PROVE_RCU_LIST requires list_for_each_entry_rcu() to pass a lockdep expression if using srcu or locking for protection. It can only check regular RCU protection, all other protection needs to be passed as lockdep expression. Signed-off-by: Joel Fernandes (Google) --- drivers/pci

[PATCH 2/2] ipc/sem: Convert to use built-in RCU list checking

2019-08-30 Thread Joel Fernandes (Google)
CONFIG_PROVE_RCU_LIST requires list_for_each_entry_rcu() to pass a lockdep expression if using srcu or locking for protection. It can only check regular RCU protection, all other protection needs to be passed as lockdep expression. Signed-off-by: Joel Fernandes (Google) --- ipc/sem.c | 3 ++- 1

[PATCH v2 -rcu dev 2/5] rcu/tree: Add multiple in-flight batches of kfree_rcu work

2019-08-30 Thread Joel Fernandes (Google)
more than 1 additional list did not show any improvement. Suggested-by: Paul E. McKenney Signed-off-by: Joel Fernandes (Google) --- kernel/rcu/tree.c | 80 +-- 1 file changed, 56 insertions(+), 24 deletions(-) diff --git a/kernel/rcu/tree.c b/kernel

[PATCH v2 -rcu dev 0/5] kfree_rcu() additions for -rcu

2019-08-30 Thread Joel Fernandes (Google)
y" handling from tree RCU as suggested by Paul which will be unused. Based on patch: Link: http://lore.kernel.org/r/20190814160411.58591-1-j...@joelfernandes.org v1 series: https://lkml.org/lkml/2019/8/27/1315 https://lore.kernel.org/patchwork/project/lkml/list/?series=408218 Jo

[PATCH v2 -rcu dev 5/5] rcu: Remove kfree_call_rcu_nobatch()

2019-08-30 Thread Joel Fernandes (Google)
Now that kfree_rcu() special casing have been removed from tree RCU, remove kfree_call_rcu_nobatch() since it is not needed. Signed-off-by: Joel Fernandes (Google) --- .../admin-guide/kernel-parameters.txt | 4 --- include/linux/rcutiny.h | 5 --- include/linux

[PATCH v2 -rcu dev 3/5] rcu/tree: Add support for debug_objects debugging for kfree_rcu()

2019-08-30 Thread Joel Fernandes (Google)
() calls. Signed-off-by: Joel Fernandes (Google) --- kernel/rcu/tree.c | 8 1 file changed, 8 insertions(+) diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c index 2e1772469de9..de13805d1bd0 100644 --- a/kernel/rcu/tree.c +++ b/kernel/rcu/tree.c @@ -2757,6 +2757,7 @@ static void

[PATCH v2 -rcu dev 4/5] rcu: Remove kfree_rcu() special casing and lazy handling

2019-08-30 Thread Joel Fernandes (Google)
Remove kfree_rcu() special casing and lazy handling from RCU. For Tiny RCU we fold the special handling into just Tiny RCU code. Results in a nice negative delta as well. Suggested-by: Paul E. McKenney Signed-off-by: Joel Fernandes (Google) --- Documentation/RCU/stallwarn.txt | 11

[PATCH v2 -rcu dev 1/5] rcu/rcuperf: Add kfree_rcu() performance Tests

2019-08-30 Thread Joel Fernandes (Google)
by using multiple lists. Also, when running the test, please disable CONFIG_DEBUG_PREEMPT and CONFIG_PROVE_RCU for realistic comparisons with/without batching. Signed-off-by: Joel Fernandes (Google) --- .../admin-guide/kernel-parameters.txt | 17 ++ kernel/rcu/rcuperf.c

[PATCH v2 -rcu dev 2/2] rcu/dyntick-idle: Add better tracing

2019-08-30 Thread Joel Fernandes (Google)
" or "IRQ". (2) Remove the "++=" and "--=" strings and replace them with "StillNonIdle". This is much easier on the eyes, and the -- and ++ are easily apparent in the dynticks_nesting counters we are printing anyway. Signed-off-by: J

[PATCH v2 -rcu dev 1/2] Revert b8c17e6664c4 ("rcu: Maintain special bits at bottom of ->dynticks counter")

2019-08-30 Thread Joel Fernandes (Google)
This code is unused and can be removed now. Revert was straightforward. Tested with light rcutorture. Link: http://lore.kernel.org/r/CALCETrWNPOOdTrFabTDd=h7+wc6xj9rjceg6ol1s0rtv5pf...@mail.gmail.com Suggested-by: Andy Lutomirski Signed-off-by: Joel Fernandes (Google) --- Only made some

[PATCH -rcu dev 1/2] Revert b8c17e6664c4 ("rcu: Maintain special bits at bottom of ->dynticks counter")

2019-08-30 Thread Joel Fernandes (Google)
This code is unused and can be removed now. Revert was straightforward. Tested with light rcutorture. Link: http://lore.kernel.org/r/CALCETrWNPOOdTrFabTDd=h7+wc6xj9rjceg6ol1s0rtv5pf...@mail.gmail.com Suggested-by: Andy Lutomirski Signed-off-by: Joel Fernandes (Google) --- include/linux

[PATCH -rcu dev 2/2] rcu/dyntick-idle: Add better tracing

2019-08-30 Thread Joel Fernandes (Google)
on the previous patches to simplify rcu_dyntick counters [1] and with these traces, I have verified the counters are working properly. [1] Link: https://lore.kernel.org/patchwork/patch/1120021/ Link: https://lore.kernel.org/patchwork/patch/1120022/ Signed-off-by: Joel Fernandes (Google) --- incl

[PATCH 3/5] rcu/tree: Add support for debug_objects debugging for kfree_rcu()

2019-08-27 Thread Joel Fernandes (Google)
() calls. Signed-off-by: Joel Fernandes (Google) --- kernel/rcu/tree.c | 8 1 file changed, 8 insertions(+) diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c index 9b9ae4db1c2d..64568f12641d 100644 --- a/kernel/rcu/tree.c +++ b/kernel/rcu/tree.c @@ -2757,6 +2757,7 @@ static void

[RFC v1 1/2] rcu/tree: Clean up dynticks counter usage

2019-08-26 Thread Joel Fernandes (Google)
do cheaper comparisons with zero instead for the code that keeps the tick on in rcu_nmi_enter_common(). In the next patch, both of the concerns of (2) will be addressed and then we can get rid of dynticks_nmi_nesting, however one step at a time. Signed-off-by: Joel Fernandes (Google) --- kernel/rcu/r

[RFC v2] rcu/tree: Try to invoke_rcu_core() if in_irq() during unlock

2019-08-18 Thread Joel Fernandes (Google)
lse), then the "else" block will run to do the irq_work stuff. This commit is based on a partial revert of d143b3d1cd89 ("rcu: Simplify rcu_read_unlock_special() deferred wakeups") with an additional in_irq() check added. Signed-off-by: Joel Fernandes (Google) --- v1-&

[RFC] rcu/tree: Try to invoke_rcu_core() if in_irq() during unlock

2019-08-18 Thread Joel Fernandes (Google)
the "else" block will run to do the irq_work stuff. This commit is based on a partial revert of d143b3d1cd89 ("rcu: Simplify rcu_read_unlock_special() deferred wakeups") with an additional in_irq() check added. Signed-off-by: Joel Fernandes (Google) --- kernel/rcu/tree_plug

[PATCH -rcu/dev] Please squash: fixup! rcu/tree: Add basic support for kfree_rcu() batching

2019-08-16 Thread Joel Fernandes (Google)
xchg() on a bool is causing issues on riscv and arm32. Please squash this into the -rcu dev branch to resolve the issue. Please squash this fix. Fixes: -rcu dev commit 3cbd3aa7d9c7bdf ("rcu/tree: Add basic support for kfree_rcu() batching") Signed-off-by: Joel Fernandes (Google) -

[PATCH v2 -rcu dev 2/3] rcu/tree: Fix issue where sometimes rcu_urgent_qs is not set on IPI

2019-08-15 Thread Joel Fernandes (Google)
Sometimes I see rcu_urgent_qs is not set. This could be when the last IPI was a long time ago, however, the grace period just started. Set rcu_urgent_qs so the tick can indeed not be stopped. Signed-off-by: Joel Fernandes (Google) --- kernel/rcu/tree.c | 1 + 1 file changed, 1 insertion

[PATCH -rcu dev 2/3] rcu/tree: Fix issue where sometimes rcu_urgent_qs is not set on IPI

2019-08-15 Thread Joel Fernandes (Google)
Sometimes I see rcu_urgent_qs is not set. This could be when the last IPI was a long time ago, however, the grace period just started. Set rcu_urgent_qs so the tick can indeed be stopped. Signed-off-by: Joel Fernandes (Google) --- kernel/rcu/tree.c | 1 + 1 file changed, 1 insertion(+) diff

[PATCH -rcu dev 3/3] RFC: rcu/tree: Read dynticks_nmi_nesting in advance

2019-08-15 Thread Joel Fernandes (Google)
I really cannot explain this patch, but without it, the "else if" block just doesn't execute thus causing the tick's dep mask to not be set and causes the tick to be turned off. I tried various _ONCE() macros but the only thing that works is this patch. Signed-off-by: Joel Fernand

[PATCH -rcu dev 1/3] rcu/tree: tick_dep_set/clear_cpu should accept bits instead of masks

2019-08-15 Thread Joel Fernandes (Google)
This commit fixes the issue. Signed-off-by: Joel Fernandes (Google) --- kernel/rcu/tree.c | 29 + 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c index 0512de9ead20..322b1b57967c 100644 --- a/kernel/rcu/tree.c

[PATCH v4 1/2] rcu/tree: Add basic support for kfree_rcu() batching

2019-08-14 Thread Joel Fernandes (Google)
gchul Park Signed-off-by: Byungchul Park Signed-off-by: Joel Fernandes (Google) --- v3->v4: Some corrections by Paul. Used xchg in places to simplify code. v2->v3: Just some code comment changes thanks to Byungchul. RFCv1->PATCH v2: Removed limits on the ->head

[PATCH v4 2/2] rcuperf: Add kfree_rcu() performance Tests

2019-08-14 Thread Joel Fernandes (Google)
is increased from HZ/50 to HZ/80. Also, when running the test, please disable CONFIG_DEBUG_PREEMPT and CONFIG_PROVE_RCU for realistic comparisons with/without batching. Signed-off-by: Joel Fernandes (Google) --- .../admin-guide/kernel-parameters.txt | 17 ++ kernel/rcu/rcuperf.c

[PATCH RFC v1 2/2] rcuperf: Add kfree_rcu performance Tests

2019-08-06 Thread Joel Fernandes (Google)
Fernandes (Google) --- kernel/rcu/rcuperf.c | 169 ++- 1 file changed, 168 insertions(+), 1 deletion(-) diff --git a/kernel/rcu/rcuperf.c b/kernel/rcu/rcuperf.c index 7a6890b23c5f..34658760da5e 100644 --- a/kernel/rcu/rcuperf.c +++ b/kernel/rcu/rcuperf.c

[PATCH RFC v1 1/2] rcu/tree: Add basic support for kfree_rcu batching

2019-08-06 Thread Joel Fernandes (Google)
ail.com Cc: byungchul.p...@lge.com Cc: kernel-t...@android.com Cc: kernel-t...@lge.com Co-developed-by: Byungchul Park Signed-off-by: Byungchul Park Signed-off-by: Joel Fernandes (Google) --- kernel/rcu/tree.c | 198 -- 1 file changed, 193 insert

['PATCH v2' 4/7] docs: rcu: Correct links referring to titles

2019-08-01 Thread Joel Fernandes (Google)
Mauro's auto conversion broken these links, fix them. Signed-off-by: Joel Fernandes (Google) --- .../Tree-RCU-Memory-Ordering.rst | 17 ++-- .../RCU/Design/Requirements/Requirements.rst | 90 --- 2 files changed, 47 insertions(+), 60 deletions(-) diff --git

['PATCH v2' 7/7] Restore docs "rcu: Restore barrier() to rcu_read_lock() and rcu_read_unlock()"

2019-08-01 Thread Joel Fernandes (Google)
This restores docs back in ReST format. --- .../RCU/Design/Requirements/Requirements.rst | 54 +++ 1 file changed, 54 insertions(+) diff --git a/Documentation/RCU/Design/Requirements/Requirements.rst b/Documentation/RCU/Design/Requirements/Requirements.rst index

['PATCH v2' 2/7] Revert docs from "treewide: Rename rcu_dereference_raw_notrace() to _check()"

2019-08-01 Thread Joel Fernandes (Google)
This reverts docs from commit 355e9972da81e803bbb825b76106ae9b358caf8e. --- Documentation/RCU/Design/Requirements/Requirements.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/RCU/Design/Requirements/Requirements.html

[PATCH v2 0/7] Doc updates to /dev branch

2019-08-01 Thread Joel Fernandes (Google)
This series fixes the rcu/dev branch with the new ReST conversion patches. Only changes are to documentation. thanks, - Joel Joel Fernandes (Google) (6): Revert docs from "rcu: Restore barrier() to rcu_read_lock() and rcu_read_unlock()" Revert docs from "t

['PATCH v2' 5/7] docs: rcu: Increase toctree to 3

2019-08-01 Thread Joel Fernandes (Google)
These documents are long and have various sections. Provide a good toc nesting level. Signed-off-by: Joel Fernandes (Google) --- Documentation/RCU/index.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/RCU/index.rst b/Documentation/RCU/index.rst index

['PATCH v2' 6/7] Restore docs "treewide: Rename rcu_dereference_raw_notrace() to _check()"

2019-08-01 Thread Joel Fernandes (Google)
This restores docs back in ReST format. --- Documentation/RCU/Design/Requirements/Requirements.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/RCU/Design/Requirements/Requirements.rst b/Documentation/RCU/Design/Requirements/Requirements.rst index

['PATCH v2' 1/7] Revert docs from "rcu: Restore barrier() to rcu_read_lock() and rcu_read_unlock()"

2019-08-01 Thread Joel Fernandes (Google)
This reverts docs from commit d6b9cd7dc8e041ee83cb1362fce59a3cdb1f2709. --- .../RCU/Design/Requirements/Requirements.html | 71 --- 1 file changed, 71 deletions(-) diff --git a/Documentation/RCU/Design/Requirements/Requirements.html

[PATCH 9/9] Revert "Revert "rcu: Restore barrier() to rcu_read_lock() and rcu_read_unlock()""

2019-08-01 Thread Joel Fernandes (Google)
This reverts commit 43ddb98ebe7171ff1c6e11c1616fd03726d8e9bf while adding the documentation that the original commit added but in ReST format. --- .../RCU/Design/Requirements/Requirements.rst | 54 +++ kernel/rcu/tree_plugin.h | 11 2 files changed, 54

[PATCH 3/9] Revert "treewide: Rename rcu_dereference_raw_notrace() to _check()"

2019-08-01 Thread Joel Fernandes (Google)
This reverts commit 355e9972da81e803bbb825b76106ae9b358caf8e. --- Documentation/RCU/Design/Requirements/Requirements.html | 2 +- arch/powerpc/include/asm/kvm_book3s_64.h| 2 +- include/linux/rculist.h | 6 +++--- include/linux/rcupdate.h

[PATCH 6/9] docs: rcu: Increase toctree to 3

2019-08-01 Thread Joel Fernandes (Google)
These documents are long and have various sections. Provide a good toc nesting level. Signed-off-by: Joel Fernandes (Google) --- Documentation/RCU/index.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/RCU/index.rst b/Documentation/RCU/index.rst index

[PATCH 8/9] Revert "Revert "rcu: Add support for consolidated-RCU reader checking""

2019-08-01 Thread Joel Fernandes (Google)
This reverts commit 24be1727c524b5874d5dc7828cd392cf86c3341e. --- include/linux/rculist.h | 32 include/linux/rcupdate.h | 7 + kernel/rcu/Kconfig.debug | 11 +++ kernel/rcu/update.c | 65 ++-- 4 files changed, 88

[PATCH 5/9] docs: rcu: Correct links referring to titles

2019-08-01 Thread Joel Fernandes (Google)
Mauro's auto conversion broken these links, fix them. Signed-off-by: Joel Fernandes (Google) --- .../Tree-RCU-Memory-Ordering.rst | 17 ++-- .../RCU/Design/Requirements/Requirements.rst | 90 --- 2 files changed, 47 insertions(+), 60 deletions(-) diff --git

[PATCH 7/9] Revert "Revert "treewide: Rename rcu_dereference_raw_notrace() to _check()""

2019-08-01 Thread Joel Fernandes (Google)
This reverts commit 61d814760f1d2dffdc8db636f70bbef07c30acd5. --- Documentation/RCU/Design/Requirements/Requirements.rst | 2 +- arch/powerpc/include/asm/kvm_book3s_64.h | 2 +- include/linux/rculist.h| 6 +++--- include/linux/rcupdate.h

[PATCH 2/9] Revert "rcu: Add support for consolidated-RCU reader checking"

2019-08-01 Thread Joel Fernandes (Google)
This reverts commit 50ad3f1f9b13c8a6f2ae79df4cecb2c21da1c7c8. --- include/linux/rculist.h | 32 include/linux/rcupdate.h | 7 - kernel/rcu/Kconfig.debug | 11 --- kernel/rcu/update.c | 65 ++-- 4 files changed, 27

[PATCH 0/9] Apply new rest conversion patches to /dev branch

2019-08-01 Thread Joel Fernandes (Google)
oc patches, and then applying them again. But in the re-application, we convert the documentation No manual fix ups were done in this process, other than to documentation. thanks, - Joel And in the process I learnt about get_user() and compiler barriers ;-) Joel Fernandes (Google) (8): Revert "rcu:

[PATCH 1/9] Revert "rcu: Restore barrier() to rcu_read_lock() and rcu_read_unlock()"

2019-08-01 Thread Joel Fernandes (Google)
This reverts commit d6b9cd7dc8e041ee83cb1362fce59a3cdb1f2709. --- .../RCU/Design/Requirements/Requirements.html | 71 --- kernel/rcu/tree_plugin.h | 11 +++ 2 files changed, 11 insertions(+), 71 deletions(-) diff --git

[PATCH] Use term cumul-fence instead of fence in ->prop ordering example

2019-07-29 Thread Joel Fernandes (Google)
: Alan Stern Signed-off-by: Joel Fernandes (Google) --- tools/memory-model/Documentation/explanation.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/memory-model/Documentation/explanation.txt b/tools/memory-model/Documentation/explanation.txt index 68caa9

[PATCH v2] lkmm/docs: Correct ->prop example with additional rfe link

2019-07-27 Thread Joel Fernandes (Google)
->prop ordering on P0 more clear. Cc: kernel-t...@android.com Reviewed-by: Boqun Feng Signed-off-by: Joel Fernandes (Google) --- .../memory-model/Documentation/explanation.txt | 17 ++--- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/tools/memory-model/Docu

[PATCH] docs/lkmm: Correct ->prop example with additional rfe link

2019-07-27 Thread Joel Fernandes (Google)
0 more clear. Signed-off-by: Joel Fernandes (Google) --- tools/memory-model/Documentation/explanation.txt | 16 +--- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/tools/memory-model/Documentation/explanation.txt b/tools/memory-model/Documentation/explanation.txt

[PATCH] pidfd: Add warning if exit_state is 0 during notification

2019-07-24 Thread Joel Fernandes (Google)
add a warning to catch it in the future. [1] https://lore.kernel.org/lkml/20190717172100.261204-1-j...@joelfernandes.org/ Signed-off-by: Joel Fernandes (Google) --- kernel/signal.c | 1 + 1 file changed, 1 insertion(+) diff --git a/kernel/signal.c b/kernel/signal.c index 91b789dd6e72

[PATCH v1 1/2] mm/page_idle: Add support for per-pid page_idle using virtual indexing

2019-07-22 Thread Joel Fernandes (Google)
, address space changes can occur between reading the pagemap and reading the bitmap. In virtual address indexing, the process's mmap_sem is held for the duration of the access. Cc: vdavydov@gmail.com Cc: Brendan Gregg Cc: kernel-t...@android.com Signed-off-by: Joel Fernandes (Google

[PATCH RFC v1] pidfd: fix a race in setting exit_state for pidfd polling

2019-07-17 Thread Joel Fernandes (Google)
he waiting task is not notified again. A stress test continuously doing pidfd poll and process exits uncovered this bug, and the below patch fixes it. To fix this, we set tsk->exit_state before calling do_notify_pidfd. Cc: kernel-t...@android.com Signed-off-by: Suren Baghdasaryan Signed-off-by: Joel

[PATCH 4/9] ipv4: add lockdep condition to fix for_each_entry (v1)

2019-07-15 Thread Joel Fernandes (Google)
Using the previous support added, use it for adding lockdep conditions to list usage here. Signed-off-by: Joel Fernandes (Google) --- net/ipv4/fib_frontend.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/net/ipv4/fib_frontend.c b/net/ipv4/fib_frontend.c index

[PATCH 6/9] workqueue: Convert for_each_wq to use built-in list check (v2)

2019-07-15 Thread Joel Fernandes (Google)
list_for_each_entry_rcu now has support to check for RCU reader sections as well as lock. Just use the support in it, instead of explictly checking in the caller. Signed-off-by: Joel Fernandes (Google) --- kernel/workqueue.c | 10 ++ 1 file changed, 2 insertions(+), 8 deletions(-) diff

[PATCH 7/9] x86/pci: Pass lockdep condition to pcm_mmcfg_list iterator (v1)

2019-07-15 Thread Joel Fernandes (Google)
Fernandes (Google) --- arch/x86/pci/mmconfig-shared.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/arch/x86/pci/mmconfig-shared.c b/arch/x86/pci/mmconfig-shared.c index 7389db538c30..6fa42e9c4e6f 100644 --- a/arch/x86/pci/mmconfig-shared.c +++ b/arch/x86/pci/mmconfig

[PATCH 8/9] acpi: Use built-in RCU list checking for acpi_ioremaps list (v1)

2019-07-15 Thread Joel Fernandes (Google)
list_for_each_entry_rcu has built-in RCU and lock checking. Make use of it for acpi_ioremaps list traversal. Signed-off-by: Joel Fernandes (Google) --- drivers/acpi/osl.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/acpi/osl.c b/drivers/acpi/osl.c index

[PATCH 2/9] rcu: Add support for consolidated-RCU reader checking (v3)

2019-07-15 Thread Joel Fernandes (Google)
need to pass the optional fourth argument (cond) unless they are under some non-RCU protection and needs to make lockdep check pass. Signed-off-by: Joel Fernandes (Google) --- include/linux/rculist.h | 28 - include/linux/rcupdate.h | 7 +++ kernel/rcu/Kconfig.debug

[PATCH 5/9] driver/core: Convert to use built-in RCU list checking (v1)

2019-07-15 Thread Joel Fernandes (Google)
list_for_each_entry_rcu has built-in RCU and lock checking. Make use of it in driver core. Acked-by: Greg Kroah-Hartman Signed-off-by: Joel Fernandes (Google) --- drivers/base/base.h | 1 + drivers/base/core.c | 10 ++ drivers/base/power/runtime.c | 15

[PATCH 9/9] doc: Update documentation about list_for_each_entry_rcu (v1)

2019-07-15 Thread Joel Fernandes (Google)
This patch updates the documentation with information about usage of lockdep with list_for_each_entry_rcu(). Signed-off-by: Joel Fernandes (Google) --- Documentation/RCU/lockdep.txt | 15 +++ Documentation/RCU/whatisRCU.txt | 9 - 2 files changed, 19 insertions(+), 5

[PATCH 3/9] rcu/sync: Remove custom check for reader-section (v2)

2019-07-15 Thread Joel Fernandes (Google)
-off-by: Joel Fernandes (Google) --- include/linux/rcu_sync.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/include/linux/rcu_sync.h b/include/linux/rcu_sync.h index 9b83865d24f9..0027d4c8087c 100644 --- a/include/linux/rcu_sync.h +++ b/include/linux/rcu_sync.h @@ -31,9

[PATCH 0/9] Harden list_for_each_entry_rcu() and family

2019-07-15 Thread Joel Fernandes (Google)
wq_mutex deleted (Daniel Jordan) Simplify rcu_read_lock_any_held() (Peter Zijlstra) Simplified rcu-sync logic (Oleg Nesterov) Updated documentation and rculist comments. Added GregKH ack. RFC->v1: Simplify list checking macro (Rasmus Villemo

[PATCH v1 4/6] workqueue: Convert for_each_wq to use built-in list check

2019-07-11 Thread Joel Fernandes (Google)
list_for_each_entry_rcu now has support to check for RCU reader sections as well as lock. Just use the support in it, instead of explictly checking in the caller. Signed-off-by: Joel Fernandes (Google) --- kernel/workqueue.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git

[PATCH v1 6/6] acpi: Use built-in RCU list checking for acpi_ioremaps list

2019-07-11 Thread Joel Fernandes (Google)
list_for_each_entry_rcu has built-in RCU and lock checking. Make use of it for acpi_ioremaps list traversal. Signed-off-by: Joel Fernandes (Google) --- drivers/acpi/osl.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/acpi/osl.c b/drivers/acpi/osl.c index

[PATCH v1 0/6] Harden list_for_each_entry_rcu() and family

2019-07-11 Thread Joel Fernandes (Google)
r_wq_mutex() function which is called in for_each_wq(). This series replaces that in favor of the built-in check. Also in the future, we can extend these checks to list_entry_rcu() and other list macros as well, if needed. Joel Fernandes (Google) (6): rcu: Add support for consolidated-RCU reader checking

[PATCH v1 3/6] driver/core: Convert to use built-in RCU list checking

2019-07-11 Thread Joel Fernandes (Google)
list_for_each_entry_rcu has built-in RCU and lock checking. Make use of it in driver core. Signed-off-by: Joel Fernandes (Google) --- drivers/base/base.h | 1 + drivers/base/core.c | 10 ++ drivers/base/power/runtime.c | 15 ++- 3 files changed, 21

[PATCH v1 1/6] rcu: Add support for consolidated-RCU reader checking

2019-07-11 Thread Joel Fernandes (Google)
need to pass the optional fourth argument (cond) unless they are under some non-RCU protection and needs to make lockdep check pass. Signed-off-by: Joel Fernandes (Google) --- include/linux/rculist.h | 29 - include/linux/rcupdate.h | 7 +++ kernel/rcu

[PATCH v1 5/6] x86/pci: Pass lockdep condition to pcm_mmcfg_list iterator

2019-07-11 Thread Joel Fernandes (Google)
Fernandes (Google) --- arch/x86/pci/mmconfig-shared.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/arch/x86/pci/mmconfig-shared.c b/arch/x86/pci/mmconfig-shared.c index 7389db538c30..6fa42e9c4e6f 100644 --- a/arch/x86/pci/mmconfig-shared.c +++ b/arch/x86/pci/mmconfig

[PATCH v1 2/6] ipv4: add lockdep condition to fix for_each_entry

2019-07-11 Thread Joel Fernandes (Google)
Signed-off-by: Joel Fernandes (Google) --- net/ipv4/fib_frontend.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/net/ipv4/fib_frontend.c b/net/ipv4/fib_frontend.c index b298255f6fdb..ef7c9f8e8682 100644 --- a/net/ipv4/fib_frontend.c +++ b/net/ipv4/fib_frontend.c @@ -127,7

[PATCH RFC 3/4] lib/bpf: Add support for ftrace event attach and detach

2019-07-10 Thread Joel Fernandes (Google)
Add the needed library support in this commit. Signed-off-by: Joel Fernandes (Google) --- tools/lib/bpf/bpf.c | 53 tools/lib/bpf/bpf.h | 4 +++ tools/lib/bpf/libbpf.map | 2 ++ 3 files changed, 59 insertions(+) diff --git a/tools/lib/bpf

[PATCH RFC 1/4] Move bpf_raw_tracepoint functionality into bpf_trace.c

2019-07-10 Thread Joel Fernandes (Google)
In preparation to use raw tracepoints for BPF directly from ftrace, move the bpf_raw_tracepoint functionality into bpf_trace.c Signed-off-by: Joel Fernandes (Google) --- include/linux/bpf_trace.h | 10 ++ kernel/bpf/syscall.c| 69 ++--- kernel/trace

[PATCH RFC 4/4] selftests/bpf: Add test for ftrace-based BPF attach/detach

2019-07-10 Thread Joel Fernandes (Google)
Here we add support for testing the attach and detach of a BPF program to a tracepoint through tracefs. Signed-off-by: Joel Fernandes (Google) --- .../raw_tp_writable_test_ftrace_run.c | 89 +++ 1 file changed, 89 insertions(+) create mode 100644 tools/testing

[PATCH RFC 2/4] trace/bpf: Add support for attach/detach of ftrace events to BPF

2019-07-10 Thread Joel Fernandes (Google)
Add a new bpf file to each trace event. The following commands can be written into it: attach: Attaches BPF prog fd to tracepoint detach: Detaches BPF prog fd to tracepoint Reading the bpf file will show all the attached programs to the tracepoint. Signed-off-by: Joel Fernandes (Google

[PATCH RFC 0/4] Add support to directly attach BPF program to ftrace

2019-07-10 Thread Joel Fernandes (Google)
bpf file to /sys/kernel/debug/tracing/events/X/Y/bpf The following commands can be written into it: attach: Attaches BPF prog fd to tracepoint detach: Detaches BPF prog fd to tracepoint Reading the bpf file will show all the attached programs to the tracepoint. Joel Fernandes (Google) (4

[RFC] Fix python feature detection

2019-07-07 Thread Joel Fernandes (Google)
which fixes Python feature detection for me. I am not sure if it is the right fix for Python since it is hardcoded for Python version 2, but I thought it could be useful. My system is a Debian buster release. Cc: a...@kernel.org Cc: jo...@redhat.com Signed-off-by: Joel Fernandes (Google

[PATCH] rcuperf: Make rcuperf kernel test more robust for !expedited mode

2019-07-03 Thread Joel Fernandes (Google)
stem_state if SYSTEM_RUNNING is set before starting the test. The system_state approximately aligns with when rcu_unexpedited_gp() is called and works well in practice. I also tried late_initcall however it is still too early to be meaningful for this case. Signed-off-by: Joel Fernandes (Google) ---

[RFC] rcuperf: Make rcuperf test more robust for !expedited mode

2019-07-02 Thread Joel Fernandes (Google)
called yet before starting the writer test. With this, the holdoff parameter could also be dropped or reduced to speed up the test. Signed-off-by: Joel Fernandes (Google) --- Please consider this patch as an RFC only! This is the first time I am running the RCU performance tests, thanks! Question: I ac

[PATCH v3] Convert struct pid count to refcount_t

2019-07-01 Thread Joel Fernandes (Google)
um.org Reviewed-by: Andrea Parri Signed-off-by: Joel Fernandes (Google) --- v1->v2 is to get rid of the atomic_read(). v2->v3 replaces ATOMIC_INIT with REFCOUNT_INIT include/linux/pid.h | 5 +++-- kernel/pid.c| 9 - 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/

[RFC 1/3] rcu: Expedite the rcu quiescent state reporting if help needed

2019-06-30 Thread Joel Fernandes (Google)
ich if rcu_read_unlock_special::need_qs is set might be quite urgent. Make use of this information in deciding when to do heavy-weight softirq raising where possible. Signed-off-by: Joel Fernandes (Google) --- kernel/rcu/tree_plugin.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/kernel/

[RFC 2/3] rcu: Simplify rcu_note_context_switch exit from critical section

2019-06-30 Thread Joel Fernandes (Google)
() which was added during the RCU consolidation work and already does these checks. Tested RCU config TREE03 for an hour which succeeds. Cc: r...@vger.kernel.org Cc: kernel-t...@android.com Signed-off-by: Joel Fernandes (Google) --- kernel/rcu/tree_plugin.h | 9 - 1 file changed, 9 deletions

[RFC 3/3] Revert "rcutorture: Tweak kvm options"

2019-06-30 Thread Joel Fernandes (Google)
This reverts commit a6fda6dab93c2c06ef4b8cb4b9258df6674d2438 which causes kvm.sh to not run on my machines. The qemu-system-x86_64 command runs but does nothing. Signed-off-by: Joel Fernandes (Google) --- I am Ok if we want to drop this patch but it is in my tree because without it I can't run

[PATCH v2] Convert struct pid count to refcount_t

2019-06-28 Thread Joel Fernandes (Google)
cios.com Cc: wi...@infradead.org Cc: pet...@infradead.org Cc: will.dea...@arm.com Cc: paul...@linux.vnet.ibm.com Cc: elena.reshet...@intel.com Cc: keesc...@chromium.org Cc: kernel-t...@android.com Cc: kernel-harden...@lists.openwall.com Signed-off-by: Joel Fernandes (Google) --- Only change from v1-&g

[PATCH RFC v2] Convert struct pid count to refcount_t

2019-06-24 Thread Joel Fernandes (Google)
.@redhat.com Cc: mathieu.desnoy...@efficios.com Cc: wi...@infradead.org Cc: pet...@infradead.org Cc: will.dea...@arm.com Cc: paul...@linux.vnet.ibm.com Cc: elena.reshet...@intel.com Cc: keesc...@chromium.org Cc: kernel-t...@android.com Cc: kernel-harden...@lists.openwall.com Signed-off-by: Joel Fe

[PATCH BACKPORT Android 4.9]: mm: memcontrol: fix NULL pointer crash in test_clear_page_writeback()

2019-06-12 Thread Joel Fernandes (Google)
From: Joel Fernandes Johannes, all, could you take a look at the below backport of this fix which I am apply for our Android 4.9 kernel? Since lruvec stats are not present in the kernel and I did not want to backport that, I added my own mem_cgroup_update_stat functions which should be

[PATCH BACKPORT Android 4.9]: mm: memcontrol: fix NULL pointer crash in test_clear_page_writeback()

2019-06-12 Thread Joel Fernandes (Google)
From: Joel Fernandes Johannes, all, could you take a look at the below backport of this fix which I am apply for our Android 4.9 kernel? Since lruvec stats are not present in the kernel and I did not want to backport that, I added my own mem_cgroup_update_stat functions which should be

[RFC 4/6] workqueue: Convert for_each_wq to use built-in list check

2019-06-01 Thread Joel Fernandes (Google)
list_for_each_entry_rcu now has support to check for RCU reader sections as well as lock. Just use the support in it, instead of explictly checking in the caller. Signed-off-by: Joel Fernandes (Google) --- kernel/workqueue.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git

[RFC 3/6] driver/core: Convert to use built-in RCU list checking

2019-06-01 Thread Joel Fernandes (Google)
list_for_each_entry_rcu has built-in RCU and lock checking. Make use of it in driver core. Signed-off-by: Joel Fernandes (Google) --- drivers/base/base.h | 1 + drivers/base/core.c | 10 ++ drivers/base/power/runtime.c | 15 ++- 3 files changed, 21

[RFC 0/6] Harden list_for_each_entry_rcu() and family

2019-06-01 Thread Joel Fernandes (Google)
e code has a assert_rcu_or_wq_mutex() function which is called in for_each_wq(). This series replaces that in favor of the built-in one. Also in the future, we can extend these checks to list_entry_rcu() and other list macros as well. Joel Fernandes (Google) (6): rcu: Add support for consolidated-RCU reader checking

[RFC 5/6] x86/pci: Pass lockdep condition to pcm_mmcfg_list iterator

2019-06-01 Thread Joel Fernandes (Google)
Fernandes (Google) --- arch/x86/pci/mmconfig-shared.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/arch/x86/pci/mmconfig-shared.c b/arch/x86/pci/mmconfig-shared.c index 7389db538c30..6fa42e9c4e6f 100644 --- a/arch/x86/pci/mmconfig-shared.c +++ b/arch/x86/pci/mmconfig

[RFC 1/6] rcu: Add support for consolidated-RCU reader checking

2019-06-01 Thread Joel Fernandes (Google)
need to pass the optional fourth argument (cond) unless they are under some non-RCU protection and needs to make lockdep check pass. Signed-off-by: Joel Fernandes (Google) --- include/linux/rculist.h | 40 include/linux/rcupdate.h | 7 +++ kernel/rcu

<    1   2   3   4   5   6   >