From: Anjali Kulkarni <anjali.k.kulkarni@oracle.com>
To: Liam Howlett <liam.howlett@oracle.com>
Cc: "davem@davemloft.net" <davem@davemloft.net>,
"edumazet@google.com" <edumazet@google.com>,
"kuba@kernel.org" <kuba@kernel.org>,
"pabeni@redhat.com" <pabeni@redhat.com>,
"mingo@redhat.com" <mingo@redhat.com>,
"peterz@infradead.org" <peterz@infradead.org>,
"juri.lelli@redhat.com" <juri.lelli@redhat.com>,
"vincent.guittot@linaro.org" <vincent.guittot@linaro.org>,
"dietmar.eggemann@arm.com" <dietmar.eggemann@arm.com>,
"rostedt@goodmis.org" <rostedt@goodmis.org>,
"bsegall@google.com" <bsegall@google.com>,
"mgorman@suse.de" <mgorman@suse.de>,
"vschneid@redhat.com" <vschneid@redhat.com>,
"jiri@resnulli.us" <jiri@resnulli.us>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
"akpm@linux-foundation.org" <akpm@linux-foundation.org>,
"shuah@kernel.org" <shuah@kernel.org>,
"linux-kselftest@vger.kernel.org"
<linux-kselftest@vger.kernel.org>, Pei Li <peili.io@oracle.com>
Subject: Re: [PATCH net-next v2 1/3] connector/cn_proc: Add hash table for threads
Date: Wed, 16 Oct 2024 03:01:46 +0000 [thread overview]
Message-ID: <5794D6FD-DB28-4C22-BF11-2B9026F5317A@oracle.com> (raw)
In-Reply-To: <h2kgrfr3ru7qqq7xc5yplktyz26kr6x23fycfh5zzwq2cc4ai5@5alik4kqzoji>
[..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
next prev parent reply other threads:[~2024-10-16 3:02 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-15 17:30 [PATCH net-next v2 0/3] Threads support in proc connector Anjali Kulkarni
2024-10-15 17:30 ` [PATCH net-next v2 1/3] connector/cn_proc: Add hash table for threads Anjali Kulkarni
2024-10-15 18:28 ` Liam R. Howlett
2024-10-15 18:53 ` Anjali Kulkarni
2024-10-16 3:01 ` Anjali Kulkarni [this message]
2024-10-15 17:30 ` [PATCH net-next v2 2/3] connector/cn_proc: Kunit tests for threads hash table Anjali Kulkarni
2024-10-15 19:16 ` Liam R. Howlett
2024-10-15 21:11 ` Anjali Kulkarni
2024-10-16 0:31 ` Liam R. Howlett
2024-10-15 17:30 ` [PATCH net-next v2 3/3] connector/cn_proc: Selftest for threads Anjali Kulkarni
2024-10-15 19:27 ` Liam R. Howlett
2024-10-15 21:28 ` Anjali Kulkarni
2024-10-16 0:32 ` Liam R. Howlett
2024-10-16 17:47 ` Anjali Kulkarni
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5794D6FD-DB28-4C22-BF11-2B9026F5317A@oracle.com \
--to=anjali.k.kulkarni@oracle.com \
--cc=akpm@linux-foundation.org \
--cc=bsegall@google.com \
--cc=davem@davemloft.net \
--cc=dietmar.eggemann@arm.com \
--cc=edumazet@google.com \
--cc=jiri@resnulli.us \
--cc=juri.lelli@redhat.com \
--cc=kuba@kernel.org \
--cc=liam.howlett@oracle.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=mgorman@suse.de \
--cc=mingo@redhat.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=peili.io@oracle.com \
--cc=peterz@infradead.org \
--cc=rostedt@goodmis.org \
--cc=shuah@kernel.org \
--cc=vincent.guittot@linaro.org \
--cc=vschneid@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®