Re: [PATCH net-next v6 1/3] connector/cn_proc: Add hash table for threads

2024-10-30 Thread Jakub Kicinski
On Wed, 23 Oct 2024 09:20:04 -0700 Anjali Kulkarni wrote: > Add a new type PROC_CN_MCAST_NOTIFY to proc connector API, which allows a > thread to notify the kernel that is going to exit with a non-zero exit > code and specify the exit code in it. When thread exits in the kernel, > it will send this

[PATCH net-next v6 2/3] connector/cn_proc: Kunit tests for threads hash table

2024-10-23 Thread Anjali Kulkarni
unit.o CFLAGS_stackinit_kunit.o += $(call cc-disable-warning, switch-unreachable) diff --git a/lib/cn_hash_test.c b/lib/cn_hash_test.c new file mode 100644 index 00000000..efaf727d9b2a --- /dev/null +++ b/lib/cn_hash_test.c @@ -0,0 +1,169 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * KUnit test

[PATCH net-next v6 3/3] connector/cn_proc: Selftest for threads

2024-10-23 Thread Anjali Kulkarni
Test to check if setting PROC_CN_MCAST_NOTIFY in proc connector API, allows a thread's non-zero exit status to be returned to proc_filter. The threads.c program creates 2 child threads. 1st thread handles signal SIGSEGV, and 2nd thread needs to indicate some error condition (value 1) t

[PATCH net-next v6 0/3] Threads support in proc connector

2024-10-23 Thread Anjali Kulkarni
Recently we committed a fix to allow processes to receive notifications for non-zero exits via the process connector module. Commit is a4c9a56e6a2c. However, for threads, when it does a pthread_exit(&exit_status) call, the kernel is not aware of the exit status with which pthread_exit is ca

[PATCH net-next v6 1/3] connector/cn_proc: Add hash table for threads

2024-10-23 Thread Anjali Kulkarni
. Exiting thread can call this either when it wants to call pthread_exit() with non-zero value or from signal handler. Add a new file cn_hash.c which implements a hash table storing the exit codes of abnormally exiting threads, received by the system call above. The key used for the hash table is

Re: [PATCH net-next v5 2/3] connector/cn_proc: Kunit tests for threads hash table

2024-10-23 Thread Anjali Kulkarni
> On Oct 23, 2024, at 8:05 AM, Stanislav Fomichev wrote: > > On 10/23, Anjali Kulkarni wrote: >> […snip…] >> >> >> Yes, make sure all required options are picked up by >> "./tools/testing/kunit/kunit.py run" instead of manually adding options >> and doing modprobe. >

Re: [PATCH net-next v5 2/3] connector/cn_proc: Kunit tests for threads hash table

2024-10-23 Thread Stanislav Fomichev
On 10/23, Anjali Kulkarni wrote: > […snip…] > > > Yes, make sure all required options are picked up by > "./tools/testing/kunit/kunit.py run" instead of manually adding options > and doing modprobe. > >>> > >>> The environment issues are resolved and I am able to run kunit.py

Re: [PATCH net-next v5 2/3] connector/cn_proc: Kunit tests for threads hash table

2024-10-22 Thread Anjali Kulkarni
[…snip…] Yes, make sure all required options are picked up by "./tools/testing/kunit/kunit.py run" instead of manually adding options and doing modprobe. >>> >>> The environment issues are resolved and I am able to run kunit.py, but my >>> tests >>> are not invoked without g

Re: [PATCH net-next v5 2/3] connector/cn_proc: Kunit tests for threads hash table

2024-10-22 Thread Anjali Kulkarni
> On Oct 22, 2024, at 4:50 PM, Stanislav Fomichev wrote: > > On 10/22, Anjali Kulkarni wrote: >> >> >>> On Oct 17, 2024, at 5:55 PM, Stanislav Fomichev >>> wrote: >>> >>> On 10/18, Anjali Kulkarni wrote: > On Oct 17, 2024, at 5:13 PM, Stanislav Fomichev > wrote: >

Re: [PATCH net-next v5 2/3] connector/cn_proc: Kunit tests for threads hash table

2024-10-22 Thread Stanislav Fomichev
On 10/22, Anjali Kulkarni wrote: > > > > On Oct 17, 2024, at 5:55 PM, Stanislav Fomichev > > wrote: > > > > On 10/18, Anjali Kulkarni wrote: > >> > >> > >>> On Oct 17, 2024, at 5:13 PM, Stanislav Fomichev > >>> wrote: > >>> > >>> On 10/17, Anjali Kulkarni wrote: > Kunit tests to test

Re: [PATCH net-next v5 2/3] connector/cn_proc: Kunit tests for threads hash table

2024-10-22 Thread Anjali Kulkarni
> On Oct 17, 2024, at 5:55 PM, Stanislav Fomichev wrote: > > On 10/18, Anjali Kulkarni wrote: >> >> >>> On Oct 17, 2024, at 5:13 PM, Stanislav Fomichev >>> wrote: >>> >>> On 10/17, Anjali Kulkarni wrote: Kunit tests to test hash table add, delete, duplicate add and delete. Add fo

Re: [PATCH net-next v5 2/3] connector/cn_proc: Kunit tests for threads hash table

2024-10-18 Thread kernel test robot
Hi Anjali, kernel test robot noticed the following build errors: [auto build test ERROR on net-next/main] url: https://github.com/intel-lab-lkp/linux/commits/Anjali-Kulkarni/connector-cn_proc-Add-hash-table-for-threads/20241018-021755 base: net-next/main patch link: https

