[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 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 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 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 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 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 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 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] 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 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] 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 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

[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] 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 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

[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 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 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 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 1/2] rcu/tree: Add a warning if CPU being onlined did not report QS already

2020-07-29 Thread Joel Fernandes (Google)
and hotplug parameters. Cc: Paul E. McKenney Cc: Neeraj Upadhyay Suggested-by: Paul E. McKenney Signed-off-by: Joel Fernandes (Google) --- kernel/rcu/tree.c | 14 +- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c index

[PATCH 2/2] rcu/tree: Clarify comments about FQS loop reporting quiescent states

2020-07-29 Thread Joel Fernandes (Google)
At least since v4.19, the FQS loop no longer reports quiescent states unless it is a dire situation where an offlined CPU failed to report a quiescent state. Let us clarify the comment in rcu_gp_init() inorder to keep the comment current. Signed-off-by: Joel Fernandes (Google) --- kernel/rcu

[PATCH v2 3/3] rcu/tree: Make FQS complaining about offline CPU more aggressive

2020-07-30 Thread Joel Fernandes (Google)
ows no warnings. Convert the warning as well to WARN_ON_ONCE() to reduce log spam. Signed-off-by: Joel Fernandes (Google) --- kernel/rcu/tree.c | 10 ++ 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c index a621932cc385..39bdd744ba97 100

[PATCH v2 2/3] rcu/tree: Clarify comments about FQS loop reporting quiescent states

2020-07-30 Thread Joel Fernandes (Google)
At least since v4.19, the FQS loop no longer reports quiescent states unless it is a dire situation where an offlined CPU failed to report a quiescent state. Let us clarify the comment in rcu_gp_init() inorder to keep the comment current. Signed-off-by: Joel Fernandes (Google) --- kernel/rcu

[PATCH v2 1/3] rcu/tree: Add a warning if CPU being onlined did not report QS already

2020-07-30 Thread Joel Fernandes (Google)
and hotplug parameters. Cc: Paul E. McKenney Cc: Neeraj Upadhyay Suggested-by: Paul E. McKenney Signed-off-by: Joel Fernandes (Google) --- kernel/rcu/tree.c | 14 +- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c index

[PATCH RFC] rcu/segcblist: Add counters to segcblist datastructure

2020-07-18 Thread Joel Fernandes (Google)
. Signed-off-by: Joel Fernandes (Google) --- include/linux/rcu_segcblist.h | 2 + kernel/rcu/rcu_segcblist.c| 96 +++ 2 files changed, 89 insertions(+), 9 deletions(-) diff --git a/include/linux/rcu_segcblist.h b/include/linux/rcu_segcblist.h index b36afe7b22c9

[PATCH RFC v2] rcu/segcblist: Add counters to segcblist datastructure

2020-07-18 Thread Joel Fernandes (Google)
Fernandes (Google) --- v1->v2: minor nits. include/linux/rcu_segcblist.h | 2 + kernel/rcu/rcu_segcblist.c| 90 --- 2 files changed, 86 insertions(+), 6 deletions(-) diff --git a/include/linux/rcu_segcblist.h b/include/linux/rcu_segcblist.h index b36afe7b2

[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

[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

[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/

[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] 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] 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] 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 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

[PATCH RFC] Add support for core-wide protection of IRQ and softirq

2020-05-10 Thread Joel Fernandes (Google)
Signed-off-by: Joel Fernandes (Google) --- If you like some pictures of the cases handled by this patch, please see the OSPM slide deck (the below link jumps straight to relevant slides - about 6-7 of them in total): https://bit.ly/2zvzxWk TODO: 1. Any optimziations for VM usecases (can we do

[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 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] 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 1/7] rcu/segcblist: Prevent useless GP start if no CBs to accelerate

2020-06-18 Thread Joel Fernandes (Google)
104 | ++-+-+-+-+ | 10 | 66 | 82 | 98 | 119 | ++-+-+-+-+ | 11 | 52 | 82 | 83 | 117 | ++-+-+-+-+ Cc: ure...@gmail.com Signed-off-by: Joel Fernandes (Google) --- kernel/rcu/rcu_segcblist.c

