From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B0CA034D93B for ; Fri, 8 May 2026 18:04:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778263471; cv=none; b=Dzlv7STD5nte3dBFgd/0bQ9+Y/Anf7CmMRHNkLhTFj4Dy1oq5byUPSJxcyBeL0GZVYqlyMNRSMgMmv1X6e5vxh7yTjV4ybUKEEJb68fIdOLvgZuxpnskfUYqhnKk+XVUTvJ0qQeZarcgDHzdC55D921G+IwAhAUrXpIngJPtOyc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778263471; c=relaxed/simple; bh=cAiGAAhwB/yGjos/++54OCMKQCePvPaGI27cUuh8jVc=; h=Date:Message-ID:From:To:Cc:Subject:In-Reply-To:References; b=ahhmJOe1tpwfCaMdVNCeUjQPbUHEdF7f7fvepThmx/batOH3CL/M7izlsqOmqFqmM3so5CSTx179ZCNmuYHuCdSh8Paj0ugDMkrktnHkhnYN9JAW39R5VqbfHFkciejf/eAD/SOHVXgcuTJu/5imaeIWs+BwbUitjNBxzoTFUdA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=tu0Ob3Sf; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="tu0Ob3Sf" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4CBC7C2BCB0; Fri, 8 May 2026 18:04:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1778263471; bh=cAiGAAhwB/yGjos/++54OCMKQCePvPaGI27cUuh8jVc=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=tu0Ob3SfFimzxRrDzSpWJQZZQeoIeRtu8BlbwiK6CvTb/jV1FglVPgw4WqA1TLF2w yptw/DZ47vKa8XG35g+qtgxtkt4KaaKwlvLQ14K4W+fuFR1TjkLLtEMaGInK2fgEgX ezALvzdMuCrtjZWu17xhiAJa6Zy/tWmJVAD5YGJccQ+XBizyuTEcYmBGUyBM3YLYTq tpge3sl80xpCj8jCIs/6dPyX4Qko9C8jAqEhDGBQsjHij1UMfvZ77GVqcLGSGohluh v5mXFvXfoBUVWSlV13SimErgdoe/kf8OGNv3KdrYM3ervKN548g5nSgX+7bIwhCbLC By1eaPCWR7DOg== Date: Fri, 08 May 2026 08:04:30 -1000 Message-ID: <4199d1e6c2abd65d70a367f913c31045@kernel.org> From: Tejun Heo To: Breno Leitao , Lai Jiangshan Cc: linux-kernel@vger.kernel.org, clm@meta.com, kernel-team@meta.com Subject: Re: [PATCH] workqueue: release PENDING in __queue_work() drain/destroy reject path In-Reply-To: <20260507-workqueue_pending-v1-1-3a53e2facf4e@debian.org> References: <20260507-workqueue_pending-v1-1-3a53e2facf4e@debian.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Hello, On Thu, 07 May 2026 04:04:46 -0700, Breno Leitao wrote: > The caller of __queue_work() owns WORK_STRUCT_PENDING, won via > test_and_set_bit() in queue_work_on()/__queue_delayed_work(). The > state machine documented above __queue_work() requires that owner > to either hand the token to a pwq (insert_work() -> set_work_pwq()), > hand it to a timer, or release it via set_work_pool_and_clear_pending(). > try_to_grab_pending() relies on this: when it observes > "PENDING && off-queue" it busy-loops, trusting the current owner to > make progress. > > [...] Applied to wq/for-7.1-fixes (capitalized the first word of the subject). Thanks. -- tejun