Re: [PATCH v11 14/26] locking/lockdep, cpu/hotplus: Use a weaker annotation in AP thread

2024-06-03 Thread Byungchul Park
On Fri, Jan 26, 2024 at 06:30:02PM +0100, Thomas Gleixner wrote: > > Furthermore, now that Dept was introduced, false positive alarms was > > reported by that. Replaced it with try lock annotation. > > I still have zero idea what this is about. Lockdep is working on lock/unlock, while dept is

[PATCH v14 21/28] dept: Apply timeout consideration to dma fence wait

2024-05-08 Thread Byungchul Park
Now that CONFIG_DEPT_AGGRESSIVE_TIMEOUT_WAIT was introduced, apply the consideration to dma fence wait. Signed-off-by: Byungchul Park --- drivers/dma-buf/dma-fence.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/dma-buf/dma-fence.c b/drivers/dma-buf/dma-fence.c

[PATCH v14 03/28] dept: Add single event dependency tracker APIs

2024-05-08 Thread Byungchul Park
(_wait); That's it! Signed-off-by: Byungchul Park --- include/linux/dept_sdt.h | 62 1 file changed, 62 insertions(+) create mode 100644 include/linux/dept_sdt.h diff --git a/include/linux/dept_sdt.h b/include/linux/dept_sdt.h new file mode 100644 index

[PATCH v14 18/28] dept: Apply timeout consideration to swait

2024-05-08 Thread Byungchul Park
Now that CONFIG_DEPT_AGGRESSIVE_TIMEOUT_WAIT was introduced, apply the consideration to swait, assuming an input 'ret' in ___swait_event() macro is used as a timeout value. Signed-off-by: Byungchul Park --- include/linux/swait.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

[PATCH v14 09/28] dept: Add a mechanism to refill the internal memory pools on running out

2024-05-08 Thread Byungchul Park
for the refill on the lack by any chance, using irq work and workqueue that fits on the contrained environment. Signed-off-by: Byungchul Park --- include/linux/dept.h| 19 -- kernel/dependency/dept.c| 104 +++- kernel/dependency/dept_object.h | 10

[PATCH v14 10/28] dept: Record the latest one out of consecutive waits of the same class

2024-05-08 Thread Byungchul Park
the whole history buffer for that, since it'd cost too high, alternatively, let's keep the latest one at least when the same class'ed waits consecutively appear. Signed-off-by: Byungchul Park --- kernel/dependency/dept.c | 21 - 1 file changed, 20 insertions(+), 1 deletion

[PATCH v14 14/28] dept: Apply sdt_might_sleep_{start, end}() to hashed-waitqueue wait

2024-05-08 Thread Byungchul Park
Makes Dept able to track dependencies by hashed-waitqueue waits. Signed-off-by: Byungchul Park --- include/linux/wait_bit.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/linux/wait_bit.h b/include/linux/wait_bit.h index 7725b7579b78..fe89282c3e96 100644 --- a/include/linux

[PATCH v14 26/28] fs/jbd2: Use a weaker annotation in journal handling

2024-05-08 Thread Byungchul Park
on lockdep annotaions, dept interpets rwsem_acquire_read() as a potential wait and might report a deadlock by the wait. So replaced it with trylock version of annotation. Signed-off-by: Byungchul Park --- fs/jbd2/transaction.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/jbd2

[PATCH v14 02/28] dept: Implement Dept(Dependency Tracker)

2024-05-08 Thread Byungchul Park
iple reporting thanks to simple and quite generalized design. Of course, false positive reports should be fixed anyway but it's no longer as a critical problem as it was. Signed-off-by: Byungchul Park --- include/linux/dept.h| 567 ++ include/linux/hardirq.h |3 + inc

[PATCH v14 20/28] dept: Apply timeout consideration to hashed-waitqueue wait

2024-05-08 Thread Byungchul Park
Now that CONFIG_DEPT_AGGRESSIVE_TIMEOUT_WAIT was introduced, apply the consideration to hashed-waitqueue wait, assuming an input 'ret' in ___wait_var_event() macro is used as a timeout value. Signed-off-by: Byungchul Park --- include/linux/wait_bit.h | 2 +- 1 file changed, 1 insertion(+), 1

[PATCH v14 19/28] dept: Apply timeout consideration to waitqueue wait

2024-05-08 Thread Byungchul Park
Now that CONFIG_DEPT_AGGRESSIVE_TIMEOUT_WAIT was introduced, apply the consideration to waitqueue wait, assuming an input 'ret' in ___wait_event() macro is used as a timeout value. Signed-off-by: Byungchul Park --- include/linux/wait.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff

[PATCH v14 11/28] dept: Apply sdt_might_sleep_{start, end}() to wait_for_completion()/complete()

2024-05-08 Thread Byungchul Park
Makes Dept able to track dependencies by wait_for_completion()/complete(). Signed-off-by: Byungchul Park --- include/linux/completion.h | 30 +- 1 file changed, 25 insertions(+), 5 deletions(-) diff --git a/include/linux/completion.h b/include/linux/completion.h

[PATCH v14 27/28] dept: Add documentation for Dept