Re: [PATCH net-next v5 2/3] connector/cn_proc: Kunit tests for threads hash table

2024-10-18 Thread kernel test robot
Hi Anjali, kernel test robot noticed the following build errors: [auto build test ERROR on net-next/main] url: https://github.com/intel-lab-lkp/linux/commits/Anjali-Kulkarni/connector-cn_proc-Add-hash-table-for-threads/20241018-021755 base: net-next/main patch link: https

Re: [PATCH net-next v5 3/3] connector/cn_proc: Selftest for threads

2024-10-18 Thread Anjali Kulkarni
t;> >> The threads.c program creates 2 child threads. 1st thread handles signal >> SIGSEGV, and 2nd thread needs to indicate some error condition (value 1) >> to the kernel, instead of using pthread_exit() with 1. >> >> In both cases, child sends notify_netlink_

Re: [PATCH net-next v5 0/3] Threads support in proc connector

2024-10-18 Thread Anjali Kulkarni
. >> >> However, for threads, when it does a pthread_exit(&exit_status) call, the >> kernel is not aware of the exit status with which pthread_exit is called. >> It is sent by child thread to the parent process, if it is waiting in >> pthread_join(). Hence,

Re: [PATCH net-next v5 2/3] connector/cn_proc: Kunit tests for threads hash table

2024-10-18 Thread Stanislav Fomichev
On 10/18, Anjali Kulkarni wrote: > > > > On Oct 17, 2024, at 5:55 PM, Stanislav Fomichev > > wrote: > > > > On 10/18, Anjali Kulkarni wrote: > >> > >> > >>> On Oct 17, 2024, at 5:13 PM, Stanislav Fomichev > >>> wrote: > >>> > >>> On 10/17, Anjali Kulkarni wrote: > Kunit tests to test

Re: [PATCH net-next v5 3/3] connector/cn_proc: Selftest for threads

2024-10-18 Thread Simon Horman
On Thu, Oct 17, 2024 at 11:14:36AM -0700, Anjali Kulkarni wrote: > Test to check if setting PROC_CN_MCAST_NOTIFY in proc connector API, allows > a thread's non-zero exit status to be returned to proc_filter. > > The threads.c program creates 2 child threads. 1st thread handles

Re: [PATCH net-next v5 0/3] Threads support in proc connector

2024-10-18 Thread Simon Horman
On Thu, Oct 17, 2024 at 11:14:33AM -0700, Anjali Kulkarni wrote: > Recently we committed a fix to allow processes to receive notifications for > non-zero exits via the process connector module. Commit is a4c9a56e6a2c. > > However, for threads, when it does a pthread_exit(&exit_s

Re: [PATCH net-next v5 2/3] connector/cn_proc: Kunit tests for threads hash table

2024-10-17 Thread Anjali Kulkarni
> On Oct 17, 2024, at 5:55 PM, Stanislav Fomichev wrote: > > On 10/18, Anjali Kulkarni wrote: >> >> >>> On Oct 17, 2024, at 5:13 PM, Stanislav Fomichev >>> wrote: >>> >>> On 10/17, Anjali Kulkarni wrote: Kunit tests to test hash table add, delete, duplicate add and delete. Add fo

Re: [PATCH net-next v5 2/3] connector/cn_proc: Kunit tests for threads hash table

2024-10-17 Thread Stanislav Fomichev
On 10/18, Anjali Kulkarni wrote: > > > > On Oct 17, 2024, at 5:13 PM, Stanislav Fomichev > > wrote: > > > > On 10/17, Anjali Kulkarni wrote: > >> Kunit tests to test hash table add, delete, duplicate add and delete. > >> Add following configs and compile kernel code: > >> > >> CONFIG_CONNECTO

Re: [PATCH net-next v5 2/3] connector/cn_proc: Kunit tests for threads hash table

2024-10-17 Thread Anjali Kulkarni
> On Oct 17, 2024, at 5:13 PM, Stanislav Fomichev wrote: > > On 10/17, Anjali Kulkarni wrote: >> Kunit tests to test hash table add, delete, duplicate add and delete. >> Add following configs and compile kernel code: >> >> CONFIG_CONNECTOR=y >> CONFIG_PROC_EVENTS=y >> CONFIG_NET=y >> CONFIG_KU

Re: [PATCH net-next v5 2/3] connector/cn_proc: Kunit tests for threads hash table

2024-10-17 Thread Stanislav Fomichev
On 10/17, Anjali Kulkarni wrote: > Kunit tests to test hash table add, delete, duplicate add and delete. > Add following configs and compile kernel code: > > CONFIG_CONNECTOR=y > CONFIG_PROC_EVENTS=y > CONFIG_NET=y > CONFIG_KUNIT=m > CONFIG_CN_HASH_KUNIT_TEST=m > > To run kunit tests: > sudo modp

[PATCH net-next v5 2/3] connector/cn_proc: Kunit tests for threads hash table

2024-10-17 Thread Anjali Kulkarni
-warning, tautological-constant-out-of-range-compare) obj-$(CONFIG_OVERFLOW_KUNIT_TEST) += overflow_kunit.o CFLAGS_stackinit_kunit.o += $(call cc-disable-warning, switch-unreachable) diff --git a/lib/cn_hash_test.c b/lib/cn_hash_test.c new file mode 100644 index 0000..f90989343468 --- /

[PATCH net-next v5 1/3] connector/cn_proc: Add hash table for threads

