Re: [PATCH v6 0/2] Make find_later_rq() choose a closer cpu in topology

2017-08-17 Thread Joel Fernandes (Google)
On Thu, Aug 17, 2017 at 6:25 PM, Byungchul Park wrote: > On Mon, Aug 07, 2017 at 12:50:32PM +0900, Byungchul Park wrote: >> When cpudl_find() returns any among free_cpus, the cpu might not be >> closer than others, considering sched domain. For example: >> >>this_cpu: 15 >>free_cpus: 0, 1,

Re: [PATCH v7 1/2] sched/deadline: Add support for SD_PREFER_SIBLING on find_later_rq()

2017-08-18 Thread Joel Fernandes (Google)
Hi Byungchul, On Thu, Aug 17, 2017 at 11:05 PM, Byungchul Park wrote: > It would be better to avoid pushing tasks to other cpu within > a SD_PREFER_SIBLING domain, instead, get more chances to check other > siblings. > > Signed-off-by: Byungchul Park > --- > kernel/sched/deadline.c | 55 >

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

2018-08-02 Thread Joel Fernandes (Google)
282.093338] ? 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

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

2018-08-05 Thread Joel Fernandes (Google)
irq tracepoints 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

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

2018-08-05 Thread Joel Fernandes (Google)
here 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

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

2018-08-07 Thread Joel Fernandes (Google)
separate 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:

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

2018-08-08 Thread Joel Fernandes (Google)
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:

[PATCH] mm: shmem: Correctly annotate new inodes