2024-05-08 Thread Byungchul Park
This document describes the concept of Dept. Signed-off-by: Byungchul Park --- Documentation/dependency/dept.txt | 735 ++ 1 file changed, 735 insertions(+) create mode 100644 Documentation/dependency/dept.txt diff --git a/Documentation/dependency/dept.txt b

[PATCH v14 24/28] dept: Print event context requestor's stacktrace on report

2024-05-08 Thread Byungchul Park
it makes hard to interpret dept's report in that case. So made it print the event requestor's stacktrace instead of the event context's start, in place of [S] in report. Signed-off-by: Byungchul Park --- include/linux/dept.h | 13 +++ kernel/dependency/dept.c | 83

[PATCH v14 17/28] dept: Apply timeout consideration to wait_for_completion()/complete()

2024-05-08 Thread Byungchul Park
Now that CONFIG_DEPT_AGGRESSIVE_TIMEOUT_WAIT was introduced, apply the consideration to wait_for_completion()/complete(). Signed-off-by: Byungchul Park --- include/linux/completion.h | 4 ++-- kernel/sched/completion.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git

[PATCH v14 23/28] dept: Track PG_locked with dept

2024-05-08 Thread Byungchul Park
Makes Dept able to track PG_locked waits and events. It's going to be useful in practice. See the following link that shows dept worked with PG_locked and can detect real issues: https://lore.kernel.org/lkml/1674268856-31807-1-git-send-email-byungchul.p...@lge.com/ Signed-off-by: Byungchul

[PATCH v14 22/28] dept: Make Dept able to work with an external wgen

2024-05-08 Thread Byungchul Park
be too big to accept. It'd be better to keep the minimum data in the case, which is timestamp called 'wgen' that Dept makes use of. So made Dept able to work with an external wgen when needed. Signed-off-by: Byungchul Park --- include/linux/dept.h | 18 ++ include/linux

[PATCH v14 07/28] dept: Distinguish each syscall context from another

2024-05-08 Thread Byungchul Park
, conservatively let Dept not track dependencies across different syscalls. Signed-off-by: Byungchul Park --- arch/arm64/kernel/syscall.c | 3 ++ arch/x86/entry/common.c | 4 +++ include/linux/dept.h| 39 - kernel/dependency/dept.c| 67

[PATCH v14 25/28] cpu/hotplug: Use a weaker annotation in AP thread

2024-05-08 Thread Byungchul Park
ntial wait and might report a deadlock by the wait. So replaced it with trylock version of annotation. Signed-off-by: Byungchul Park --- kernel/cpu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/cpu.c b/kernel/cpu.c index 63447eb85dab..da969f7269b5 100644 --- a/kernel/c

[PATCH v14 28/28] dept: Add documentation for Dept's APIs

2024-05-08 Thread Byungchul Park
This document describes the APIs of Dept. Signed-off-by: Byungchul Park --- Documentation/dependency/dept_api.txt | 117 ++ 1 file changed, 117 insertions(+) create mode 100644 Documentation/dependency/dept_api.txt diff --git a/Documentation/dependency/dept_api.txt b

[PATCH v14 05/28] dept: Tie to Lockdep and IRQ tracing

2024-05-08 Thread Byungchul Park
How to place Dept this way looks so ugly. But it's inevitable for now. The way should be enhanced gradually. Signed-off-by: Byungchul Park --- include/linux/irqflags.h| 7 +- include/linux/local_lock_internal.h | 1 + include/linux/lockdep.h | 102

[PATCH v14 13/28] dept: Apply sdt_might_sleep_{start, end}() to waitqueue wait

2024-05-08 Thread Byungchul Park
Makes Dept able to track dependencies by waitqueue waits. Signed-off-by: Byungchul Park --- include/linux/wait.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/linux/wait.h b/include/linux/wait.h index 8aa3372f21a0..3177550a1b42 100644 --- a/include/linux/wait.h +++ b/include

[PATCH v14 16/28] dept: Track timeout waits separately with a new Kconfig

2024-05-08 Thread Byungchul Park
be turned on/off depending on the purpose. Signed-off-by: Byungchul Park --- include/linux/dept.h | 15 ++--- include/linux/dept_ldt.h | 6 ++-- include/linux/dept_sdt.h | 12 +--- kernel/dependency/dept.c | 66 ++-- lib/Kconfig.debug| 10

[PATCH v14 04/28] dept: Add lock dependency tracker APIs

2024-05-08 Thread Byungchul Park
Wrapped the base APIs for easier annotation on typical lock. Signed-off-by: Byungchul Park --- include/linux/dept_ldt.h | 77 1 file changed, 77 insertions(+) create mode 100644 include/linux/dept_ldt.h diff --git a/include/linux/dept_ldt.h b/include

[PATCH v14 06/28] dept: Add proc knobs to show stats and dependency graph

2024-05-08 Thread Byungchul Park
It'd be useful to show Dept internal stats and dependency graph on runtime via proc for better information. Introduced the knobs. Signed-off-by: Byungchul Park --- kernel/dependency/Makefile| 1 + kernel/dependency/dept.c | 24 +++- kernel/dependency/dept_internal.h | 26

[PATCH v14 08/28] dept: Distinguish each work from another