2024-10-17 Thread Anjali Kulkarni
. Exiting thread can call this either when it wants to call pthread_exit() with non-zero value or from signal handler. Add a new file cn_hash.c which implements a hash table storing the exit codes of abnormally exiting threads, received by the system call above. The key used for the hash table is

[PATCH net-next v5 3/3] connector/cn_proc: Selftest for threads

2024-10-17 Thread Anjali Kulkarni
Test to check if setting PROC_CN_MCAST_NOTIFY in proc connector API, allows a thread's non-zero exit status to be returned to proc_filter. The threads.c program creates 2 child threads. 1st thread handles signal SIGSEGV, and 2nd thread needs to indicate some error condition (value 1) t

[PATCH net-next v5 0/3] Threads support in proc connector

2024-10-17 Thread Anjali Kulkarni
Recently we committed a fix to allow processes to receive notifications for non-zero exits via the process connector module. Commit is a4c9a56e6a2c. However, for threads, when it does a pthread_exit(&exit_status) call, the kernel is not aware of the exit status with which pthread_exit is ca

Re: [PATCH net-next v4 1/3] connector/cn_proc: Add hash table for threads

2024-10-17 Thread Anjali Kulkarni
>> Add a new file cn_hash.c which implements a hash table storing the exit >> codes of abnormally exiting threads, received by the system call above. >> The key used for the hash table is the pid of the thread, so when the >> thread actually exits, we lookup it's pid in

Re: [PATCH net-next v4 1/3] connector/cn_proc: Add hash table for threads

2024-10-17 Thread Stanislav Fomichev
de as a proc filter notification to any > listening process. > Exiting thread can call this either when it wants to call pthread_exit() > with non-zero value or from signal handler. > > Add a new file cn_hash.c which implements a hash table storing the exit > codes of abnormally ex

Re: [PATCH net-next v3 1/3] connector/cn_proc: Add hash table for threads

2024-10-17 Thread Stanislav Fomichev
de as a proc filter notification to any > listening process. > Exiting thread can call this either when it wants to call pthread_exit() > with non-zero value or from signal handler. > > Add a new file cn_hash.c which implements a hash table storing the exit > codes of abnormally ex

[PATCH net-next v4 3/3] connector/cn_proc: Selftest for threads

2024-10-16 Thread Anjali Kulkarni
Test to check if setting PROC_CN_MCAST_NOTIFY in proc connector API, allows a thread's non-zero exit status to be returned to proc_filter. The threads.c program creates 2 child threads. 1st thread handles signal SIGSEGV, and 2nd thread needs to indicate some error condition (value 1) t

[PATCH net-next v4 1/3] connector/cn_proc: Add hash table for threads

2024-10-16 Thread Anjali Kulkarni
. Exiting thread can call this either when it wants to call pthread_exit() with non-zero value or from signal handler. Add a new file cn_hash.c which implements a hash table storing the exit codes of abnormally exiting threads, received by the system call above. The key used for the hash table is

[PATCH net-next v4 2/3] connector/cn_proc: Kunit tests for threads hash table

2024-10-16 Thread Anjali Kulkarni
ll cc-disable-warning, tautological-constant-out-of-range-compare) obj-$(CONFIG_OVERFLOW_KUNIT_TEST) += overflow_kunit.o CFLAGS_stackinit_kunit.o += $(call cc-disable-warning, switch-unreachable) diff --git a/lib/cn_hash_test.c b/lib/cn_hash_test.c new file mode 100644 index 0000..f90

[PATCH net-next v4 0/3] Threads support in proc connector

2024-10-16 Thread Anjali Kulkarni
Recently we committed a fix to allow processes to receive notifications for non-zero exits via the process connector module. Commit is a4c9a56e6a2c. However, for threads, when it does a pthread_exit(&exit_status) call, the kernel is not aware of the exit status with which pthread_exit is ca

[PATCH net-next v3 2/3] connector/cn_proc: Kunit tests for threads hash table

2024-10-16 Thread Anjali Kulkarni
ll cc-disable-warning, tautological-constant-out-of-range-compare) obj-$(CONFIG_OVERFLOW_KUNIT_TEST) += overflow_kunit.o CFLAGS_stackinit_kunit.o += $(call cc-disable-warning, switch-unreachable) diff --git a/lib/cn_hash_test.c b/lib/cn_hash_test.c new file mode 100644 index 0000..78c

[PATCH net-next v3 0/3] Threads support in proc connector

2024-10-16 Thread Anjali Kulkarni
Recently we committed a fix to allow processes to receive notifications for non-zero exits via the process connector module. Commit is a4c9a56e6a2c. However, for threads, when it does a pthread_exit(&exit_status) call, the kernel is not aware of the exit status with which pthread_exit is ca

[PATCH net-next v3 3/3] connector/cn_proc: Selftest for threads

2024-10-16 Thread Anjali Kulkarni
Test to check if setting PROC_CN_MCAST_NOTIFY in proc connector API, allows a thread's non-zero exit status to be returned to proc_filter. The threads.c program creates 2 child threads. 1st thread handles signal SIGSEGV, and 2nd thread needs to indicate some error condition (value 1) t

[PATCH net-next v3 1/3] connector/cn_proc: Add hash table for threads

2024-10-16 Thread Anjali Kulkarni
. Exiting thread can call this either when it wants to call pthread_exit() with non-zero value or from signal handler. Add a new file cn_hash.c which implements a hash table storing the exit codes of abnormally exiting threads, received by the system call above. The key used for the hash table is

