From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out-174.mta0.migadu.com (out-174.mta0.migadu.com [91.218.175.174]) (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 5C9902BE7C6 for ; Tue, 18 Nov 2025 06:06:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.174 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763445994; cv=none; b=lnWYoH12iiCd3aZG7TJSJVdeuc7+76YurYpTTf+L9T13Wr9Iby5NlznYmbVWp6Ht3jf1vEhodQRnT5uTaZXibSD0vXZjimAHAyGnW7QMHxm6jQIHqdL1qvyuPykCfi7a0BkNppFmF/NuOtC4RdPppv2pQLfX+T2Wwuqin74blZY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763445994; c=relaxed/simple; bh=RxLBp7Y3WSOwFF4mbn3jM8NI7BQ26AI/Q8xdIsc50bc=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=c1mO0k7wBjO22Thx+XUBYwwcXJ8WPg7C+BtIH7ncu8Mba5Hx2zidSok69neY/QJL2bJ48WWrHG9NtLQnFcUtdc/gXd/zLwIMSLja4sjq+CCSObuCvmHxXItc5AkyajnO68EJxjDbLsTJsfwcB1qF8RHSfkRhy+oXdnTNMAEJpn4= 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=jYds9PRX; arc=none smtp.client-ip=91.218.175.174 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="jYds9PRX" Message-ID: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1763445989; 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=qWkgThq9KnrsuBinVs3X/teMeclqCNz1yYIyQByWDBw=; b=jYds9PRXbImWlQyDJWJTaqpbBv7/hXu4l5SX0Yyo7C4K3QQx9NaHClcuvEjf3joeYF2UNX 4/sSKkimSMgE/QaQYYN5Q9K3/Ebdo2Hc5WoRW7VoYDRtcY1kno17rkzOviex7pvAO4pRFm XZ0zLCi9vGOBZl8kcMVLpUnL5/PSCwU= Date: Tue, 18 Nov 2025 14:06:21 +0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Subject: Re: [PATCH v2 2/4] hung_task: Add hung_task_sys_info sysctl to dump sys info on task-hung To: Andrew Morton , Feng Tang Cc: Petr Mladek , Steven Rostedt , Lance Yang , linux-kernel@vger.kernel.org, Jonathan Corbet , paulmck@kernel.org, lirongqing@baidu.com, leonylgao@tencent.com References: <20251113111039.22701-1-feng.tang@linux.alibaba.com> <20251113111039.22701-3-feng.tang@linux.alibaba.com> <20251117095352.8dfb46ec468ba5a69a829031@linux-foundation.org> Content-Language: en-US X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Lance Yang In-Reply-To: <20251117095352.8dfb46ec468ba5a69a829031@linux-foundation.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Migadu-Flow: FLOW_OUT On 2025/11/18 01:53, Andrew Morton wrote: > On Sun, 16 Nov 2025 22:13:58 +0800 Feng Tang wrote: > >>>> if (need_warning || hung_task_call_panic) { >>>> si_mask |= SYS_INFO_LOCKS; >>> >>> Looks good to me now! I assume v3 would be expected, can you >>> post a new version? >> >> Andrew has taken the patchset to -mm tree. >> >> Andrew, which way do you prefer? I send a v3 patch for hung-task or you >> pickup the fixup patch and squash it into the orginal 0002 patch? >> >> Anyway, I make a squshed version v3 patch below. > > I prefer little fixup patches, generally. So people can see what > changed and don't feel they should re-review everything. > > I queued the below, thanks. Thanks! > > > From: Feng Tang > Subject: hung_task-add-hung_task_sys_info-sysctl-to-dump-sys-info-on-task-hung-fix > Date: Wed, 5 Nov 2025 19:30:36 +0800 > > maintain consistecy established behavior, per Lance and Petr > > Link: https://lkml.kernel.org/r/aRncJo1mA5Zk77Hr@U-2FWC9VHC-2323.local > Suggested-by: Petr Mladek > Signed-off-by: Feng Tang > Cc: Jonathan Corbet > Cc: Lance Yang > Cc: "Paul E . McKenney" > Cc: Steven Rostedt > Signed-off-by: Andrew Morton > --- With this fix, #02 patch looks good to me! Reviewed-by: Lance Yang > > kernel/hung_task.c | 24 +++++++++++++----------- > 1 file changed, 13 insertions(+), 11 deletions(-) > > --- a/kernel/hung_task.c~hung_task-add-hung_task_sys_info-sysctl-to-dump-sys-info-on-task-hung-fix > +++ a/kernel/hung_task.c > @@ -223,8 +223,11 @@ static inline void debug_show_blocker(st > } > #endif > > -static void check_hung_task(struct task_struct *t, unsigned long timeout) > +static void check_hung_task(struct task_struct *t, unsigned long timeout, > + unsigned long prev_detect_count) > { > + unsigned long total_hung_task; > + > if (!task_is_hung(t, timeout)) > return; > > @@ -234,13 +237,19 @@ static void check_hung_task(struct task_ > */ > sysctl_hung_task_detect_count++; > > + total_hung_task = sysctl_hung_task_detect_count - prev_detect_count; > trace_sched_process_hang(t); > > + if (sysctl_hung_task_panic && total_hung_task >= sysctl_hung_task_panic) { > + console_verbose(); > + hung_task_call_panic = true; > + } > + > /* > * Ok, the task did not get scheduled for more than 2 minutes, > * complain: > */ > - if (sysctl_hung_task_warnings) { > + if (sysctl_hung_task_warnings || hung_task_call_panic) { > if (sysctl_hung_task_warnings > 0) > sysctl_hung_task_warnings--; > pr_err("INFO: task %s:%d blocked for more than %ld seconds.\n", > @@ -295,7 +304,6 @@ static void check_hung_uninterruptible_t > { > int max_count = sysctl_hung_task_check_count; > unsigned long last_break = jiffies; > - unsigned long total_hung_task; > struct task_struct *g, *t; > unsigned long prev_detect_count = sysctl_hung_task_detect_count; > int need_warning = sysctl_hung_task_warnings; > @@ -320,20 +328,14 @@ static void check_hung_uninterruptible_t > last_break = jiffies; > } > > - check_hung_task(t, timeout); > + check_hung_task(t, timeout, prev_detect_count); > } > unlock: > rcu_read_unlock(); > > - total_hung_task = sysctl_hung_task_detect_count - prev_detect_count; > - if (!total_hung_task) > + if (!(sysctl_hung_task_detect_count - prev_detect_count)) > return; > > - if (sysctl_hung_task_panic && total_hung_task >= sysctl_hung_task_panic) { > - console_verbose(); > - hung_task_call_panic = true; > - } > - > if (need_warning || hung_task_call_panic) { > si_mask |= SYS_INFO_LOCKS; > > _ >