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 27F2120767B for ; Fri, 10 Jan 2025 18:34:00 +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=1736534041; cv=none; b=Y/n38RX0h25H+jTm4wCjRTbrrS1cRFZ51j8tipSBJVZEihD6ask9tCLXySBcB+gXsOkXSVWSrx0/Pp/I7CnEjHmsE2TSvwecKnUdiOt3f5c/xRkr5QwwNn5+a4zh1t5KDsv9cqq+eagsobL3JilHNi6KuCv1nTEwAiPa+1RAjkY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736534041; c=relaxed/simple; bh=YeGyNrqUXZGoZi4M+XR+U+608GTS4Y3lSOoqG7vCp3I=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=nU4c53IcHO4qAJ1yIHiEPw8t2/qK4EHnBEpwwvIS26jwNfz+i4RuPfeiDxIq4bdPBp6fmo605WIUGureAJfhG5aNjnXiVF+fe3aD+GPVWJ/bwr3cIDmb+RLa8olX4D3C80LwqX7JLOXl0jzAJCTUXHYmwIglUyQt70/4LJsQMrg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=lgjtGQN8; 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="lgjtGQN8" Received: by smtp.kernel.org (Postfix) with ESMTPSA id AC4F8C4CED6; Fri, 10 Jan 2025 18:34:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1736534040; bh=YeGyNrqUXZGoZi4M+XR+U+608GTS4Y3lSOoqG7vCp3I=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=lgjtGQN8FVMfGAh9Sp59sFCS/qLn6RujHcLgVURYSpGj+c0Z8flk3j6YM20brzTuT zK2GOztpMiWDbMIkvGftsXlS+yLJ5oBanu/X679PEsiID45mpdt1aAFmcYIvJ5HP9X CVGoO7baP4aqqJG6dzhy+pYS7WenpphjLi4G53tjn/q3WkdwrPz4IMif7igk21B7gv EzfcoVPD1a2pI55UqLD1cjwdzaokuHIoZkE3puWz1PX9TD3iXpOLrEEIFEL/xPF0kG xcM5Pe91cE2nfXGt6YWNs+ot+730yvBDQ7gqRO0iTvOMQ8y74ItAE8phM2pb7gw/sZ cnCbVvg/rzTmw== Date: Fri, 10 Jan 2025 08:33:59 -1000 From: Tejun Heo To: Imran Khan Cc: jiangshanlai@gmail.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] workqueue: warn if delayed_work is queued to an offlined cpu. Message-ID: References: <20250109232711.2081259-1-imran.f.khan@oracle.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20250109232711.2081259-1-imran.f.khan@oracle.com> On Fri, Jan 10, 2025 at 10:27:11AM +1100, Imran Khan wrote: > delayed_work submitted to an offlined cpu, will not get executed, > after the specified delay if the cpu remains offline. If the cpu > never comes online the work will never get executed. > checking for online cpu in __queue_delayed_work, does not sound > like a good idea because to do this reliably we need hotplug lock > and since work may be submitted from atomic contexts, we would > have to use cpus_read_trylock. But if trylock fails we would queue > the work on any cpu and this may not be optimal because our intended > cpu might still be online. > > Putting a WARN_ON_ONCE for an already offlined cpu, will indicate users > of queue_delayed_work_on, if they are (wrongly) trying to queue > delayed_work on offlined cpu. Also indicate the problem of using > offlined cpu with queue_delayed_work_on, in its description. > > Signed-off-by: Imran Khan Applied to wq/for-6.13-fixes. Thanks. -- tejun