Re: [PATCH net-next v2 3/3] connector/cn_proc: Selftest for threads

2024-10-16 Thread Anjali Kulkarni
N_MCAST_NOTIFY in proc connector API, allows >>>> a thread's non-zero exit status to be returned to proc_filter. >>>> >>>> The threads.c program creates 2 child threads. 1st thread handles signal >>>> SIGSEGV, and 2nd thread needs to indicate so

Re: [PATCH net-next v2 1/3] connector/cn_proc: Add hash table for threads

2024-10-15 Thread Anjali Kulkarni
[..snip..] >> +void cn_hash_free_elem(struct uexit_pid_hnode *elem); >> +int cn_hash_add_elem(struct cn_hash_dev *hdev, __u32 uexit_code, pid_t pid); >> +int cn_hash_del_elem(struct cn_hash_dev *hdev, pid_t pid); >> +__u32 cn_hash_del_get_exval(struct cn_hash_dev *hdev, pid_t pid); >> +__u32 cn_

Re: [PATCH net-next v2 3/3] connector/cn_proc: Selftest for threads

2024-10-15 Thread Liam R. Howlett
-zero exit status to be returned to proc_filter. > >> > >> The threads.c program creates 2 child threads. 1st thread handles signal > >> SIGSEGV, and 2nd thread needs to indicate some error condition (value 1) > >> to the kernel, instead of using pthread_exit() with 1. &g

Re: [PATCH net-next v2 2/3] connector/cn_proc: Kunit tests for threads hash table

2024-10-15 Thread Liam R. Howlett
* Anjali Kulkarni [241015 17:11]: ... > >> +MODULE_DESCRIPTION("KUnit test for the connector threads hashtable code"); > >> +MODULE_LICENSE("GPL"); > >> diff --git a/lib/cn_hash_test.h b/lib/cn_hash_test.h > >> new file mode 100644

Re: [PATCH net-next v2 3/3] connector/cn_proc: Selftest for threads

2024-10-15 Thread Anjali Kulkarni
> On Oct 15, 2024, at 12:27 PM, Liam Howlett wrote: > > * Anjali Kulkarni [241015 13:30]: >> Test to check if setting PROC_CN_MCAST_NOTIFY in proc connector API, allows >> a thread's non-zero exit status to be returned to proc_filter. >> >> The threads.

Re: [PATCH net-next v2 2/3] connector/cn_proc: Kunit tests for threads hash table

2024-10-15 Thread Anjali Kulkarni
nnector/cn_hash.c. >> + CONFIG_CONNECTOR=y, CONFIG_PROC_EVENTS=y as well as CONFIG_NET=y >> + needs to be enabled along with CONFIG_CN_HASH_KUNIT_TEST=m and >> + CONFIG_KUNIT=m in .config file to compile and then test as a kernel >> + module with "modprobe c

Re: [PATCH net-next v2 3/3] connector/cn_proc: Selftest for threads

2024-10-15 Thread Liam R. Howlett
* Anjali Kulkarni [241015 13:30]: > Test to check if setting PROC_CN_MCAST_NOTIFY in proc connector API, allows > a thread's non-zero exit status to be returned to proc_filter. > > The threads.c program creates 2 child threads. 1st thread handles signal > SIGSEGV, and

Re: [PATCH net-next v2 2/3] connector/cn_proc: Kunit tests for threads hash table

