Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (Client CN "mail.NetBSD.org", Issuer "mail.NetBSD.org CA" (not verified)) by mollari.NetBSD.org (Postfix) with ESMTPS id F22A51A923B for ; Mon, 25 Jan 2021 14:12:52 +0000 (UTC) Received: by mail.netbsd.org (Postfix, from userid 605) id 0C246850C6; Mon, 25 Jan 2021 14:12:52 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by mail.netbsd.org (Postfix) with ESMTP id 283F984D8A for ; Mon, 25 Jan 2021 14:12:51 +0000 (UTC) X-Virus-Scanned: amavisd-new at netbsd.org Received: from mail.netbsd.org ([IPv6:::1]) by localhost (mail.netbsd.org [IPv6:::1]) (amavisd-new, port 10025) with ESMTP id 3saH7NvNuH_H for ; Mon, 25 Jan 2021 14:12:50 +0000 (UTC) Received: from cvs.NetBSD.org (ivanova.netbsd.org [199.233.217.197]) by mail.netbsd.org (Postfix) with ESMTP id AA44484C71 for ; Mon, 25 Jan 2021 14:12:50 +0000 (UTC) Received: by cvs.NetBSD.org (Postfix, from userid 500) id A34E7FA9D; Mon, 25 Jan 2021 14:12:50 +0000 (UTC) Content-Disposition: inline Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII" MIME-Version: 1.0 Date: Mon, 25 Jan 2021 14:12:50 +0000 From: "Martin Husemann" Subject: CVS commit: [netbsd-9] src/sys/kern To: source-changes@NetBSD.org X-Mailer: log_accum Message-Id: <20210125141250.A34E7FA9D@cvs.NetBSD.org> Sender: source-changes-owner@NetBSD.org List-Id: Precedence: bulk Reply-To: source-changes-d@NetBSD.org Mail-Reply-To: "Martin Husemann" Mail-Followup-To: source-changes-d@NetBSD.org List-Unsubscribe: Module Name: src Committed By: martin Date: Mon Jan 25 14:12:50 UTC 2021 Modified Files: src/sys/kern [netbsd-9]: kern_threadpool.c Log Message: Pull up following revision(s) (requested by riastradh in ticket #1187): sys/kern/kern_threadpool.c: revision 1.23 threadpool(9): Fix synchronization between cancel and dispatch. - threadpool_cancel_job_async tried to prevent threadpool_dispatcher_thread from taking the job by setting job->job_thread = NULL and then removing the job from the queue. - But threadpool_cancel_job_async didn't notice job->job_thread is null until after it also removes the job from the queue => double-remove, *boom*. The solution is to teach threadpool_dispatcher_thread to wait until it has acquired the job lock to test whether job->job_thread is still valid before it decides to remove the job from the queue. Fixes PR kern/55948. XXX pullup-9 To generate a diff of this commit: cvs rdiff -u -r1.15 -r1.15.6.1 src/sys/kern/kern_threadpool.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.