[PATCH 7/7] rcutorture: Add number of GP information to reports

2020-06-18 Thread Joel Fernandes (Google)
Add 2 things to get visiblity around number of grace periods. 1. Add number of GPs to End-state print. 2. Just like End-state, add GP state to Start-state. This helps determine how many GPs elapsed during a run of rcutorture and what the initial state was. Signed-off-by: Joel Fernandes (Google

[PATCH 2/7] rcu/trace: Add tracing for how segcb list changes

2020-06-18 Thread Joel Fernandes (Google)
Track how the segcb list changes before/after acceleration, during queuing and during dequeuing. This has proved useful to discover an optimization to avoid unwanted GP requests when there are no callbacks accelerated. Signed-off-by: Joel Fernandes (Google) --- include/trace/events/rcu.h | 25

[PATCH 5/7] rcu/trace: Use rsp's gp_seq in acceleration's rcu_grace_period tracepoint

2020-06-18 Thread Joel Fernandes (Google)
gp_seq instead as it allows one to reason about how the acceleration works. Signed-off-by: Joel Fernandes (Google) --- kernel/rcu/tree.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c index 81df1b837dd9d..c3bae7a83d792 100644 --- a/kernel

[PATCH 6/7] rcutorture: Add support to get the number of wakeups of main GP kthread

2020-06-18 Thread Joel Fernandes (Google)
This is useful to check for any improvements or degradation related to number of GP kthread wakeups during testing. Signed-off-by: Joel Fernandes (Google) --- kernel/rcu/Kconfig.debug | 1 + kernel/rcu/rcu.h | 2 ++ kernel/rcu/rcutorture.c | 23 ++- kernel/rcu

[PATCH 3/7] rcu/trace: Add name of the source for gp_seq

2020-06-18 Thread Joel Fernandes (Google)
The gp_seq value can come from either of rdp, rsp or rnp. Only the rsp is the global source of truth (most accurate GP info). The rnp can be off by ~1 and the rdp can be off by way more. Add some more context to traces to clarify where it comes from. Signed-off-by: Joel Fernandes (Google

[PATCH 4/7] rcu/trace: Print negative GP numbers correctly

2020-06-18 Thread Joel Fernandes (Google)
the negative numbering directly. Signed-off-by: Joel Fernandes (Google) --- include/trace/events/rcu.h | 62 -- 1 file changed, 32 insertions(+), 30 deletions(-) diff --git a/include/trace/events/rcu.h b/include/trace/events/rcu.h index cb5363564f7ed..bc24862790623

[PATCH 3/3] rcu/trace: Add name of the source for gp_seq to prevent confusion

2020-06-18 Thread Joel Fernandes (Google)
-by: Joel Fernandes (Google) --- include/trace/events/rcu.h | 12 kernel/rcu/tree.c | 32 kernel/rcu/tree_plugin.h | 4 ++-- 3 files changed, 26 insertions(+), 22 deletions(-) diff --git a/include/trace/events/rcu.h b/include/trace/events

[PATCH 1/3] rcu/trace: Print negative GP numbers correctly

2020-06-18 Thread Joel Fernandes (Google)
the negative numbering directly. Cc: ure...@gmail.com Signed-off-by: Joel Fernandes (Google) --- include/trace/events/rcu.h | 54 +++--- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/include/trace/events/rcu.h b/include/trace/events/rcu.h index

[PATCH 2/3] rcu/trace: Use gp_seq_req in acceleration's rcu_grace_period tracepoint

2020-06-18 Thread Joel Fernandes (Google)
instead as it allows one to reason about how the acceleration works. Signed-off-by: Joel Fernandes (Google) --- kernel/rcu/tree.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c index 9ef68dd249e1d..d0988a1c1079d 100644 --- a/kernel

[PATCH RFC] sched: Add a per-thread core scheduling interface

2020-05-20 Thread Joel Fernandes (Google)
-tagged, allow the CGroup interface to override the task's tag. ChromeOS will use core-scheduling to securely enable hyperthreading. This cuts down the keypress latency in Google docs from 150ms to 50ms while improving the camera streaming frame rate by ~3%. Signed-off-by: Joel Fernandes (Google

[PATCH RFC v2] Add support for core-wide protection of IRQ and softirq

2020-05-20 Thread Joel Fernandes (Google)
: Paul E. McKenney Co-developed-by: Vineeth Pillai Signed-off-by: Vineeth Pillai Signed-off-by: Joel Fernandes (Google) --- If you like some pictures of the cases handled by this patch, please see the OSPM slide deck (the below link jumps straight to relevant slides - about 6-7 of them in total

[PATCH RFC] sched: Use sched-RCU in core-scheduling balancing logic

2020-05-20 Thread Joel Fernandes (Google)
] watchdog: BUG: soft lockup - CPU#0 stuck for 11s! [kworker/0:10:965] Cc: vpillai Cc: Aaron Lu Cc: Aubrey Li Cc: pet...@infradead.org Cc: paul...@kernel.org Signed-off-by: Joel Fernandes (Google) Change-Id: I1a4bf0cd1426b3c21ad5de44719813ad4ee5805e --- kernel/sched/core.c | 4 ++-- 1 file

[PATCH RFC] sched/headers: Fix sched_setattr userspace compilation issues

2020-05-21 Thread Joel Fernandes (Google)
compile. Signed-off-by: Joel Fernandes (Google) --- include/uapi/linux/sched/types.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/uapi/linux/sched/types.h b/include/uapi/linux/sched/types.h index c852153ddb0d3..1f10d935a63fe 100644 --- a/include/uapi/linux/sched/types.h +++ b

[PATCH RFC] schedutil: Address the r/w ordering race in kthread

2018-05-22 Thread Joel Fernandes (Google)
Rafael J. Wysocki CC: Peter Zijlstra CC: Ingo Molnar CC: Patrick Bellasi CC: Juri Lelli Cc: Luca Abeni CC: Todd Kjos CC: clau...@evidence.eu.com CC: kernel-t...@android.com CC: linux...@vger.kernel.org Signed-off-by: Joel Fernandes (Google) --- I split this into separate patch, because this

[PATCH 2/2] Add selftests for module build using in-kernel headers

2019-02-07 Thread Joel Fernandes (Google)
This test tries to build a module successfully using the in-kernel headers found in /proc/kheaders.txz. Verified pass and fail scenarios by running: make -C tools/testing/selftests TARGETS=kheaders run_tests Signed-off-by: Joel Fernandes (Google) --- tools/testing/selftests/kheaders/Makefile

[PATCH 1/2] Provide in-kernel headers for making it easy to extend the kernel

2019-02-07 Thread Joel Fernandes (Google)
-xvf /proc/kheaders.txz -C $HOME/headers >/dev/null cd my-kernel-module make -C $HOME/headers M=$(pwd) modules rmmod kheaders Signed-off-by: Joel Fernandes (Google) --- Changes since RFC: Both changes bring size down to 3.8MB: - use xz for compression - strip comments except SPDX lines - Call

[PATCH v2] sched: Remove obscure comment from select_task_rq_fair

2018-05-27 Thread Joel Fernandes (Google)
fix the comment. Cc: Dietmar Eggemann Cc: Morten Ramussen Cc: Ingo Molnar Cc: Peter Zijlstra Cc: Juri Lelli Cc: Vincent Guittot Cc: Patrick Bellasi Cc: Rohit Jain Cc: kernel-t...@android.com Signed-off-by: Joel Fernandes (Google) --- v1->v2: Resending without "XXX" in subject

[PATCH -next 1/2] mm/memfd: make F_SEAL_FUTURE_WRITE seal more robust

2018-11-19 Thread Joel Fernandes (Google)
://lore.kernel.org/lkml/69ce06cc-e47c-4992-848a-66eb23ee6...@amacapital.net/ Suggested-by: Andy Lutomirski Fixes: 5e653c2923fd ("mm: Add an F_SEAL_FUTURE_WRITE seal to memfd") Signed-off-by: Joel Fernandes (Google) --- fs/hugetlbfs/inode.c | 2 +- mm/memfd.c

[PATCH -next 2/2] selftests/memfd: modify tests for F_SEAL_FUTURE_WRITE seal

2018-11-19 Thread Joel Fernandes (Google)
Signed-off-by: Joel Fernandes (Google) --- tools/testing/selftests/memfd/memfd_test.c | 88 +++--- 1 file changed, 44 insertions(+), 44 deletions(-) diff --git a/tools/testing/selftests/memfd/memfd_test.c b/tools/testing/selftests/memfd/memfd_test.c index 32b207ca7372..c67d32eeb668

[PATCH -manpage 1/2] fcntl.2: Update manpage with new memfd F_SEAL_FUTURE_WRITE seal

2018-11-19 Thread Joel Fernandes (Google)
More details of the seal can be found in the LKML patch: https://lore.kernel.org/lkml/20181120052137.74317-1-j...@joelfernandes.org/T/#t Signed-off-by: Joel Fernandes (Google) --- man2/fcntl.2 | 15 +++ 1 file changed, 15 insertions(+) diff --git a/man2/fcntl.2 b/man2/fcntl.2 index

[PATCH -manpage 2/2] memfd_create.2: Update manpage with new memfd F_SEAL_FUTURE_WRITE seal

2018-11-19 Thread Joel Fernandes (Google)
More details of the seal can be found in the LKML patch: https://lore.kernel.org/lkml/20181120052137.74317-1-j...@joelfernandes.org/T/#t Signed-off-by: Joel Fernandes (Google) --- man2/memfd_create.2 | 15 ++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/man2

[PATCH -manpage 1/2] fcntl.2: Update manpage with new memfd F_SEAL_FUTURE_WRITE seal

2018-12-12 Thread Joel Fernandes (Google)
More details of the seal can be found in the LKML patch: https://lore.kernel.org/lkml/20181120052137.74317-1-j...@joelfernandes.org/T/#t Signed-off-by: Joel Fernandes (Google) --- man2/fcntl.2 | 15 +++ 1 file changed, 15 insertions(+) diff --git a/man2/fcntl.2 b/man2/fcntl.2 index

[PATCH -manpage 2/2] memfd_create.2: Update manpage with new memfd F_SEAL_FUTURE_WRITE seal

2018-12-12 Thread Joel Fernandes (Google)
More details of the seal can be found in the LKML patch: https://lore.kernel.org/lkml/20181120052137.74317-1-j...@joelfernandes.org/T/#t Signed-off-by: Joel Fernandes (Google) --- man2/memfd_create.2 | 15 ++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/man2

[PATCH RFC] rcu: add sparse check to rcu_assign_pointer

2018-12-12 Thread Joel Fernandes (Google)
to rcu_check_parse since the checking now happens not only during derereferencing but also during assignment. Test: Introduced an rcu_assign_pointer in code and checked the output of sparse with and without this change. The change correctly causes sparse to throw an error. Signed-off-by: Joel Fernandes (Google

[RFC 1/6] pstore: map pstore types to names

2018-10-26 Thread Joel Fernandes (Google)
In later patches we will need to map types to names, so create a table for that which can also be used and reused in different parts of old and new code. Also use it to save the type in the PRZ which will be useful in later patches. Signed-off-by: Joel Fernandes (Google) --- fs/pstore/inode.c

[RFC 5/6] pstore: donot treat empty buffers as valid

2018-10-26 Thread Joel Fernandes (Google)
pstore currently calls persistent_ram_save_old even if a buffer is empty. While this appears to work, it is simply not the right thing to do and could lead to bugs so lets avoid that. It also prevent misleading prints in the logs which claim the buffer is valid. Signed-off-by: Joel Fernandes

[RFC 2/6] pstore: remove type argument from ramoops_get_next_prz

2018-10-26 Thread Joel Fernandes (Google)
Since we store the type of the prz when we initialize it, we no longer need to pass it again in ramoops_get_next_prz since we can just use that to setup the pstore record. So lets remove it from the argument list. Signed-off-by: Joel Fernandes (Google) --- fs/pstore/ram.c | 20

[RFC 4/6] pstore: further reduce ramoops_get_next_prz arguments by passing record

2018-10-26 Thread Joel Fernandes (Google)
Both the id and type fields of a pstore_record are set by ramoops_get_next_prz. So we can just pass a pointer to the pstore_record instead of passing individual elements. This results in cleaner more readable code and fewer lines. Signed-off-by: Joel Fernandes (Google) --- fs/pstore/ram.c | 18

[RFC 3/6] pstore: remove max argument from ramoops_get_next_prz

2018-10-26 Thread Joel Fernandes (Google)
>From the code flow, the 'max' checks are already being done on the prz passed to ramoops_get_next_prz. Lets remove it to simplify this function and reduce its arguments. Signed-off-by: Joel Fernandes (Google) --- fs/pstore/ram.c | 14 ++ 1 file changed, 6 insertions(+), 8 deleti

[RFC 6/6] Revert "pstore/ram_core: Do not reset restored zone's position and size"

2018-10-26 Thread Joel Fernandes (Google)
this boot and the other parts will be from previous boots. So this revert fixes all of this by calling persistent_ram_zap always. Signed-off-by: Joel Fernandes (Google) --- fs/pstore/ram_core.c | 1 - 1 file changed, 1 deletion(-) diff --git a/fs/pstore/ram_core.c b/fs/pstore/ram_core.c index

[RFC] rcu: doc: update example about stale data

2018-10-27 Thread Joel Fernandes (Google)
-by: Joel Fernandes (Google) --- Documentation/RCU/listRCU.txt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Documentation/RCU/listRCU.txt b/Documentation/RCU/listRCU.txt index adb5a3782846..09e9a4fc723e 100644 --- a/Documentation/RCU/listRCU.txt +++ b/Documentation/RCU

[RFC] doc: rcu: remove note on smp_mb during synchronize_rcu

2018-10-27 Thread Joel Fernandes (Google)
As per this thread [1], it seems this smp_mb isn't needed anymore: "So the smp_mb() that I was trying to add doesn't need to be there." So let us remove this part from the memory ordering documentation. [1] https://lkml.org/lkml/2017/10/6/707 Signed-off-by: Joel Fernand

[PATCH] doc: correct parameter in stallwarn

2018-10-29 Thread Joel Fernandes (Google)
The stallwarn document incorrectly mentions 'fps=' instead of 'fqs='. Correct that. Signed-off-by: Joel Fernandes (Google) --- Documentation/RCU/stallwarn.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/RCU/stallwarn.txt b/Documentation/RCU/stallwarn.txt

[PATCH] mm: shmem: Correctly annotate new inodes

2018-08-14 Thread Joel Fernandes (Google)
> > 1 lock held by syz-executor900/4483: > #0: 25208078 (ashmem_mutex){+.+.}, at: > ashmem_shrink_scan+0xb4/0x630 drivers/staging/android/ashmem.c:448 Reported-by: syzbot Cc: wi...@infradead.org Cc: sta...@vger.kernel.org Cc: pet...@infradead.org Suggested-by: Neil Brown Sign

[PATCH for-stable] dmaengine: stm32-dma: fix incomplete configuration in cyclic mode

2018-10-16 Thread Joel Fernandes (Google)
From: Pierre Yves MORDRET commit e57cb3b3f10d005410f09d4598cc6d62b833f2b0 upstream. When in cyclic mode, the configuration is updated after having started the DMA hardware (STM32_DMA_SCR_EN) leading to incomplete configuration of SMxAR registers. Signed-off-by: Pierre-Yves MORDRET

[PATCH v3 2/2] selftests/memfd: Add tests for F_SEAL_FS_WRITE seal

2018-10-18 Thread Joel Fernandes (Google)
Add tests to verify sealing memfds with the F_SEAL_FS_WRITE works as expected. Cc: dan...@google.com Cc: minc...@kernel.org Reviewed-by: John Stultz Signed-off-by: Joel Fernandes (Google) --- tools/testing/selftests/memfd/memfd_test.c | 74 ++ 1 file changed, 74 insertions

[PATCH v3 1/2] mm: Add an F_SEAL_FUTURE_WRITE seal to memfd

2018-10-18 Thread Joel Fernandes (Google)
write passed as expected future-write seal now active write failed as expected due to future-write seal map 2 prot-write failed as expected due to seal : Permission denied map 3 prot-read passed as expected Cc: jr...@google.com Cc: john.stu...@linaro.org Cc: tk...@google.com Cc: gre...@linuxf

[PATCH] MAINTAINERS: Add me to Android drivers

2018-10-04 Thread Joel Fernandes (Google)
locking. So I would like to be added to the MAINTAINERS file for android drivers for review and maintenance of ashmem and other Android drivers. Cc: tk...@google.com Cc: gre...@linuxfoundation.org Signed-off-by: Joel Fernandes (Google) --- MAINTAINERS | 1 + 1 file changed, 1 insertion(+) diff --git

[PATCH RFC] mm: Add an fs-write seal to memfd

2018-10-05 Thread Joel Fernandes (Google)
ret=3 map 0 passed write passed map 1 prot-write passed as expected fs-write seal now active write failed as expected due to fs-write seal map 2 prot-write failed as expected due to seal : Permission denied map 3 prot-read passed as expected Cc: jr...@google.com Cc: john.stu...@linaro.org Cc: t

[PATCH] trace: Use rcu_dereference_raw for hooks from trace-event subsystem

2018-08-02 Thread Joel Fernandes (Google)
] ? start_kernel+0x49d/0x4bd [ 282.093987] ? secondary_startup_64+0xa5/0xb0 Reported-by: Masami Hiramatsu Fixes: e6753f23d961 ("tracepoint: Make rcuidle tracepoint callers use SRCU") Signed-off-by: Joel Fernandes (Google) --- kernel/trace/trace_events.c | 4 ++-- 1 file changed, 2 insert

[PATCH] doc: rcu: Fix code listing in performance and scalability requirements

2018-10-14 Thread Joel Fernandes (Google)
The code listing under this section has a quick quiz that says line 19 uses rcu_access_pointer, but the code listing itself does not. Fix this. Signed-off-by: Joel Fernandes (Google) --- .../RCU/Design/Requirements/Requirements.html| 2 +- kernel/sys.c

[PATCH ftrace/core] tracing: irqsoff: Account for additional preempt_disable

2018-08-05 Thread Joel Fernandes (Google)
oints and unify their usage") Fixes: e6753f23d961 ("tracepoint: Make rcuidle tracepoint callers use SRCU") Reported-by: Masami Hiramatsu Signed-off-by: Joel Fernandes (Google) --- kernel/trace/trace_irqsoff.c | 26 ++ 1 file changed, 26 insertions(+) diff

[RFC] tracepoint: Run tracepoints even after CPU is offline

2018-08-05 Thread Joel Fernandes (Google)
even after !cpu_online. I thought of just using SRCU for all tracepoints however that may mean we can't use tracepoints from NMI.. Tries-to-Fix: c3bc8fd637a9 ("tracing: Centralize preemptirq tracepoints and unify their usage") Reported-by: Masami Hiramatsu Signed-of

[PATCH RFC] tracepoint: Use SRCU for all tracepoint invocations

2018-08-07 Thread Joel Fernandes (Google)
ate SRCU node for tracepoints called from in_nmi(). This is needed to also make tracepoints work while CPU is offline. Fixes: c3bc8fd637a9 ("tracing: Centralize preemptirq tracepoints and unify their usage") Reported-by: Masami Hiramatsu Signed-off-by: Joel

[PATCH RFC ftrace/core] tracing: Directly call tracer and lockdep probes

2018-08-08 Thread Joel Fernandes (Google)
the other benefits and clean ups of the patch being partially reverted. Based on Steve's original Partial revert patch. I added directly calling irqsoff tracer probes as well. Fixes: c3bc8fd637a9 ("tracing: Centralize preemptirq tracepoints and unify their usage") Signed-off-by: Joel

[PATCH v1 1/2] Add polling support to pidfd

2019-04-25 Thread Joel Fernandes (Google)
: Jonathan Kowalski Cc: torva...@linux-foundation.org Cc: kernel-t...@android.com Co-developed-by: Daniel Colascione Signed-off-by: Joel Fernandes (Google) --- RFC -> v1: * Based on CLONE_PIDFD patches: https://lwn.net/Articles/786244/ * Updated selftests. * Renamed poll wake function to do_notify_pi

[PATCH v1 2/2] Add selftests for pidfd polling

2019-04-25 Thread Joel Fernandes (Google)
, then the thread group leader is signaled to exit and is replaced with the execing thread as the new leader, however the parent is not notified in this case. Signed-off-by: Joel Fernandes (Google) --- tools/testing/selftests/pidfd/Makefile | 2 +- tools/testing/selftests/pidfd

[PATCH v2 4/4] tools: Sync uapi headers with new bpf function calls

2019-05-06 Thread Joel Fernandes (Google)
The uapi in tools/ needs an update after support for new bpf function calls were added. This commit does the same. Signed-off-by: Joel Fernandes (Google) --- tools/include/uapi/linux/bpf.h | 16 +++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/tools/include/uapi

[PATCH v2 3/4] bpf: Add warning when program uses deprecated bpf_probe_read

2019-05-06 Thread Joel Fernandes (Google)
bpf_probe_read is deprecated and ambiguous. Add a warning if programs still use it, so that they may be moved to not use it. After sufficient time, the warning can be removed. Signed-off-by: Joel Fernandes (Google) --- kernel/bpf/verifier.c | 4 1 file changed, 4 insertions(+) diff --git

[PATCH v2 1/4] bpf: Add support for reading user pointers

2019-05-06 Thread Joel Fernandes (Google)
Fernandes (Google) --- Masami, could you carry these patches in the series where are you add probe_user_read function? Previous submissions is here: https://lore.kernel.org/patchwork/patch/1069552/ v1->v2: split tools uapi sync into separate commit, added deprecation warning for old bpf_probe_r

[PATCH RFC] bpf: Add support for reading user pointers

2019-05-02 Thread Joel Fernandes (Google)
: Srinivas Ramana Cc: duyuchao Cc: Manjo Raja Rao Cc: Karim Yaghmour Cc: Tamir Carmeli Cc: Yonghong Song Cc: Alexei Starovoitov Cc: Brendan Gregg Cc: Masami Hiramatsu Cc: Peter Ziljstra Cc: Steven Rostedt Cc: Kees Cook Cc: kernel-t...@android.com Signed-off-by: Joel Fernandes (Google

[PATCH v2 1/2] Add polling support to pidfd

2019-04-30 Thread Joel Fernandes (Google)
Viro Cc: Kees Cook Cc: David Howells Cc: Oleg Nesterov Cc: kernel-t...@android.com (Oleg improved the code by showing how to avoid tasklist_lock) Suggested-by: Oleg Nesterov Co-developed-by: Daniel Colascione Signed-off-by: Daniel Colascione Signed-off-by: Joel Fernandes (Google) --- v1

[PATCH v2 2/2] Add selftests for pidfd polling

2019-04-30 Thread Joel Fernandes (Google)
, then the thread group leader is signaled to exit and is replaced with the execing thread as the new leader, however the parent is not notified in this case. Signed-off-by: Joel Fernandes (Google) --- tools/testing/selftests/pidfd/Makefile | 2 +- tools/testing/selftests/pidfd

<    1   2   3   4   5   6   >