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 A536E42B73A for ; Wed, 4 Feb 2026 18:05:50 +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=1770228350; cv=none; b=NA/TQOtvB4xPYdZscOqiO6trttYLm0fjLkPiUyPFH6HWUQwIWcxyhJ74Q5w7MVPgV7js0ya/GgP0hB41uxQery0kYoiOZlPW1GAReDDvwTrtE2LQLQeCyEtG8/rtRDmvfy1qCH5RNV8OIbhIb0j4IRgHGZ0Sc1blOf82q8XCoa8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770228350; c=relaxed/simple; bh=IFL1QAuYxXusw3Tou4OtWloih9lD/Wc+wV62wnBE8KE=; h=Date:From:To:Cc:Subject:Message-Id:In-Reply-To:References: Mime-Version:Content-Type; b=bJ6h8GY5GQhTHyTl3v3/MTjtk8tyTuhGQDDOhK0rRyDab4sQJpebRMkeE7qa6a7Y3KHzAYSDlRlMrpSBRK1SKNNlNoyMHu7Z3RT7ha6kWsIa83taKT33lEPFfkdjoYDviOis0dahbWVMg2kMruwxgb/tzFYymtAYX3mrKJlIgrE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b=kQo8GHXG; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b="kQo8GHXG" Received: by smtp.kernel.org (Postfix) with ESMTPSA id CEB9EC4CEF7; Wed, 4 Feb 2026 18:05:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1770228350; bh=IFL1QAuYxXusw3Tou4OtWloih9lD/Wc+wV62wnBE8KE=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=kQo8GHXG/IqH1jKjsI5xLSWQCo4tPFnfRF3C4qpeGoCgYIagKbHJAVWeUWIzfdOBt BVN0eMYm45ZRqH+qWi993/b37s2hmGUMY5Js0bIcQ2QtaIzQO7ESfDR79XPwjt0lWS sKdAE7/yJw54HaDLPdzGHzjz2Vhbqn8g8jWZp6EE= Date: Wed, 4 Feb 2026 10:05:49 -0800 From: Andrew Morton To: Petr Mladek Cc: Lance Yang , Aaron Tomlin , neelx@suse.com, sean@ashe.io, mproche@gmail.com, chjohnst@gmail.com, nick.lange@gmail.com, linux-kernel@vger.kernel.org, mhiramat@kernel.org, joel.granados@kernel.org, gregkh@linuxfoundation.org Subject: Re: [PATCH] hung_task: Increment the global counter immediately Message-Id: <20260204100549.48436218179994b0303c8f49@linux-foundation.org> In-Reply-To: References: <20260125135848.3356585-1-atomlin@atomlin.com> <20260125135848.3356585-2-atomlin@atomlin.com> <45c17b93-a6f1-45e0-8b25-20665a281949@linux.dev> X-Mailer: Sylpheed 3.8.0beta1 (GTK+ 2.24.33; x86_64-pc-linux-gnu) 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-Transfer-Encoding: 7bit On Wed, 4 Feb 2026 12:04:54 +0100 Petr Mladek wrote: > A recent change allowed to reset the global counter of hung tasks using > the sysctl interface. A potential race with the regular check has been > solved by updating the global counter only once at the end of the check. > > However, the hung task check can take a significant amount of time, > particularly when task information is being dumped to slow serial > consoles. Some users monitor this global counter to trigger immediate > migration of critical containers. Delaying the increment until the > full check completes postpones these high-priority rescue operations. > > Update the global counter as soon as a hung task is detected. Since > the value is read asynchronously, a relaxed atomic operation is > sufficient. > > Reported-by: Lance Yang > Closes: https://lore.kernel.org/r/f239e00f-4282-408d-b172-0f9885f4b01b@linux.dev > Signed-off-by: Petr Mladek > --- > This is a followup patch for > https://lore.kernel.org/r/20260125135848.3356585-1-atomlin@atomlin.com > > Note that I could not use commit IDs because the original > patchset is not in a stable tree yet. In fact, it seems > that it is not even in linux-next at the moment. Yes, I've gone into "fixes and trivial stuff only" mode, as we're at -rc8. Aaron, please incorporate Petr's fix into v8 and resend towards the end of the merge window? Thanks.