[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <2A147599-3991-4157-886A-68FA60B71EB2@oracle.com>
Date: Fri, 18 Oct 2024 15:31:31 +0000
From: Anjali Kulkarni <anjali.k.kulkarni@...cle.com>
To: Simon Horman <horms@...nel.org>
CC: "davem@...emloft.net" <davem@...emloft.net>,
Liam Howlett
<liam.howlett@...cle.com>,
"edumazet@...gle.com" <edumazet@...gle.com>,
"kuba@...nel.org" <kuba@...nel.org>,
"pabeni@...hat.com" <pabeni@...hat.com>,
"mingo@...hat.com" <mingo@...hat.com>,
"peterz@...radead.org"
<peterz@...radead.org>,
"juri.lelli@...hat.com" <juri.lelli@...hat.com>,
"vincent.guittot@...aro.org" <vincent.guittot@...aro.org>,
"dietmar.eggemann@....com" <dietmar.eggemann@....com>,
"rostedt@...dmis.org"
<rostedt@...dmis.org>,
"bsegall@...gle.com" <bsegall@...gle.com>,
"mgorman@...e.de" <mgorman@...e.de>,
"vschneid@...hat.com"
<vschneid@...hat.com>,
"jiri@...nulli.us" <jiri@...nulli.us>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
"akpm@...ux-foundation.org" <akpm@...ux-foundation.org>,
"shuah@...nel.org"
<shuah@...nel.org>,
"linux-kselftest@...r.kernel.org"
<linux-kselftest@...r.kernel.org>,
Pei Li <peili.io@...cle.com>
Subject: Re: [PATCH net-next v5 0/3] Threads support in proc connector
> On Oct 18, 2024, at 2:49 AM, Simon Horman <horms@...nel.org> wrote:
>
> 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_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, for a thread exiting abnormally, kernel cannot
>> send notifications to any listening processes.
>>
>> The exception to this is if the thread is sent a signal which it has not
>> handled, and dies along with it's process as a result; for eg. SIGSEGV or
>> SIGKILL. In this case, kernel is aware of the non-zero exit and sends a
>> notification for it.
>>
>> For our use case, we cannot have parent wait in pthread_join, one of the
>> main reasons for this being that we do not want to track normal
>> pthread_exit(), which could be a very large number. We only want to be
>> notified of any abnormal exits. Hence, threads are created with
>> pthread_attr_t set to PTHREAD_CREATE_DETACHED.
>>
>> To fix this problem, we add a new type PROC_CN_MCAST_NOTIFY to proc connector
>> API, which allows a thread to send it's exit status to kernel either when
>> it needs to call pthread_exit() with non-zero value to indicate some
>> error or from signal handler before pthread_exit().
>>
>> We also need to filter packets with non-zero exit notifications futher
>> based on instances, which can be identified by task names. Hence, added a
>> comm field to the packet's struct proc_event, in which task->comm is
>> stored.
>
> As it seems that there will be another revision anyway,
> please run this patch-set through checkpatch with the following arguments.
>
> ./scripts/checkpatch.pl --strict --max-line-length=80
>
> And please fix warnings about alignment and line length.
> But please do so in such a way that doesn't reduce readability,
> e.g. don't split strings over multiple lines.
Ok thanks, will do.
Anjali
Powered by blists - more mailing lists