2024-10-15 Thread Liam R. Howlett
/Makefile > @@ -379,6 +379,7 @@ obj-$(CONFIG_CMDLINE_KUNIT_TEST) += cmdline_kunit.o > obj-$(CONFIG_SLUB_KUNIT_TEST) += slub_kunit.o > obj-$(CONFIG_MEMCPY_KUNIT_TEST) += memcpy_kunit.o > obj-$(CONFIG_IS_SIGNED_TYPE_KUNIT_TEST) += is_signed_type_kunit.o > +obj-$(CONFIG_CN_HASH_KUNIT_

Re: [PATCH net-next v2 1/3] connector/cn_proc: Add hash table for threads

2024-10-15 Thread Anjali Kulkarni
rom signal handler. >> >> Add a new file cn_hash.c which implements a hash table storing the exit >> codes of abnormally exiting threads, received by the system call above. >> The key used for the hash table is the pid of the thread, so when the >> thread actually

Re: [PATCH net-next v2 1/3] connector/cn_proc: Add hash table for threads

2024-10-15 Thread Liam R. Howlett
de as a proc filter notification to any > listening process. > Exiting thread can call this either when it wants to call pthread_exit() > with non-zero value or from signal handler. > > Add a new file cn_hash.c which implements a hash table storing the exit > codes of abnormally ex

[PATCH net-next v2 3/3] connector/cn_proc: Selftest for threads

2024-10-15 Thread Anjali Kulkarni
Test to check if setting PROC_CN_MCAST_NOTIFY in proc connector API, allows a thread's non-zero exit status to be returned to proc_filter. The threads.c program creates 2 child threads. 1st thread handles signal SIGSEGV, and 2nd thread needs to indicate some error condition (value 1) t

[PATCH net-next v2 2/3] connector/cn_proc: Kunit tests for threads hash table

2024-10-15 Thread Anjali Kulkarni
t.c new file mode 100644 index ..78c39c0a0997 --- /dev/null +++ b/lib/cn_hash_test.c @@ -0,0 +1,167 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * KUnit test for the connector threads hashtable code. + * + * Copyright (c) 2024 Oracle and/or its affiliates. + * Author: Anjali K

[PATCH net-next v2 1/3] connector/cn_proc: Add hash table for threads

2024-10-15 Thread Anjali Kulkarni
. Exiting thread can call this either when it wants to call pthread_exit() with non-zero value or from signal handler. Add a new file cn_hash.c which implements a hash table storing the exit codes of abnormally exiting threads, received by the system call above. The key used for the hash table is

[PATCH net-next v2 0/3] Threads support in proc connector

2024-10-15 Thread Anjali Kulkarni
Recently we committed a fix to allow processes to receive notifications for non-zero exits via the process connector module. Commit is a4c9a56e6a2c. However, for threads, when it does a pthread_exit(&exit_status) call, the kernel is not aware of the exit status with which pthread_exit is ca

Re: [PATCH net-next v1 0/3] Threads support in proc connector

2024-10-15 Thread Anjali Kulkarni
On 10/15/24, 9:48 AM, "Jakub Kicinski" mailto:k...@kernel.org>> wrote: On Tue, 15 Oct 2024 16:22:24 + Anjali Kulkarni wrote: > Thank you! However, looking at the MAINTAINERS file, > drivers/connector/ is listed under NETWORKING DRIVERS. > Hence sending on net-next is the most appropriate p

Re: [PATCH net-next v1 0/3] Threads support in proc connector

2024-10-15 Thread Jakub Kicinski
On Tue, 15 Oct 2024 16:22:24 + Anjali Kulkarni wrote: > Thank you! However, looking at the MAINTAINERS file, > drivers/connector/ is listed under NETWORKING DRIVERS. > Hence sending on net-next is the most appropriate place? Hm. It was done relatively recently in commit 46cf789b68b25744be3

Re: [PATCH net-next v1 0/3] Threads support in proc connector

2024-10-15 Thread Anjali Kulkarni
On 10/15/24, 9:02 AM, "Jakub Kicinski" mailto:k...@kernel.org>> wrote: On Sun, 13 Oct 2024 10:06:14 -0700 Anjali Kulkarni wrote: > However, for threads, when it does a pthread_exit(&exit_status) call, the > kernel is not aware of the exit status with which pthread_ex

Re: [PATCH net-next v1 0/3] Threads support in proc connector

2024-10-15 Thread Jakub Kicinski
On Sun, 13 Oct 2024 10:06:14 -0700 Anjali Kulkarni wrote: > However, for threads, when it does a pthread_exit(&exit_status) call, the > kernel is not aware of the exit status with which pthread_exit is called. > It is sent by child thread to the parent process, if it is waiting in &

Re: [PATCH net-next v1 1/3] connector/cn_proc: Add hash table for threads

2024-10-14 Thread Anjali Kulkarni
On 10/14/24, 1:28 AM, "Peter Zijlstra" mailto:pet...@infradead.org>> wrote: On Sun, Oct 13, 2024 at 10:06:15AM -0700, Anjali Kulkarni wrote: > + if (unlikely(task->flags & PF_EXIT_NOTIFY)) { > + task_lock(task); > + task->flags &= ~PF_EXIT_NOTIFY; > + task_unlock(task); > + > @@ -413,6 +44

Re: [PATCH net-next v1 1/3] connector/cn_proc: Add hash table for threads

2024-10-14 Thread Peter Zijlstra
On Sun, Oct 13, 2024 at 10:06:15AM -0700, Anjali Kulkarni wrote: > + if (unlikely(task->flags & PF_EXIT_NOTIFY)) { > + task_lock(task); > + task->flags &= ~PF_EXIT_NOTIFY; > + task_unlock(task); > + > @@ -413,6 +440,15 @@ static void cn_proc_mcast_ctl(struc

[PATCH net-next v1 2/3] connector/cn_proc: Kunit tests for threads hash table

2024-10-13 Thread Anjali Kulkarni
t.c new file mode 100644 index ..78c39c0a0997 --- /dev/null +++ b/lib/cn_hash_test.c @@ -0,0 +1,167 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * KUnit test for the connector threads hashtable code. + * + * Copyright (c) 2024 Oracle and/or its affiliates. + * Author: Anjali K

[PATCH net-next v1 1/3] connector/cn_proc: Add hash table for threads

2024-10-13 Thread Anjali Kulkarni
. Exiting thread can call this either when it wants to call pthread_exit() with non-zero value or from signal handler. Add a new file cn_hash.c which implements a hash table storing the exit codes of abnormally exiting threads, received by the system call above. The key used for the hash table is

[PATCH net-next v1 3/3] connector/cn_proc: Selftest for threads

2024-10-13 Thread Anjali Kulkarni
Test to check if setting PROC_CN_MCAST_NOTIFY in proc connector API, allows a thread's non-zero exit status to be returned to proc_filter. The threads.c program creates 2 child threads. 1st thread handles signal SIGSEGV, and 2nd thread needs to indicate some error condition (value 1) t

[PATCH net-next v1 0/3] Threads support in proc connector

2024-10-13 Thread Anjali Kulkarni
Recently we committed a fix to allow processes to receive notifications for non-zero exits via the process connector module. Commit is a4c9a56e6a2c. However, for threads, when it does a pthread_exit(&exit_status) call, the kernel is not aware of the exit status with which pthread_exit is ca

Re: [PATCH net-next 2/3] connector/cn_proc: Kunit tests for threads hash table

2024-10-12 Thread Anjali Kulkarni
net-next 2/3] connector/cn_proc: Kunit tests for threads hash table On Fri, Oct 11, 2024 at 05:45:31PM -0700, Anjali Kulkarni wrote: > Kunit tests to test hash table add, delete, duplicate add and delete. > Add following configs and compile kernel code: > > CONFIG_CONNECTOR=y > CON

Re: [PATCH net-next 2/3] connector/cn_proc: Kunit tests for threads hash table

2024-10-12 Thread Simon Horman
gt; --- /dev/null > +++ b/lib/cn_hash_test.c > @@ -0,0 +1,167 @@ > +// SPDX-License-Identifier: GPL-2.0 > +/* > + * KUnit test for the connector threads hashtable code. > + * > + * Copyright (c) 2024 Oracle and/or its affiliates. > + * Author: Anjali Kulkarni > + */ >

Re: [PATCH net-next 1/3] connector/cn_proc: Add hash table for threads

2024-10-12 Thread Simon Horman
n with it. > Exiting thread can call this either when it wants to call pthread_exit() > with non-zero value or from signal handler. > > Add a new file cn_hash.c which implements a hash table storing the exit > codes of abnormally exiting threads, received by the system call above. > The

[PATCH net-next 3/3] connector/cn_proc: Selftest for threads

2024-10-11 Thread Anjali Kulkarni
Test to check if setting PROC_CN_MCAST_NOTIFY in proc connector API, allows a thread's non-zero exit status to be returned to proc_filter. The threads.c program creates 2 child threads. 1st thread handles signal SIGSEGV, and 2nd thread needs to indicate some error condition (value 1) t

[PATCH net-next 2/3] connector/cn_proc: Kunit tests for threads hash table

2024-10-11 Thread Anjali Kulkarni
t.c new file mode 100644 index ..2687492864ed --- /dev/null +++ b/lib/cn_hash_test.c @@ -0,0 +1,167 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * KUnit test for the connector threads hashtable code. + * + * Copyright (c) 2024 Oracle and/or its affiliates. + * Author: Anjali K

[PATCH net-next 1/3] connector/cn_proc: Add hash table for threads

2024-10-11 Thread Anjali Kulkarni
() with non-zero value or from signal handler. Add a new file cn_hash.c which implements a hash table storing the exit codes of abnormally exiting threads, received by the system call above. The key used for the hash table is the pid of the thread, so when the thread actually exits, we lookup it's p

[PATCH net-next 0/3] Threads support in proc connector

2024-10-11 Thread Anjali Kulkarni
Recently we committed a fix to allow processes to receive notifications for non-zero exits via the process connector module. Commit is a4c9a56e6a2c. However, for threads, when it does a pthread_exit(&exit_status) call, the kernel is not aware of the exit status with which pthread_exit is ca

Re: [PATCH net-next 2/2] connector/cn_proc: Selftest for threads case

2024-09-21 Thread kernel test robot
Hi Anjali, kernel test robot noticed the following build warnings: [auto build test WARNING on net-next/main] url: https://github.com/intel-lab-lkp/linux/commits/Anjali-Kulkarni/connector-cn_proc-Handle-threads-for-proc-connector/20240920-081249 base: net-next/main patch link: https

Re: [PATCH net-next 1/2] connector/cn_proc: Handle threads for proc connector

2024-09-20 Thread Anjali Kulkarni
> On Sep 20, 2024, at 11:44 AM, Oleg Nesterov wrote: > > On 09/20, Anjali Kulkarni wrote: >> >>> On Sep 20, 2024, at 4:00 AM, Oleg Nesterov wrote: >>> >>> I don't think you can use task_struct->exit_code. If this task is ptraced, >>> it can be changed/cleared in, say, ptrace_stop() after PRO

Re: [PATCH net-next 1/2] connector/cn_proc: Handle threads for proc connector

2024-09-20 Thread Oleg Nesterov
On 09/20, Anjali Kulkarni wrote: > > > On Sep 20, 2024, at 4:00 AM, Oleg Nesterov wrote: > > > > I don't think you can use task_struct->exit_code. If this task is ptraced, > > it can be changed/cleared in, say, ptrace_stop() after PROC_CN_MCAST_NOTIFY. > > > > Thank you, that’s a good point! Howev

Re: [PATCH net-next 1/2] connector/cn_proc: Handle threads for proc connector

2024-09-20 Thread Anjali Kulkarni
> On Sep 20, 2024, at 4:00 AM, Oleg Nesterov wrote: > > On 09/19, Anjali Kulkarni wrote: >> >> @@ -413,6 +416,10 @@ static void cn_proc_mcast_ctl(struct cn_msg *msg, >> if (msg->len == sizeof(*pinput)) { >> pinput = (struct proc_input *)msg->data; >> mc_op = pinp

Re: [PATCH net-next 1/2] connector/cn_proc: Handle threads for proc connector

2024-09-20 Thread Oleg Nesterov
On 09/19, Anjali Kulkarni wrote: > > @@ -413,6 +416,10 @@ static void cn_proc_mcast_ctl(struct cn_msg *msg, > if (msg->len == sizeof(*pinput)) { > pinput = (struct proc_input *)msg->data; > mc_op = pinput->mcast_op; > + if (mc_op == PROC_CN_MCAST_NOTIFY

[PATCH net-next 1/2] connector/cn_proc: Handle threads for proc connector

2024-09-19 Thread Anjali Kulkarni
Add a new type PROC_CN_MCAST_NOTIFY to proc connector API, which allows a thread to notify the kernel that it has exited abnormally. Thread can also send the exit status code it wants returned in the notification with it. Exiting thread can call this either when it wants to call pthread_exit() with

[PATCH net-next 0/2] Threads extension for process connector

2024-09-19 Thread Anjali Kulkarni
Recently we committed a fix to allow processes to receive notifications for non-zero exits via the process connector module. Commit is a4c9a56e6a2c. However, for threads, when it does a pthread_exit(&exit_status) call, the kernel is not aware of the exit status with which pthread_exit is ca

[PATCH net-next 2/2] connector/cn_proc: Selftest for threads case

2024-09-19 Thread Anjali Kulkarni
Test to check if setting PROC_CN_MCAST_NOTIFY in proc connector API, allows a thread's non-zero exit status to be returned to proc_filter. The threads.c program creates 2 child threads. 1st thread handles signal SIGSEGV, and 2nd thread needs to indicate some error condition (value 1) t

[PATCH 3/5] openrisc: traps: Don't send signals to kernel mode threads

2024-04-11 Thread Stafford Horne
OpenRISC exception handling sends signals to user processes on floating point exceptions and trap instructions (for debugging) among others. There is a bug where the trap handling logic may send signals to kernel threads, we should not send these signals to kernel threads, if that happens we treat

Re: [PATCH] cgroup: Relax restrictions on kernel threads moving out of root cpu cgroup

2021-04-14 Thread Wei Wang
r, each individual kworker > > > can potentially have CPU share equal to the entire UX cgroup. > > > > > > -kworker/0:0 > > > -kworker/1:0 > > > - UX > > > Task-A > > > Task-B > > > - background > > > Task-X >

Re: [PATCH v4 08/12] perf record: introduce --threads= command line option

2021-04-12 Thread Namhyung Kim
Hello, On Tue, Apr 6, 2021 at 5:49 PM Bayduraev, Alexey V wrote: > > > Provide --threads option in perf record command line interface. > The option can have a value in the form of masks that specify > cpus to be monitored with data streaming threads and its layout > in system t

[tip: sched/core] sched/fair: Ignore percpu threads for imbalance pulls

2021-04-09 Thread tip-bot2 for Lingutla Chandrasekhar
:00 Committer: Peter Zijlstra CommitterDate: Fri, 09 Apr 2021 18:02:20 +02:00 sched/fair: Ignore percpu threads for imbalance pulls During load balance, LBF_SOME_PINNED will be set if any candidate task cannot be detached due to CPU affinity constraints. This can result in setting env->

[tip: sched/core] sched/fair: Ignore percpu threads for imbalance pulls

2021-04-09 Thread tip-bot2 for Lingutla Chandrasekhar
:00 Committer: Peter Zijlstra CommitterDate: Fri, 09 Apr 2021 13:52:10 +02:00 sched/fair: Ignore percpu threads for imbalance pulls During load balance, LBF_SOME_PINNED will be set if any candidate task cannot be detached due to CPU affinity constraints. This can result in setting env->

[tip: sched/core] sched/fair: Ignore percpu threads for imbalance pulls

2021-04-09 Thread tip-bot2 for Lingutla Chandrasekhar
:00 Committer: Peter Zijlstra CommitterDate: Thu, 08 Apr 2021 23:09:44 +02:00 sched/fair: Ignore percpu threads for imbalance pulls During load balance, LBF_SOME_PINNED will be set if any candidate task cannot be detached due to CPU affinity constraints. This can result in setting env->

Re: [PATCH v4 08/12] perf record: introduce --threads= command line option

2021-04-08 Thread Jiri Olsa
On Tue, Apr 06, 2021 at 11:49:06AM +0300, Bayduraev, Alexey V wrote: SNIP > Suggested-by: Jiri Olsa > Suggested-by: Namhyung Kim > Signed-off-by: Alexey Bayduraev > --- > tools/include/linux/bitmap.h | 11 ++ > tools/lib/bitmap.c | 14 ++ > tools/perf/builtin-record.c | 317 +

Re: [PATCH v4 05/12] perf record: start threads in the beginning of trace streaming

2021-04-08 Thread Andi Kleen
> + err = write(thread->pipes.ack[1], &msg, sizeof(msg)); > + if (err == -1) > + pr_err("threads[%d]: failed to notify on start. Error %m", > thread->tid); It might be safer to not use %m. I'm not sure if all the non glibc libcs that people use support it.

[PATCH v5 1/3] sched/fair: Ignore percpu threads for imbalance pulls

2021-04-07 Thread Valentin Schneider
From: Lingutla Chandrasekhar During load balance, LBF_SOME_PINNED will be set if any candidate task cannot be detached due to CPU affinity constraints. This can result in setting env->sd->parent->sgc->group_imbalance, which can lead to a group being classified as group_imbalanced (rather than any

Re: [PATCH] cgroup: Relax restrictions on kernel threads moving out of root cpu cgroup

2021-04-06 Thread Pavan Kondeti
. This helps in prioritizing > > Task-A and Task-B over Task-X and Task-Y. However, each individual kworker > > can potentially have CPU share equal to the entire UX cgroup. > > > > -kworker/0:0 > > -kworker/1:0 > > - UX > > Task-A > > Task-B >

Re: [PATCH] cgroup: Relax restrictions on kernel threads moving out of root cpu cgroup

2021-04-06 Thread Tejun Heo
d Task-Y. However, each individual kworker > can potentially have CPU share equal to the entire UX cgroup. > > -kworker/0:0 > -kworker/1:0 > - UX > Task-A > Task-B > - background > Task-X > Task-Y > Hence we want to move all kernel threads to a

Re: [PATCH v4 1/3] sched/fair: Ignore percpu threads for imbalance pulls

2021-04-06 Thread Valentin Schneider
On 06/04/21 17:35, Dietmar Eggemann wrote: > On 01/04/2021 21:30, Valentin Schneider wrote: >> From: Lingutla Chandrasekhar >> >> During load balance, LBF_SOME_PINNED will bet set if any candidate task > > nitpick; s/bet/be ? > Yes indeed... > [...] > > Reviewed-by: Dietmar Eggemann

Re: [PATCH v4 1/3] sched/fair: Ignore percpu threads for imbalance pulls

2021-04-06 Thread Dietmar Eggemann
On 01/04/2021 21:30, Valentin Schneider wrote: > From: Lingutla Chandrasekhar > > During load balance, LBF_SOME_PINNED will bet set if any candidate task nitpick; s/bet/be ? [...] Reviewed-by: Dietmar Eggemann

Re: [PATCH] cgroup: Relax restrictions on kernel threads moving out of root cpu cgroup

2021-04-06 Thread Pavan Kondeti
However, there are many kernel tasks stuck in the > > root cgroup after the boot. > > > > We see all kworker threads are in the root cpu cgroup. This is because, > > tasks with PF_NO_SETAFFINITY flag set are forbidden from cgroup migration. > > This restriction is in pl

Re: [PATCH] cgroup: Relax restrictions on kernel threads moving out of root cpu cgroup

2021-04-06 Thread Tejun Heo
m higher share > compared to the other tasks inside important cgroups. This is mitigated > by moving all tasks inside root cgroup to a different cgroup after > Android is booted. However, there are many kernel tasks stuck in the > root cgroup after the boot. > > We see all kworker th

[PATCH] cgroup: Relax restrictions on kernel threads moving out of root cpu cgroup

2021-04-06 Thread Pavankumar Kondeti
g all tasks inside root cgroup to a different cgroup after Android is booted. However, there are many kernel tasks stuck in the root cgroup after the boot. We see all kworker threads are in the root cpu cgroup. This is because, tasks with PF_NO_SETAFFINITY flag set are forbidden from cgroup migration.

Re: [PATCH] cgroup: Relax restrictions on kernel threads moving out of root cpu cgroup

2021-04-06 Thread Pavan Kondeti
booted. However, there are many kernel tasks stuck in the > > root cgroup after the boot. > > > > We see all kworker threads are in the root cpu cgroup. This is because, > > tasks with PF_NO_SETAFFINITY flag set are forbidden from cgroup migration. > > This restric

Re: [PATCH] cgroup: Relax restrictions on kernel threads moving out of root cpu cgroup

2021-04-06 Thread Quentin Perret
m higher share > compared to the other tasks inside important cgroups. This is mitigated > by moving all tasks inside root cgroup to a different cgroup after > Android is booted. However, there are many kernel tasks stuck in the > root cgroup after the boot. > > We see all kwo

[PATCH] cgroup: Relax restrictions on kernel threads moving out of root cpu cgroup

2021-04-06 Thread Pavankumar Kondeti
g all tasks inside root cgroup to a different cgroup after Android is booted. However, there are many kernel tasks stuck in the root cgroup after the boot. We see all kworker threads are in the root cpu cgroup. This is because, tasks with PF_NO_SETAFFINITY flag set are forbidden from cgroup migration.

[PATCH v4 08/12] perf record: introduce --threads= command line option

2021-04-06 Thread Bayduraev, Alexey V
Provide --threads option in perf record command line interface. The option can have a value in the form of masks that specify cpus to be monitored with data streaming threads and its layout in system topology. The masks can be filtered using cpu mask provided via -C option. The specification

[PATCH v4 05/12] perf record: start threads in the beginning of trace streaming

2021-04-06 Thread Bayduraev, Alexey V
(err == -1) + pr_err("threads[%d]: failed to notify on start. Error %m", thread->tid); + + pr_debug("threads[%d]: started on cpu=%d\n", thread->tid, sched_getcpu()); + + pollfd = &thread->pollfd; + ctlfd_pos = thread->ctlfd_pos; + + for

[PATCH v4 04/12] perf record: stop threads in the end of trace streaming

2021-04-06 Thread Bayduraev, Alexey V
Signal thread to terminate by closing write fd of msg pipe. Receive THREAD_MSG__READY message as the confirmation of the thread's termination. Stop threads created for parallel trace streaming prior their stats processing. Signed-off-by: Alexey Bayduraev --- tools/perf/builtin-record.c

Re: [PATCH 0/6] Allow signals for IO threads

2021-04-02 Thread Stefan Metzmacher
Am 01.04.21 um 18:24 schrieb Linus Torvalds: > On Thu, Apr 1, 2021 at 9:00 AM Stefan Metzmacher wrote: >> >> I haven't tried it, but it seems gdb tries to use PTRACE_PEEKUSR >> against the last thread tid listed under /proc//tasks/ in order to >> get the architecture for the userspace application

Re: [PATCH v4 1/3] sched/fair: Ignore percpu threads for imbalance pulls

2021-04-02 Thread Vincent Guittot
On Thu, 1 Apr 2021 at 21:30, Valentin Schneider wrote: > > From: Lingutla Chandrasekhar > > During load balance, LBF_SOME_PINNED will bet set if any candidate task > cannot be detached due to CPU affinity constraints. This can result in > setting env->sd->parent->sgc->group_imbalance, which can l

  1   2   3   4   5   6   7   8   9   10   >