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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On 10/14/24, 1:28 AM, "Peter Zijlstra" <peterz@xxxxxxxxxxxxx <mailto:peterz@xxxxxxxxxxxxx>> 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 +440,15 @@ 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) {
> + pr_debug("%s: Received PROC_CN_MCAST_NOTIFY, pid %d\n",
> + __func__, current->pid);
> + task_lock(current);
> + current->flags |= PF_EXIT_NOTIFY;
> + task_unlock(current);
> + err = cn_add_elem(pinput->uexit_code, current->pid);
> + return;
> + }


You seem to think that task_lock protects task->flags ? Why?

ANJALI> Missed this earlier, but it should actually not be needed, as both paths which modify the flags are via a syscall? I will go ahead and remove the locking, and send out in my next revision (if I missed anything let me know). 







[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux