From 56070bb8c5c1530a1befbdc802fe144854b8b0b7 Mon Sep 17 00:00:00 2001 From: mvs Date: Mon, 15 Aug 2022 09:10:36 +0000 Subject: [PATCH] Stop doing lockless `t_flags' check within task_add(9) and task_del(9). This doesn't work on MP systems. We do locked `t_flags' check just after lockless check, so just remove it. ok dlg@ --- sys/kern/kern_task.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/sys/kern/kern_task.c b/sys/kern/kern_task.c index 1a5ed9c5014..2a2fa256d42 100644 --- a/sys/kern/kern_task.c +++ b/sys/kern/kern_task.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_task.c,v 1.31 2020/08/01 08:40:20 anton Exp $ */ +/* $OpenBSD: kern_task.c,v 1.32 2022/08/15 09:10:36 mvs Exp $ */ /* * Copyright (c) 2013 David Gwynne @@ -354,9 +354,6 @@ task_add(struct taskq *tq, struct task *w) { int rv = 0; - if (ISSET(w->t_flags, TASK_ONQUEUE)) - return (0); - mtx_enter(&tq->tq_mtx); if (!ISSET(w->t_flags, TASK_ONQUEUE)) { rv = 1; @@ -379,9 +376,6 @@ task_del(struct taskq *tq, struct task *w) { int rv = 0; - if (!ISSET(w->t_flags, TASK_ONQUEUE)) - return (0); - mtx_enter(&tq->tq_mtx); if (ISSET(w->t_flags, TASK_ONQUEUE)) { rv = 1; -- 2.20.1