2018-08-14 Thread Joel Fernandes (Google)
lock(&sb->s_type->i_mutex_key#9); > > *** DEADLOCK *** > > 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.

Re: [RFC PATCH] tracepoint: Provide tracepoint_kernel_find_by_name

2018-03-26 Thread Joel Fernandes (Google)
Hi Mathieu, On Mon, Mar 26, 2018 at 12:10 PM, Mathieu Desnoyers wrote: > Provide an API allowing eBPF to lookup core kernel tracepoints by name. > > Given that a lookup by name explicitly requires tracepoint definitions > to be unique for a given name (no duplicate keys), include a > WARN_ON_ONCE

Re: [PATCH 0/3] [RFC] init, tracing: Add initcall trace events

2018-03-26 Thread Joel Fernandes (Google)
Hi Steve, On Fri, Mar 23, 2018 at 8:02 AM, Steven Rostedt wrote: > A while ago we had a boot tracer. But it was eventually removed: > commit 30dbb20e68e6f ("tracing: Remove boot tracer"). > > The rational was because there is already a initcall_debug boot option > that causes printk()s of all th

Re: [RFC PATCH] tracepoint: Provide tracepoint_kernel_find_by_name

2018-03-27 Thread Joel Fernandes (Google)
On Tue, Mar 27, 2018 at 6:27 AM, Mathieu Desnoyers wrote: >>> +static void find_tp(struct tracepoint *tp, void *priv) >>> +{ >>> + struct tp_find_args *args = priv; >>> + >>> + if (!strcmp(tp->name, args->name)) { >>> + WARN_ON_ONCE(args->tp); >>> + args->t

Re: [PATCH] staging: android: ashmem: Fix possible deadlock in ashmem_ioctl

2018-03-19 Thread Joel Fernandes (Google)
On Tue, Feb 27, 2018 at 10:59 PM, Yisheng Xie wrote: > ashmem_mutex may create a chain of dependencies like: > > CPU0CPU1 > mmap syscall ioctl syscall > -> mmap_sem (acquired) -> ashmem_ioctl > -> ashmem_mmap

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

2018-11-19 Thread Joel Fernandes (Google)
https://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 v2] sched: Remove obscure comment from select_task_rq_fair

2018-05-27 Thread Joel Fernandes (Google)
tached so lets 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&q

[PATCH] rcu: Add comment documenting how rcu_seq_snap works

2018-05-11 Thread Joel Fernandes (Google)
rcu_seq_snap may be tricky for someone looking at it for the first time. Lets document how it works with an example to make it easier. Signed-off-by: Joel Fernandes (Google) --- kernel/rcu/rcu.h | 23 ++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/kernel

[PATCH] rcu: trace: Remove Startedleaf from trace events comment

2018-05-11 Thread Joel Fernandes (Google)
As part of the gp_seq clean up, the Startleaf condition doesn't occur anymore. Remove it from the comment in the trace event file. Signed-off-by: Joel Fernandes (Google) --- include/trace/events/rcu.h | 1 - 1 file changed, 1 deletion(-) diff --git a/include/trace/events/rcu.h b/include/

[PATCH v2] rcu: Add comment documenting how rcu_seq_snap works

2018-05-11 Thread Joel Fernandes (Google)
rcu_seq_snap may be tricky for someone looking at it for the first time. Lets document how it works with an example to make it easier. Signed-off-by: Joel Fernandes (Google) --- v2 changes: Corrections as suggested by Randy. kernel/rcu/rcu.h | 24 +++- 1 file changed, 23

[PATCH RFC 8/8] rcu: Fix cpustart tracepoint gp_seq number

2018-05-13 Thread Joel Fernandes (Google)
cpustart shows a stale gp_seq. This is because rdp->gp_seq is updated only at the end of the __note_gp_changes function. For this reason, use rnp->gp_seq instead. I believe we can't update rdp->gp_seq too early so lets just use the gp_seq from rnp instead. Signed-off-by: Joel Fer

[PATCH RFC 6/8] rcu: Add back the Startedleaf tracepoint

2018-05-13 Thread Joel Fernandes (Google)
/20180513190906.gl26...@linux.vnet.ibm.com Signed-off-by: Joel Fernandes (Google) --- include/trace/events/rcu.h | 4 ++-- kernel/rcu/tree.c | 11 ++- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/include/trace/events/rcu.h b/include/trace/events/rcu.h index

[PATCH RFC 0/8] rcu fixes, clean ups for rcu/dev

2018-05-13 Thread Joel Fernandes (Google)
Hi, Here are some fixes, clean ups and some code comments changes mostly for the new funnel locking, gp_seq changes and some tracing. Its based on latest rcu/dev branch. thanks, - Joel Joel Fernandes (Google) (8): rcu: Add comment documenting how rcu_seq_snap works rcu: Clarify usage of

[PATCH RFC 2/8] rcu: Clarify usage of cond_resched for tasks-RCU

2018-05-13 Thread Joel Fernandes (Google)
Recently we had a discussion about cond_resched unconditionally recording a voluntary context switch [1]. Lets add a comment clarifying that how this API is to be used. [1] https://lkml.kernel.org/r/1526027434-21237-1-git-send-email-byungchul.p...@lge.com Signed-off-by: Joel Fernandes (Google

[PATCH RFC 5/8] rcu: Use rcu_node as temporary variable in funnel locking loop

2018-05-13 Thread Joel Fernandes (Google)
assign it at that time. Just a clean up patch, no logical change. Signed-off-by: Joel Fernandes (Google) --- kernel/rcu/tree.c | 34 ++ 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c index 9f5679ba413b

[PATCH RFC 1/8] rcu: Add comment documenting how rcu_seq_snap works

2018-05-13 Thread Joel Fernandes (Google)
rcu_seq_snap may be tricky for someone looking at it for the first time. Lets document how it works with an example to make it easier. Signed-off-by: Joel Fernandes (Google) --- kernel/rcu/rcu.h | 24 +++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/kernel

[PATCH RFC 7/8] rcu: trace CleanupMore condition only if needed

2018-05-13 Thread Joel Fernandes (Google)
Currently the tree RCU clean up code records a CleanupMore trace event even if the GP was already in progress. This makes CleanupMore show up twice for no reason. Avoid it. Signed-off-by: Joel Fernandes (Google) --- kernel/rcu/tree.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff

[PATCH RFC 4/8] rcu: Get rid of old c variable from places in tree RCU

2018-05-13 Thread Joel Fernandes (Google)
st a clean up patch, no logical change. Signed-off-by: Joel Fernandes (Google) --- include/trace/events/rcu.h | 15 ++-- kernel/rcu/tree.c | 47 ++ 2 files changed, 35 insertions(+), 27 deletions(-) diff --git a/include/trace/events/rcu.h b/inc

[PATCH RFC 3/8] rcu: Add back the cpuend tracepoint

2018-05-13 Thread Joel Fernandes (Google)
Commit be4b8beed87d ("rcu: Move RCU's grace-period-change code to ->gp_seq") removed the cpuend grace period trace point. This patch adds it back. Signed-off-by: Joel Fernandes (Google) --- kernel/rcu/tree.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff

[PATCH 2/2] kselftests: ftrace: Add tests for the preemptoff and irqsoff tracers

2018-05-17 Thread Joel Fernandes (Google)
Feng Cc: Paul McKenney Cc: Masami Hiramatsu Cc: Todd Kjos Cc: Erick Reyes Cc: Julia Cartwright Cc: kernel-t...@android.com Signed-off-by: Joel Fernandes (Google) --- tools/testing/selftests/ftrace/config | 3 + .../test.d/preemptirq/irqsoff_tracer.tc | 74 +++ 2

[PATCH v2] schedutil: Allow cpufreq requests to be made even when kthread kicked

2018-05-18 Thread Joel Fernandes (Google.)
From: "Joel Fernandes (Google)" Currently there is a chance of a schedutil cpufreq update request to be dropped if there is a pending update request. This pending request can be delayed if there is a scheduling delay of the irq_work and the wake up of the schedutil governor kthread.

[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)
_sparse 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 Fernand

[PATCH 2/7] dmaengine: stm32-dma: fix incomplete configuration in cyclic mode

2018-10-08 Thread Joel Fernandes (Google)
From: Pierre Yves MORDRET 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 Signed-off-by: Hugues Fruchet Signed-off-by: Vinod Koul --- drivers/

[PATCH 0/7] NULL pointer deref fix for stm32-dma

2018-10-08 Thread Joel Fernandes (Google)
Hi Greg, While looking at android-4.14, I found a NULL pointer deref with stm32-dma driver using Coccicheck errors. I found that upstream had a bunch of patches on stm32-dma that have fixed this and other issues, I applied these patches cleanly onto Android 4.14. I believe these should goto stable

[PATCH 1/7] dmaengine: stm32-dma: threshold manages with bitfield feature

2018-10-08 Thread Joel Fernandes (Google)
From: Pierre Yves MORDRET >From now on, DMA bitfield is to manage DMA FIFO Threshold. Signed-off-by: Pierre-Yves MORDRET Signed-off-by: Vinod Koul --- drivers/dma/stm32-dma.c | 19 --- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/drivers/dma/stm32-dma.c b/dri

[PATCH 3/7] dmaengine: stm32-dma: fix typo and reported checkpatch warnings

2018-10-08 Thread Joel Fernandes (Google)
From: Pierre Yves MORDRET Fix typo in a comment and solved reported checkpatch warnings. Signed-off-by: Pierre-Yves MORDRET Signed-off-by: Vinod Koul --- drivers/dma/stm32-dma.c | 11 ++- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/drivers/dma/stm32-dma.c b/drivers/d

[PATCH 5/7] dmaengine: stm32-dma: fix DMA IRQ status handling

2018-10-08 Thread Joel Fernandes (Google)
From: Pierre Yves MORDRET Update the way Transfer Complete and Half Transfer Complete status are acknowledge. Even if HTI is not enabled its status is shown when reading registers, driver has to clear it gently and not raise an error. Signed-off-by: Pierre-Yves MORDRET Signed-off-by: Vinod Koul

[PATCH 4/7] dmaengine: stm32-dma: Improve memory burst management

2018-10-08 Thread Joel Fernandes (Google)
From: Pierre Yves MORDRET This patch improves memory burst capability using best burst size according to transferred buffer size from/to memory. >From now on, memory burst is not necessarily same as with peripheral burst one and fifo threshold is directly managed by this driver in order to fit w

[PATCH 7/7] dmaengine: stm32-dma: properly mask irq bits

2018-10-08 Thread Joel Fernandes (Google)
From: Pierre Yves MORDRET A single register of the controller holds the information for four dma channels. The functions stm32_dma_irq_status() don't mask the relevant bits after the shift, thus adjacent channel's status is also reported in the returned value. Fixed by masking the value before re

[PATCH 6/7] dmaengine: stm32-dma: fix max items per transfer

2018-10-08 Thread Joel Fernandes (Google)
From: Pierre Yves MORDRET Having 0 in item counter register is valid and stands for a "No or Ended transfer". Therefore valid transfer starts from @+0 to @+0xFFFE leading to unaligned scatter gather at boundary. Thus it's safer to round down this value on its FIFO size (16 Bytes). Signed-off-by:

[PATCH] mm: Speed up mremap on large regions

2018-10-09 Thread Joel Fernandes (Google)
4 and arm64. Cc: minc...@google.com Cc: hu...@google.com Cc: lokeshgi...@google.com Cc: kernel-t...@android.com Signed-off-by: Joel Fernandes (Google) --- mm/mremap.c | 62 + 1 file changed, 62 insertions(+) diff --git a/mm/mremap.c b/mm/mremap.c

[PATCH v2 1/2] mm: Add an F_SEAL_FS_WRITE seal to memfd

2018-10-09 Thread Joel Fernandes (Google)
ing of the memfd. This is not something we do in Android so it does not affect us, however I have mentioned this behavior of the seal in the manpage. Cc: jr...@google.com Cc: john.stu...@linaro.org Cc: tk...@google.com Cc: gre...@linuxfoundation.org Signed-off-by: Joel Fernandes (Google) --- v1-

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

2018-10-09 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...@google.com Signed-off-by: Joel Fernandes (Google) --- tools/testing/selftests/memfd/memfd_test.c | 51 +- 1 file changed, 50 insertions(+), 1 deletion(-) diff

[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: Jo

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

[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 Signed-off-b

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

2018-11-07 Thread Joel Fernandes (Google)
prot-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...@linux

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

2018-11-07 Thread Joel Fernandes (Google)
Add tests to verify sealing memfds with the F_SEAL_FUTURE_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

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

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

2018-10-05 Thread Joel Fernandes (Google)
lows: 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

[PATCH RFC v2 0/3] cleanups for pstore and ramoops

2018-11-03 Thread Joel Fernandes (Google)
Here are some simple cleanups and fixes for ramoops in pstore. Let me know what you think, thanks. Joel Fernandes (Google) (3): pstore: map pstore types to names pstore: simplify ramoops_get_next_prz arguments pstore: donot treat empty buffers as valid fs/pstore/inode.c | 53

[PATCH RFC v2 1/3] pstore: map pstore types to names

2018-11-03 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

[PATCH RFC v2 3/3] pstore: donot treat empty buffers as valid

2018-11-03 Thread Joel Fernandes (Google)
like: found existing buffer, size 0, start 0 When I was expecting: no valid data in buffer (sig = ...) Signed-off-by: Joel Fernandes (Google) --- Note that if you feel this patch is not necessary, then feel free to drop it. I would say it is harmless and is a good clean up. fs/pstore/ram_core.c

[PATCH RFC v2 2/3] pstore: simplify ramoops_get_next_prz arguments

2018-11-03 Thread Joel Fernandes (Google)
ges are squashed into a single patch to reduce fixup conflicts. Signed-off-by: Joel Fernandes (Google) --- fs/pstore/ram.c | 48 ++-- 1 file changed, 18 insertions(+), 30 deletions(-) diff --git a/fs/pstore/ram.c b/fs/pstore/ram.c index b174d0fc009f..20

[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(+)

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

2018-10-26 Thread Joel Fernandes (Google)
ll be from 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/r

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

2018-10-27 Thread Joel Fernandes (Google)
Signed-off-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/Documen

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

2018-10-17 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-17 Thread Joel Fernandes (Google)
prot-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...@linux

[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 v7 4/6] trace/irqsoff: Split reset into separate functions

2018-05-15 Thread Joel Fernandes (Google)
: Frederic Weisbecker Cc: Randy Dunlap Cc: Masami Hiramatsu Cc: Fenguang Wu Cc: Baohong Liu Cc: Vedang Patel Cc: kernel-t...@android.com Signed-off-by: Joel Fernandes (Google) --- kernel/trace/trace_irqsoff.c | 22 +++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git

[PATCH v7 2/6] srcu: Add notrace variants of srcu_read_{lock,unlock}

2018-05-15 Thread Joel Fernandes (Google)
u Cc: Baohong Liu Cc: Vedang Patel Cc: kernel-t...@android.com Reviewed-by: Steven Rostedt (VMware) Signed-off-by: Paul McKenney Signed-off-by: Joel Fernandes (Google) --- include/linux/srcu.h | 17 + 1 file changed, 17 insertions(+) diff --git a/include/linux/srcu.h b/in

[PATCH v7 1/6] softirq: reorder trace_softirqs_on to prevent lockdep splat

2018-05-15 Thread Joel Fernandes (Google)
I'm able to reproduce a lockdep splat with config options: CONFIG_PROVE_LOCKING=y, CONFIG_DEBUG_LOCK_ALLOC=y and CONFIG_PREEMPTIRQ_EVENTS=y $ echo 1 > /d/tracing/events/preemptirq/preempt_enable/enable --- kernel/softirq.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/k

[PATCH RFC] schedutil: Allow cpufreq requests to be made even when kthread kicked

2018-05-16 Thread Joel Fernandes (Google)
overhead. [1] https://patchwork.kernel.org/patch/10384261/ CC: Viresh Kumar CC: Rafael J. Wysocki CC: Peter Zijlstra CC: Ingo Molnar CC: Patrick Bellasi CC: Juri Lelli Cc: Luca Abeni CC: Joel Fernandes CC: linux...@vger.kernel.org Signed-off-by: Joel Fernandes (Google) --- Claudio, Could you also test this pa

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

2019-03-01 Thread Joel Fernandes (Google)
This test tries to build a module successfully using the in-kernel headers found in /proc/kheaders.tar.xz. 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/Makefile

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

2019-03-01 Thread Joel Fernandes (Google)
ers from a kernel or module image. Signed-off-by: Joel Fernandes (Google) --- Changes since v3: - Blank tar was being generated because of a one line I forgot to push. It is updated now. - Added module.lds since arm64 needs it to build modules. Changes since v2: (T

[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 -manpage 1/2] fcntl.2: Update manpage with new memfd F_SEAL_FUTURE_WRITE seal

2019-03-14 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 0/2]

2019-03-14 Thread Joel Fernandes (Google)
This documentation is for F_SEAL_FUTURE_WRITE patches that are in linux-next. Joel Fernandes (Google) (2): fcntl.2: Update manpage with new memfd F_SEAL_FUTURE_WRITE seal memfd_create.2: Update manpage with new memfd F_SEAL_FUTURE_WRITE seal man2/fcntl.2| 15 +++ man2

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

2019-03-14 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 v2 1/4] lockdep: Add assertion to check if in an interrupt

2019-03-26 Thread Joel Fernandes (Google)
: kernel-t...@android.com Cc: r...@vger.kernel.org Signed-off-by: Joel Fernandes (Google) --- include/linux/lockdep.h | 7 +++ 1 file changed, 7 insertions(+) diff --git a/include/linux/lockdep.h b/include/linux/lockdep.h index c5335df2372f..d24f564823d3 100644 --- a/include/linux/lockdep.h +++ b

[PATCH v2 3/4] rcutorture: Select from only online CPUs

2019-03-26 Thread Joel Fernandes (Google)
online CPUs on the system. Cc: r...@vger.kernel.org Signed-off-by: Joel Fernandes (Google) --- tools/testing/selftests/rcutorture/bin/jitter.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tools/testing/selftests/rcutorture/bin/jitter.sh b/tools/testing/selftests

[PATCH v2 2/4] rcutree: Add checks for dynticks counters in rcu_is_cpu_rrupt_from_idle

2019-03-26 Thread Joel Fernandes (Google)
byungchul.p...@lge.com Cc: kernel-t...@android.com Cc: r...@vger.kernel.org Signed-off-by: Joel Fernandes (Google) --- kernel/rcu/tree.c | 21 + 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c index 9180158756d2..dbff8a274c4

[PATCH v2 4/4] rcutorture: Add cpu0 to the set of CPUs to add jitter

2019-03-26 Thread Joel Fernandes (Google)
jitter.sh currently does not add CPU0 to the list of CPUs for adding of jitter. Let us add it to this list even when it is not hot-pluggable. Signed-off-by: Joel Fernandes (Google) --- tools/testing/selftests/rcutorture/bin/jitter.sh | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions

[PATCH] Convert struct pid count to refcount_t

2019-03-27 Thread Joel Fernandes (Google)
arden...@lists.openwall.com Signed-off-by: Joel Fernandes (Google) --- include/linux/pid.h | 5 +++-- kernel/pid.c| 8 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/include/linux/pid.h b/include/linux/pid.h index 14a9a39da9c7..8cb86d377ff5 100644 --- a/include/linux/

[PATCH 1/2] module: Prepare for addition of new ro_after_init sections

2019-04-09 Thread Joel Fernandes (Google)
...@linux.vnet.ibm.com Cc: rost...@goodmis.org Cc: mathieu.desnoy...@efficios.com Cc: r...@vger.kernel.org Cc: kernel-harden...@lists.openwall.com Cc: kernel-t...@android.com Suggested-by: keesc...@chromium.org Signed-off-by: Joel Fernandes (Google) --- kernel/module.c | 42

[PATCH 2/2] module: Make srcu_struct ptr array as read-only post init

2019-04-09 Thread Joel Fernandes (Google)
ters to be writable, and can cause security or other hidden bugs. Mark these are read-only after the module init has completed. Suggested-by: paul...@linux.vnet.ibm.com Suggested-by: keesc...@chromium.org Signed-off-by: Joel Fernandes (Google) --- kernel/module.c | 9 - 1 file changed, 8 insert

[PATCH v2 2/3] module: Make srcu_struct ptr array as read-only post init

2019-04-10 Thread Joel Fernandes (Google)
ters to be writable, and can cause security or other hidden bugs. Mark these are read-only after the module init has completed. Suggested-by: paul...@linux.vnet.ibm.com Suggested-by: keesc...@chromium.org Acked-by: keesc...@chromium.org Signed-off-by: Joel Fernandes (Google) --- kernel/module.c | 10 +++

[PATCH v2 1/3] module: Prepare for addition of new ro_after_init sections

2019-04-10 Thread Joel Fernandes (Google)
...@linux.vnet.ibm.com Cc: rost...@goodmis.org Cc: mathieu.desnoy...@efficios.com Cc: r...@vger.kernel.org Cc: kernel-harden...@lists.openwall.com Cc: kernel-t...@android.com Suggested-by: keesc...@chromium.org Reviewed-by: keesc...@chromium.org Acked-by: rost...@goodmis.org Signed-off-by: Joel Fernandes

[PATCH v2 3/3] module: Make __tracepoints_ptrs as read-only

2019-04-10 Thread Joel Fernandes (Google)
security or other hidden bugs. Mark these as ro_after_init. Suggested-by: paul...@linux.vnet.ibm.com Suggested-by: keesc...@chromium.org Suggested-by: mathieu.desnoy...@efficios.com Cc: rost...@goodmis.org Signed-off-by: Joel Fernandes (Google) --- kernel/module.c | 6 ++ 1 file changed, 6

[PATCH v3 3/3] module: Make __tracepoints_ptrs as read-only

2019-04-10 Thread Joel Fernandes (Google)
security or other hidden bugs. Mark these as ro_after_init. Suggested-by: paul...@linux.vnet.ibm.com Suggested-by: keesc...@chromium.org Suggested-by: mathieu.desnoy...@efficios.com Cc: rost...@goodmis.org Signed-off-by: Joel Fernandes (Google) --- kernel/module.c | 6 ++ 1 file changed, 6

[PATCH v3 1/3] module: Prepare for addition of new ro_after_init sections

2019-04-10 Thread Joel Fernandes (Google)
...@linux.vnet.ibm.com Cc: rost...@goodmis.org Cc: mathieu.desnoy...@efficios.com Cc: r...@vger.kernel.org Cc: kernel-harden...@lists.openwall.com Cc: kernel-t...@android.com Suggested-by: keesc...@chromium.org Reviewed-by: keesc...@chromium.org Acked-by: rost...@goodmis.org Signed-off-by: Joel Fernandes

[PATCH v3 2/3] module: Make srcu_struct ptr array as read-only post init

2019-04-10 Thread Joel Fernandes (Google)
ters to be writable, and can cause security or other hidden bugs. Mark these are read-only after the module init has completed. Suggested-by: paul...@linux.vnet.ibm.com Suggested-by: keesc...@chromium.org Acked-by: keesc...@chromium.org Signed-off-by: Joel Fernandes (Google) --- kernel/module.c | 6

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

2019-02-27 Thread Joel Fernandes (Google)
This test tries to build a module successfully using the in-kernel headers found in /proc/kheaders.tar.xz. 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/Makefile

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

2019-02-27 Thread Joel Fernandes (Google)
D_ST and IKHD_ED markers as is to facilitate future patches that would extract the headers from a kernel or module image. Signed-off-by: Joel Fernandes (Google) --- Changes since v2: (Thanks to Masahiro Yamada for several excellent suggestions) - Added support for out of tree builds.

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

2020-07-29 Thread Joel Fernandes (Google)
REE03 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

[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)
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 100644 --

[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)
REE03 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

[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 (G

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

2020-05-20 Thread Joel Fernandes (Google)
n Cc: 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

  1   2   3   4   5   >