2024-05-08 Thread Byungchul Park
Workqueue already provides concurrency control. By that, any wait in a work doesn't prevents events in other works with the control enabled. Thus, each work would better be considered a different context. So let Dept assign a different context id to each work. Signed-off-by: Byungchul Park

[PATCH v14 15/28] dept: Apply sdt_might_sleep_{start, end}() to dma fence wait

2024-05-08 Thread Byungchul Park
Makes Dept able to track dma fence waits. Signed-off-by: Byungchul Park --- drivers/dma-buf/dma-fence.c | 5 + 1 file changed, 5 insertions(+) diff --git a/drivers/dma-buf/dma-fence.c b/drivers/dma-buf/dma-fence.c index 0393a9bba3a8..d6f9b339b143 100644 --- a/drivers/dma-buf/dma-fence.c

[PATCH v14 12/28] dept: Apply sdt_might_sleep_{start,end}() to swait

2024-05-08 Thread Byungchul Park
Makes Dept able to track dependencies by swaits. Signed-off-by: Byungchul Park --- include/linux/swait.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/linux/swait.h b/include/linux/swait.h index d324419482a0..277ac74f61c3 100644 --- a/include/linux/swait.h +++ b/include/linux

[PATCH v14 01/28] llist: Move llist_{head, node} definition to types.h

2024-05-08 Thread Byungchul Park
llist_head and llist_node can be used by very primitives. For example, Dept for tracking dependency uses llist things in its header. To avoid header dependency, move those to types.h. Signed-off-by: Byungchul Park --- include/linux/llist.h | 8 include/linux/types.h | 8 2

[PATCH v14 00/28] DEPT(Dependency Tracker)

