From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out-185.mta0.migadu.com (out-185.mta0.migadu.com [91.218.175.185]) (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 C3F3E33993 for ; Thu, 15 Jan 2026 03:24:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.185 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768447465; cv=none; b=uMpTGjyIz45NEwJAGMTkIyhUQ557VoLxIB+eK01PsDv51Nbb1HJ9JgotbklQs+WmgeAXP1FpDmXu0jN9DRzTVESEp5vdPE9d+jDql3ECc3FN7bLNruyAJguXab28gTOXOGbFHzx3Vziu2m2n2nQoshxa/SGSrWquB+FuAMVglqc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768447465; c=relaxed/simple; bh=osbX4TLLECfdCJvLSmuOK7SSgf49aJiTVmXBiQeYe1s=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=URpXgBuFxD6V+XzcG54b3GjJi+ziC2+dX9vuOoN6iGQmoki/pYXa+fPwEdVXt9zju+xtmzkTMTi1femhQmc8Ln7dMvHAEcSFsYoFw8jg1bmWk6m64GZjZHjj3ibFsNULLwVI6xKwyK+lTzAm9xeSm7hfjx0eq5n4RQeQE4O5JJ4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=AI8z7ZJR; arc=none smtp.client-ip=91.218.175.185 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="AI8z7ZJR" Message-ID: <3783efcc-f5f3-433d-a812-dc95030c87f1@linux.dev> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1768447460; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=+dqp/9jfwlkHLce0+SaFQ04gqdfuSPLDd/FDIrBWXhE=; b=AI8z7ZJRi/8banFpY0TAVY6Mfh6ajt1WsRmUWXjNExTrDPWR1QyaElbR0PR1G1Xyuy/2h1 N/yXGfzn6dTcF+fFmlmRFwz0umShV/tz4QLPMtXoypt095ML+n3LYS2tKLz9s+8B/GOPDW rcxGPIOaM3JmG5u49cVf51KvvKnXEA8= Date: Thu, 15 Jan 2026 11:24:13 +0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Subject: Re: [v6 PATCH 0/2] hung_task: Provide runtime reset interface for hung task detector Content-Language: en-US To: Aaron Tomlin Cc: sean@ashe.io, linux-kernel@vger.kernel.org, pmladek@suse.com, gregkh@linuxfoundation.org, akpm@linux-foundation.org, joel.granados@kernel.org, mhiramat@kernel.org References: <20260115023229.3028462-1-atomlin@atomlin.com> X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Lance Yang In-Reply-To: <20260115023229.3028462-1-atomlin@atomlin.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Migadu-Flow: FLOW_OUT On 2026/1/15 10:32, Aaron Tomlin wrote: > Hi Lance, Greg, Petr, Joel, Andrew, > > This series introduces the ability to reset > /proc/sys/kernel/hung_task_detect_count. > > Writing a "0" value to this file atomically resets the counter of detected > hung tasks. This functionality provides system administrators with the > means to clear the cumulative diagnostic history following incident > resolution, thereby simplifying subsequent monitoring without necessitating > a system restart. > > The updated logic ensures that the long-running scan (which is inherently > preemptible and subject to rcu_lock_break()) does not become desynchronised > from the global state. By treating the initial read as a "version snapshot" > the kernel can guarantee that the cumulative count only updates if the > underlying state remained stable throughout the duration of the > scan. > > Please let me know your thoughts. There is a mismatch here with what Joel and Petr suggested ... IIUC, we should just do: - Patch 1: Full cmpxchg-based counting (Petr's POC), sysctl read-only - Patch 2: Add write handler for userspace reset That way Patch 1 is the real logic change, and Patch 2 is just adding the userspace interface. Thanks, Lance