[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <5794D6FD-DB28-4C22-BF11-2B9026F5317A@oracle.com>
Date: Wed, 16 Oct 2024 03:01:46 +0000
From: Anjali Kulkarni <anjali.k.kulkarni@...cle.com>
To: Liam Howlett <liam.howlett@...cle.com>
CC: "davem@...emloft.net" <davem@...emloft.net>,
"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 v2 1/3] connector/cn_proc: Add hash table for
threads
[..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_hash_get_exval(struct cn_hash_dev *hdev, pid_t pid);
>> +
>
> Why are these here twice? Am I missing something?
>
Do you mean to say cn_hash_del_elem() and cn_hash_del_get_exval() ?
I can combine those 2 to both delete and get the exit value.
The cn_hash_get_exval() has to be separate, as it only gets the exit code.
> It also seems like a lot of these can be static inline and removed
> completely from the header as they are not used externally.
>
>> +bool cn_table_empty(void);
>> +bool cn_hash_table_empty(struct cn_hash_dev *hdev);
>> +
>> #endif /* __CONNECTOR_H */
>> diff --git a/include/linux/sched.h b/include/linux/sched.h
>> index e6ee4258169a..a2339ae6208b 100644
>> --- a/include/linux/sched.h
>> +++ b/include/linux/sched.h
>> @@ -1673,7 +1673,7 @@ extern struct pid *cad_pid;
>> #define PF_USED_MATH 0x00002000 /* If unset the fpu must be initialized before use */
>> #define PF_USER_WORKER 0x00004000 /* Kernel thread cloned from userspace thread */
>> #define PF_NOFREEZE 0x00008000 /* This thread should not be frozen */
>> -#define PF__HOLE__00010000 0x00010000
>> +#define PF_EXIT_NOTIFY 0x00010000 /* This thread has sent an exit value to be sent as a notification to listening processes */
>> #define PF_KSWAPD 0x00020000 /* I am kswapd */
>> #define PF_MEMALLOC_NOFS 0x00040000 /* All allocations inherit GFP_NOFS. See memalloc_nfs_save() */
>> #define PF_MEMALLOC_NOIO 0x00080000 /* All allocations inherit GFP_NOIO. See memalloc_noio_save() */
>> diff --git a/include/uapi/linux/cn_proc.h b/include/uapi/linux/cn_proc.h
>> index 18e3745b86cd..2b12a24e4651 100644
>> --- a/include/uapi/linux/cn_proc.h
>> +++ b/include/uapi/linux/cn_proc.h
>> @@ -27,7 +27,8 @@
>> */
>> enum proc_cn_mcast_op {
>> PROC_CN_MCAST_LISTEN = 1,
>> - PROC_CN_MCAST_IGNORE = 2
>> + PROC_CN_MCAST_IGNORE = 2,
>> + PROC_CN_MCAST_NOTIFY = 3
>> };
>>
>> #define PROC_EVENT_ALL (PROC_EVENT_FORK | PROC_EVENT_EXEC | PROC_EVENT_UID | \
>> @@ -65,6 +66,7 @@ enum proc_cn_event {
>> struct proc_input {
>> enum proc_cn_mcast_op mcast_op;
>> enum proc_cn_event event_type;
>> + __u32 uexit_code;
>> };
>>
>> static inline enum proc_cn_event valid_event(enum proc_cn_event ev_type)
>> --
>> 2.46.0
Powered by blists - more mailing lists