2024-05-08 Thread Byungchul Park
t() but __schedule(). (feedback from Linus and Matthew) 2. Use try version at lockdep_acquire_cpus_lock() annotation. 3. Distinguish each syscall context from another. Byungchul Park (28): llist: Move llist_{head,node} definition to types.h dept: Implement Dept(Dependency

[PATCH v13 26/27] fs/jbd2: Use a weaker annotation in journal handling

2024-03-06 Thread Byungchul Park
on lockdep annotaions, dept interpets rwsem_acquire_read() as a potential wait and might report a deadlock by the wait. So replaced it with trylock version of annotation. Signed-off-by: Byungchul Park --- fs/jbd2/transaction.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/jbd2

[PATCH v13 09/27] dept: Apply sdt_might_sleep_{start, end}() to waitqueue wait

2024-03-06 Thread Byungchul Park
Makes Dept able to track dependencies by waitqueue waits. Signed-off-by: Byungchul Park --- include/linux/wait.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/linux/wait.h b/include/linux/wait.h index 3473b663176f..ebeb4678859f 100644 --- a/include/linux/wait.h +++ b/include

[PATCH v13 19/27] dept: Apply timeout consideration to waitqueue wait

2024-03-06 Thread Byungchul Park
Now that CONFIG_DEPT_AGGRESSIVE_TIMEOUT_WAIT was introduced, apply the consideration to waitqueue wait, assuming an input 'ret' in ___wait_event() macro is used as a timeout value. Signed-off-by: Byungchul Park --- include/linux/wait.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff

[PATCH v13 27/27] dept: Add documentation for Dept

2024-03-06 Thread Byungchul Park
This document describes the concept of Dept. Signed-off-by: Byungchul Park --- Documentation/dependency/dept.txt | 735 ++ 1 file changed, 735 insertions(+) create mode 100644 Documentation/dependency/dept.txt diff --git a/Documentation/dependency/dept.txt b

[PATCH v13 22/27] dept: Record the latest one out of consecutive waits of the same class

2024-03-06 Thread Byungchul Park
the whole history buffer for that, since it'd cost too high, alternatively, let's keep the latest one at least when the same class'ed waits consecutively appear. Signed-off-by: Byungchul Park --- kernel/dependency/dept.c | 21 - 1 file changed, 20 insertions(+), 1 deletion

[PATCH v13 23/27] dept: Make Dept able to work with an external wgen

2024-03-06 Thread Byungchul Park
be too big to accept. It'd be better to keep the minimum data in the case, which is timestamp called 'wgen' that Dept makes use of. So made Dept able to work with an external wgen when needed. Signed-off-by: Byungchul Park --- include/linux/dept.h | 18 ++ include/linux

[PATCH v13 13/27] dept: Add a mechanism to refill the internal memory pools on running out

2024-03-06 Thread Byungchul Park
for the refill on the lack by any chance, using irq work and workqueue that fits on the contrained environment. Signed-off-by: Byungchul Park --- include/linux/dept.h| 19 -- kernel/dependency/dept.c| 104 +++- kernel/dependency/dept_object.h | 10

[PATCH v13 14/27] cpu/hotplug: Use a weaker annotation in AP thread

2024-03-06 Thread Byungchul Park
ntial wait and might report a deadlock by the wait. So replaced it with trylock version of annotation. Signed-off-by: Byungchul Park --- kernel/cpu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/cpu.c b/kernel/cpu.c index a86972a91991..b708989f789f 100644 --- a/kernel/c

[PATCH v13 21/27] dept: Apply timeout consideration to dma fence wait

2024-03-06 Thread Byungchul Park
Now that CONFIG_DEPT_AGGRESSIVE_TIMEOUT_WAIT was introduced, apply the consideration to dma fence wait. Signed-off-by: Byungchul Park --- drivers/dma-buf/dma-fence.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/dma-buf/dma-fence.c b/drivers/dma-buf/dma-fence.c

[PATCH v13 20/27] dept: Apply timeout consideration to hashed-waitqueue wait

2024-03-06 Thread Byungchul Park
Now that CONFIG_DEPT_AGGRESSIVE_TIMEOUT_WAIT was introduced, apply the consideration to hashed-waitqueue wait, assuming an input 'ret' in ___wait_var_event() macro is used as a timeout value. Signed-off-by: Byungchul Park --- include/linux/wait_bit.h | 2 +- 1 file changed, 1 insertion(+), 1

[PATCH v13 11/27] dept: Distinguish each syscall context from another

2024-03-06 Thread Byungchul Park
, conservatively let Dept not track dependencies across different syscalls. Signed-off-by: Byungchul Park --- arch/arm64/kernel/syscall.c | 3 ++ arch/x86/entry/common.c | 4 +++ include/linux/dept.h| 39 - kernel/dependency/dept.c| 67

[PATCH v13 16/27] dept: Track timeout waits separately with a new Kconfig

2024-03-06 Thread Byungchul Park
be turned on/off depending on the purpose. Signed-off-by: Byungchul Park --- include/linux/dept.h | 15 ++--- include/linux/dept_ldt.h | 6 ++-- include/linux/dept_sdt.h | 12 +--- kernel/dependency/dept.c | 66 ++-- lib/Kconfig.debug| 10

[PATCH v13 17/27] dept: Apply timeout consideration to wait_for_completion()/complete()

2024-03-06 Thread Byungchul Park
Now that CONFIG_DEPT_AGGRESSIVE_TIMEOUT_WAIT was introduced, apply the consideration to wait_for_completion()/complete(). Signed-off-by: Byungchul Park --- include/linux/completion.h | 4 ++-- kernel/sched/completion.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git

[PATCH v13 25/27] dept: Print event context requestor's stacktrace on report

2024-03-06 Thread Byungchul Park
it makes hard to interpret dept's report in that case. So made it print the event requestor's stacktrace instead of the event context's start, in place of [S] in report. Signed-off-by: Byungchul Park --- include/linux/dept.h | 13 +++ kernel/dependency/dept.c | 83

[PATCH v13 05/27] dept: Tie to Lockdep and IRQ tracing

2024-03-06 Thread Byungchul Park
How to place Dept this way looks so ugly. But it's inevitable for now. The way should be enhanced gradually. Signed-off-by: Byungchul Park --- include/linux/irqflags.h| 7 +- include/linux/local_lock_internal.h | 1 + include/linux/lockdep.h | 102

[PATCH v13 18/27] dept: Apply timeout consideration to swait

2024-03-06 Thread Byungchul Park
Now that CONFIG_DEPT_AGGRESSIVE_TIMEOUT_WAIT was introduced, apply the consideration to swait, assuming an input 'ret' in ___swait_event() macro is used as a timeout value. Signed-off-by: Byungchul Park --- include/linux/swait.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

[PATCH v13 08/27] dept: Apply sdt_might_sleep_{start,end}() to swait

2024-03-06 Thread Byungchul Park
Makes Dept able to track dependencies by swaits. Signed-off-by: Byungchul Park --- include/linux/swait.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/linux/swait.h b/include/linux/swait.h index d324419482a0..277ac74f61c3 100644 --- a/include/linux/swait.h +++ b/include/linux

[PATCH v13 12/27] dept: Distinguish each work from another

2024-03-06 Thread Byungchul Park
Workqueue already provides concurrency control. By that, any wait in a work doesn't prevents events in other works with the control enabled. Thus, each work would better be considered a different context. So let Dept assign a different context id to each work. Signed-off-by: Byungchul Park

[PATCH v13 07/27] dept: Apply sdt_might_sleep_{start, end}() to wait_for_completion()/complete()

2024-03-06 Thread Byungchul Park
Makes Dept able to track dependencies by wait_for_completion()/complete(). Signed-off-by: Byungchul Park --- include/linux/completion.h | 30 +- 1 file changed, 25 insertions(+), 5 deletions(-) diff --git a/include/linux/completion.h b/include/linux/completion.h

[PATCH v13 15/27] dept: Apply sdt_might_sleep_{start, end}() to dma fence wait

2024-03-06 Thread Byungchul Park
Makes Dept able to track dma fence waits. Signed-off-by: Byungchul Park --- drivers/dma-buf/dma-fence.c | 5 + 1 file changed, 5 insertions(+) diff --git a/drivers/dma-buf/dma-fence.c b/drivers/dma-buf/dma-fence.c index 8aa8f8cb7071..76dba11f0dab 100644 --- a/drivers/dma-buf/dma-fence.c

[PATCH v13 06/27] dept: Add proc knobs to show stats and dependency graph

2024-03-06 Thread Byungchul Park
It'd be useful to show Dept internal stats and dependency graph on runtime via proc for better information. Introduced the knobs. Signed-off-by: Byungchul Park --- kernel/dependency/Makefile| 1 + kernel/dependency/dept.c | 24 +++- kernel/dependency/dept_internal.h | 26

[PATCH v13 00/27] DEPT(Dependency Tracker)

2024-03-06 Thread Byungchul Park
ion. 3. Distinguish each syscall context from another. Byungchul Park (27): llist: Move llist_{head,node} definition to types.h dept: Implement Dept(Dependency Tracker) dept: Add single event dependency tracker APIs dept: Add lock dependency tracker APIs dept: Tie to Lockdep

[PATCH v13 10/27] dept: Apply sdt_might_sleep_{start, end}() to hashed-waitqueue wait

2024-03-06 Thread Byungchul Park
Makes Dept able to track dependencies by hashed-waitqueue waits. Signed-off-by: Byungchul Park --- include/linux/wait_bit.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/linux/wait_bit.h b/include/linux/wait_bit.h index 7725b7579b78..fe89282c3e96 100644 --- a/include/linux

[PATCH v13 04/27] dept: Add lock dependency tracker APIs

2024-03-06 Thread Byungchul Park
Wrapped the base APIs for easier annotation on typical lock. Signed-off-by: Byungchul Park --- include/linux/dept_ldt.h | 77 1 file changed, 77 insertions(+) create mode 100644 include/linux/dept_ldt.h diff --git a/include/linux/dept_ldt.h b/include

[PATCH v13 24/27] dept: Track PG_locked with dept

2024-03-06 Thread Byungchul Park
Makes Dept able to track PG_locked waits and events. It's going to be useful in practice. See the following link that shows dept worked with PG_locked and can detect real issues: https://lore.kernel.org/lkml/1674268856-31807-1-git-send-email-byungchul.p...@lge.com/ Signed-off-by: Byungchul

[PATCH v13 03/27] dept: Add single event dependency tracker APIs

2024-03-06 Thread Byungchul Park
(_wait); That's it! Signed-off-by: Byungchul Park --- include/linux/dept_sdt.h | 62 1 file changed, 62 insertions(+) create mode 100644 include/linux/dept_sdt.h diff --git a/include/linux/dept_sdt.h b/include/linux/dept_sdt.h new file mode 100644 index

[PATCH v13 01/27] llist: Move llist_{head, node} definition to types.h

2024-03-06 Thread Byungchul Park
llist_head and llist_node can be used by very primitives. For example, Dept for tracking dependency uses llist things in its header. To avoid header dependency, move those to types.h. Signed-off-by: Byungchul Park --- include/linux/llist.h | 8 include/linux/types.h | 8 2

[PATCH v13 02/27] dept: Implement Dept(Dependency Tracker)

2024-03-06 Thread Byungchul Park
iple reporting thanks to simple and quite generalized design. Of course, false positive reports should be fixed anyway but it's no longer as a critical problem as it was. Signed-off-by: Byungchul Park --- include/linux/dept.h| 567 ++ include/linux/hardirq.h |3 + inc

[PATCH v12 02/27] dept: Implement Dept(Dependency Tracker)

2024-02-21 Thread Byungchul Park
iple reporting thanks to simple and quite generalized design. Of course, false positive reports should be fixed anyway but it's no longer as a critical problem as it was. Signed-off-by: Byungchul Park --- include/linux/dept.h| 567 ++ include/linux/hardirq.h |3 + inc

[PATCH v12 21/27] dept: Apply timeout consideration to dma fence wait

2024-02-21 Thread Byungchul Park
Now that CONFIG_DEPT_AGGRESSIVE_TIMEOUT_WAIT was introduced, apply the consideration to dma fence wait. Signed-off-by: Byungchul Park --- drivers/dma-buf/dma-fence.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/dma-buf/dma-fence.c b/drivers/dma-buf/dma-fence.c

[PATCH v12 25/27] dept: Print event context requestor's stacktrace on report

2024-02-21 Thread Byungchul Park
it makes hard to interpret dept's report in that case. So made it print the event requestor's stacktrace instead of the event context's start, in place of [S] in report. Signed-off-by: Byungchul Park --- include/linux/dept.h | 13 +++ kernel/dependency/dept.c | 83

[PATCH v12 07/27] dept: Apply sdt_might_sleep_{start, end}() to wait_for_completion()/complete()

2024-02-21 Thread Byungchul Park
Makes Dept able to track dependencies by wait_for_completion()/complete(). Signed-off-by: Byungchul Park --- include/linux/completion.h | 30 +- 1 file changed, 25 insertions(+), 5 deletions(-) diff --git a/include/linux/completion.h b/include/linux/completion.h

[PATCH v12 13/27] dept: Add a mechanism to refill the internal memory pools on running out

2024-02-21 Thread Byungchul Park
for the refill on the lack by any chance, using irq work and workqueue that fits on the contrained environment. Signed-off-by: Byungchul Park --- include/linux/dept.h| 19 -- kernel/dependency/dept.c| 104 +++- kernel/dependency/dept_object.h | 10

[PATCH v12 22/27] dept: Record the latest one out of consecutive waits of the same class

2024-02-21 Thread Byungchul Park
the whole history buffer for that, since it'd cost too high, alternatively, let's keep the latest one at least when the same class'ed waits consecutively appear. Signed-off-by: Byungchul Park --- kernel/dependency/dept.c | 21 - 1 file changed, 20 insertions(+), 1 deletion

[PATCH v12 18/27] dept: Apply timeout consideration to swait

2024-02-21 Thread Byungchul Park
Now that CONFIG_DEPT_AGGRESSIVE_TIMEOUT_WAIT was introduced, apply the consideration to swait, assuming an input 'ret' in ___swait_event() macro is used as a timeout value. Signed-off-by: Byungchul Park --- include/linux/swait.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

[PATCH v12 19/27] dept: Apply timeout consideration to waitqueue wait

2024-02-21 Thread Byungchul Park
Now that CONFIG_DEPT_AGGRESSIVE_TIMEOUT_WAIT was introduced, apply the consideration to waitqueue wait, assuming an input 'ret' in ___wait_event() macro is used as a timeout value. Signed-off-by: Byungchul Park --- include/linux/wait.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff

[PATCH v12 20/27] dept: Apply timeout consideration to hashed-waitqueue wait

2024-02-21 Thread Byungchul Park
Now that CONFIG_DEPT_AGGRESSIVE_TIMEOUT_WAIT was introduced, apply the consideration to hashed-waitqueue wait, assuming an input 'ret' in ___wait_var_event() macro is used as a timeout value. Signed-off-by: Byungchul Park --- include/linux/wait_bit.h | 2 +- 1 file changed, 1 insertion(+), 1

[PATCH v12 04/27] dept: Add lock dependency tracker APIs

2024-02-21 Thread Byungchul Park
Wrapped the base APIs for easier annotation on typical lock. Signed-off-by: Byungchul Park --- include/linux/dept_ldt.h | 77 1 file changed, 77 insertions(+) create mode 100644 include/linux/dept_ldt.h diff --git a/include/linux/dept_ldt.h b/include

[PATCH v12 08/27] dept: Apply sdt_might_sleep_{start,end}() to swait

2024-02-21 Thread Byungchul Park
Makes Dept able to track dependencies by swaits. Signed-off-by: Byungchul Park --- include/linux/swait.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/linux/swait.h b/include/linux/swait.h index d324419482a0..277ac74f61c3 100644 --- a/include/linux/swait.h +++ b/include/linux

[PATCH v12 09/27] dept: Apply sdt_might_sleep_{start, end}() to waitqueue wait

2024-02-21 Thread Byungchul Park
Makes Dept able to track dependencies by waitqueue waits. Signed-off-by: Byungchul Park --- include/linux/wait.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/linux/wait.h b/include/linux/wait.h index 3473b663176f..ebeb4678859f 100644 --- a/include/linux/wait.h +++ b/include

[PATCH v12 10/27] dept: Apply sdt_might_sleep_{start, end}() to hashed-waitqueue wait

2024-02-21 Thread Byungchul Park
Makes Dept able to track dependencies by hashed-waitqueue waits. Signed-off-by: Byungchul Park --- include/linux/wait_bit.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/linux/wait_bit.h b/include/linux/wait_bit.h index 7725b7579b78..fe89282c3e96 100644 --- a/include/linux

[PATCH v12 27/27] dept: Add 'Dept' documentation

2024-02-21 Thread Byungchul Park
This document describes the concept of Dept. Signed-off-by: Byungchul Park --- Documentation/dependency/dept.txt | 283 ++ 1 file changed, 283 insertions(+) create mode 100644 Documentation/dependency/dept.txt diff --git a/Documentation/dependency/dept.txt b

[PATCH v12 00/27] DEPT(Dependency Tracker)

2024-02-21 Thread Byungchul Park
t() but __schedule(). (feedback from Linus and Matthew) 2. Use try version at lockdep_acquire_cpus_lock() annotation. 3. Distinguish each syscall context from another. Byungchul Park (27): llist: Move llist_{head,node} definition to types.h dept: Implement Dept(De

[PATCH v12 11/27] dept: Distinguish each syscall context from another

2024-02-21 Thread Byungchul Park
, conservatively let Dept not track dependencies across different syscalls. Signed-off-by: Byungchul Park --- arch/arm64/kernel/syscall.c | 3 ++ arch/x86/entry/common.c | 4 +++ include/linux/dept.h| 39 - kernel/dependency/dept.c| 67

[PATCH v12 16/27] dept: Track timeout waits separately with a new Kconfig

2024-02-21 Thread Byungchul Park
be turned on/off depending on the purpose. Signed-off-by: Byungchul Park --- include/linux/dept.h | 15 ++--- include/linux/dept_ldt.h | 6 ++-- include/linux/dept_sdt.h | 12 +--- kernel/dependency/dept.c | 66 ++-- lib/Kconfig.debug| 10

[PATCH v12 24/27] dept: Track PG_locked with dept

2024-02-21 Thread Byungchul Park
Makes Dept able to track PG_locked waits and events. It's going to be useful in practice. See the following link that shows dept worked with PG_locked and can detect real issues: https://lore.kernel.org/lkml/1674268856-31807-1-git-send-email-byungchul.p...@lge.com/ Signed-off-by: Byungchul

[PATCH v12 17/27] dept: Apply timeout consideration to wait_for_completion()/complete()

2024-02-21 Thread Byungchul Park
Now that CONFIG_DEPT_AGGRESSIVE_TIMEOUT_WAIT was introduced, apply the consideration to wait_for_completion()/complete(). Signed-off-by: Byungchul Park --- include/linux/completion.h | 4 ++-- kernel/sched/completion.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git

[PATCH v12 15/27] dept: Apply sdt_might_sleep_{start, end}() to dma fence wait

2024-02-21 Thread Byungchul Park
Makes Dept able to track dma fence waits. Signed-off-by: Byungchul Park --- drivers/dma-buf/dma-fence.c | 5 + 1 file changed, 5 insertions(+) diff --git a/drivers/dma-buf/dma-fence.c b/drivers/dma-buf/dma-fence.c index 8aa8f8cb7071..76dba11f0dab 100644 --- a/drivers/dma-buf/dma-fence.c

[PATCH v12 14/27] cpu/hotplug: Use a weaker annotation in AP thread

2024-02-21 Thread Byungchul Park
ntial wait and might report a deadlock by the wait. So replaced it with trylock version of annotation. Signed-off-by: Byungchul Park --- kernel/cpu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/cpu.c b/kernel/cpu.c index a86972a91991..b708989f789f 100644 --- a/kernel/c

[PATCH v12 05/27] dept: Tie to Lockdep and IRQ tracing

2024-02-21 Thread Byungchul Park
How to place Dept this way looks so ugly. But it's inevitable for now. The way should be enhanced gradually. Signed-off-by: Byungchul Park --- include/linux/irqflags.h| 7 +- include/linux/local_lock_internal.h | 1 + include/linux/lockdep.h | 102

[PATCH v12 23/27] dept: Make Dept able to work with an external wgen

2024-02-21 Thread Byungchul Park
be too big to accept. It'd be better to keep the minimum data in the case, which is timestamp called 'wgen' that Dept makes use of. So made Dept able to work with an external wgen when needed. Signed-off-by: Byungchul Park --- include/linux/dept.h | 18 ++ include/linux

[PATCH v12 06/27] dept: Add proc knobs to show stats and dependency graph

2024-02-21 Thread Byungchul Park
It'd be useful to show Dept internal stats and dependency graph on runtime via proc for better information. Introduced the knobs. Signed-off-by: Byungchul Park --- kernel/dependency/Makefile| 1 + kernel/dependency/dept.c | 24 +++- kernel/dependency/dept_internal.h | 26

[PATCH v12 12/27] dept: Distinguish each work from another

2024-02-21 Thread Byungchul Park
Workqueue already provides concurrency control. By that, any wait in a work doesn't prevents events in other works with the control enabled. Thus, each work would better be considered a different context. So let Dept assign a different context id to each work. Signed-off-by: Byungchul Park

[PATCH v12 26/27] fs/jbd2: Use a weaker annotation in journal handling

2024-02-21 Thread Byungchul Park
on lockdep annotaions, dept interpets rwsem_acquire_read() as a potential wait and might report a deadlock by the wait. So replaced it with trylock version of annotation. Signed-off-by: Byungchul Park --- fs/jbd2/transaction.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/jbd2

[PATCH v12 01/27] llist: Move llist_{head, node} definition to types.h

2024-02-21 Thread Byungchul Park
llist_head and llist_node can be used by very primitives. For example, Dept for tracking dependency uses llist things in its header. To avoid header dependency, move those to types.h. Signed-off-by: Byungchul Park --- include/linux/llist.h | 8 include/linux/types.h | 8 2

[PATCH v12 03/27] dept: Add single event dependency tracker APIs

2024-02-21 Thread Byungchul Park
(_wait); That's it! Signed-off-by: Byungchul Park --- include/linux/dept_sdt.h | 62 1 file changed, 62 insertions(+) create mode 100644 include/linux/dept_sdt.h diff --git a/include/linux/dept_sdt.h b/include/linux/dept_sdt.h new file mode 100644 index

Re: [PATCH v11 14/26] locking/lockdep, cpu/hotplus: Use a weaker annotation in AP thread

2024-02-12 Thread Byungchul Park
On Mon, Feb 12, 2024 at 04:16:41PM +0100, Thomas Gleixner wrote: > On Tue, Jan 30 2024 at 11:58, Byungchul Park wrote: > > On Fri, Jan 26, 2024 at 06:30:02PM +0100, Thomas Gleixner wrote: > >> On Wed, Jan 24 2024 at 20:59, Byungchul Park wrote: > >> > >> Wh

Re: [PATCH v11 14/26] locking/lockdep, cpu/hotplus: Use a weaker annotation in AP thread

2024-01-29 Thread Byungchul Park
On Fri, Jan 26, 2024 at 06:30:02PM +0100, Thomas Gleixner wrote: > On Wed, Jan 24 2024 at 20:59, Byungchul Park wrote: > > Why is lockdep in the subsystem prefix here? You are changing the CPU > hotplug (not hotplus) code, right? > > > cb92173d1f0 ("locking/lockdep

Re: [PATCH v11 14/26] locking/lockdep, cpu/hotplus: Use a weaker annotation in AP thread

2024-01-28 Thread Byungchul Park
On Fri, Jan 26, 2024 at 06:30:02PM +0100, Thomas Gleixner wrote: > On Wed, Jan 24 2024 at 20:59, Byungchul Park wrote: > > Why is lockdep in the subsystem prefix here? You are changing the CPU > hotplug (not hotplus) code, right? I will fix the typo ;( Thank you. I referred t

[PATCH v11 26/26] locking/lockdep, fs/jbd2: Use a weaker annotation in journal handling

2024-01-24 Thread Byungchul Park
annotation for that. Furthermore, now that Dept was introduced, false positive alarms was reported by that. Replaced it with try lock annotation. Signed-off-by: Byungchul Park --- fs/jbd2/transaction.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/jbd2/transaction.c b/fs

[PATCH v11 14/26] locking/lockdep, cpu/hotplus: Use a weaker annotation in AP thread

2024-01-24 Thread Byungchul Park
introduced, false positive alarms was reported by that. Replaced it with try lock annotation. Signed-off-by: Byungchul Park --- kernel/cpu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/cpu.c b/kernel/cpu.c index a86972a91991..b708989f789f 100644 --- a/kernel/cpu.c ++

[PATCH v11 19/26] dept: Apply timeout consideration to waitqueue wait

2024-01-24 Thread Byungchul Park
Now that CONFIG_DEPT_AGGRESSIVE_TIMEOUT_WAIT was introduced, apply the consideration to waitqueue wait, assuming an input 'ret' in ___wait_event() macro is used as a timeout value. Signed-off-by: Byungchul Park --- include/linux/wait.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff

[PATCH v11 04/26] dept: Add lock dependency tracker APIs

2024-01-24 Thread Byungchul Park
Wrapped the base APIs for easier annotation on typical lock. Signed-off-by: Byungchul Park --- include/linux/dept_ldt.h | 77 1 file changed, 77 insertions(+) create mode 100644 include/linux/dept_ldt.h diff --git a/include/linux/dept_ldt.h b/include

[PATCH v11 06/26] dept: Add proc knobs to show stats and dependency graph

2024-01-24 Thread Byungchul Park
It'd be useful to show Dept internal stats and dependency graph on runtime via proc for better information. Introduced the knobs. Signed-off-by: Byungchul Park --- kernel/dependency/Makefile| 1 + kernel/dependency/dept.c | 24 +++- kernel/dependency/dept_internal.h | 26

[PATCH v11 20/26] dept: Apply timeout consideration to hashed-waitqueue wait

2024-01-24 Thread Byungchul Park
Now that CONFIG_DEPT_AGGRESSIVE_TIMEOUT_WAIT was introduced, apply the consideration to hashed-waitqueue wait, assuming an input 'ret' in ___wait_var_event() macro is used as a timeout value. Signed-off-by: Byungchul Park --- include/linux/wait_bit.h | 2 +- 1 file changed, 1 insertion(+), 1

[PATCH v11 25/26] dept: Print event context requestor's stacktrace on report

2024-01-24 Thread Byungchul Park
it makes hard to interpret dept's report in that case. So made it print the event requestor's stacktrace instead of the event context's start, in place of [S] in report. Signed-off-by: Byungchul Park --- include/linux/dept.h | 13 +++ kernel/dependency/dept.c | 83

[PATCH v11 23/26] dept: Make Dept able to work with an external wgen

2024-01-24 Thread Byungchul Park
be too big to accept. It'd be better to keep the minimum data in the case, which is timestamp called 'wgen' that Dept makes use of. So made Dept able to work with an external wgen when needed. Signed-off-by: Byungchul Park --- include/linux/dept.h | 18 ++ include/linux

[PATCH v11 24/26] dept: Track PG_locked with dept

2024-01-24 Thread Byungchul Park
Makes Dept able to track PG_locked waits and events. It's going to be useful in practice. See the following link that shows dept worked with PG_locked and can detect real issues: https://lore.kernel.org/lkml/1674268856-31807-1-git-send-email-byungchul.p...@lge.com/ Signed-off-by: Byungchul

[PATCH v11 21/26] dept: Apply timeout consideration to dma fence wait

2024-01-24 Thread Byungchul Park
Now that CONFIG_DEPT_AGGRESSIVE_TIMEOUT_WAIT was introduced, apply the consideration to dma fence wait. Signed-off-by: Byungchul Park --- drivers/dma-buf/dma-fence.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/dma-buf/dma-fence.c b/drivers/dma-buf/dma-fence.c

[PATCH v11 10/26] dept: Apply sdt_might_sleep_{start, end}() to hashed-waitqueue wait

2024-01-24 Thread Byungchul Park
Makes Dept able to track dependencies by hashed-waitqueue waits. Signed-off-by: Byungchul Park --- include/linux/wait_bit.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/linux/wait_bit.h b/include/linux/wait_bit.h index 7725b7579b78..fe89282c3e96 100644 --- a/include/linux

  1   2   3   4   5   >