Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752655AbdHVUgs (ORCPT ); Tue, 22 Aug 2017 16:36:48 -0400 Received: from bombadil.infradead.org ([65.50.211.133]:59285 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752189AbdHVUgq (ORCPT ); Tue, 22 Aug 2017 16:36:46 -0400 Date: Tue, 22 Aug 2017 22:36:32 +0200 From: Peter Zijlstra To: Imran Khan Cc: mingo@kernel.org, imrank140517@gmail.com, "Luis R. Rodriguez" , Kees Cook , Shile Zhang , Matt Fleming , Andrew Morton , Vegard Nossum , Tetsuo Handa , John Siddle , open list , "open list:PROC SYSCTL" Subject: Re: [PATCH] RFC: hung task: Check specific tasks for long uninterruptible sleep state Message-ID: <20170822203632.GQ32112@worktop.programming.kicks-ass.net> References: <1503311156-16919-1-git-send-email-kimran@codeaurora.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1503311156-16919-1-git-send-email-kimran@codeaurora.org> User-Agent: Mutt/1.5.22.1 (2013-10-16) X-MIME-Error: demime acl condition: uuencoded line length does not match advertised number of bytes Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1171 Lines: 22 On Mon, Aug 21, 2017 at 03:55:53PM +0530, Imran Khan wrote: > khungtask by default monitors either all tasks or no tasks at all > for long unterruptible sleeps. > For Android like environments this arrangement is not optimal because > on one hand it may be permissible to have some background(bg) task > in uninterruptible sleep state for long duration while on the other > hand it may not be permissible to have some foreground(fg) task like > surfaceflinger in uninterruptible sleep state for long duration. How are you getting tasks in UNINTERRUPTIBLE state for a long time to begin with? That's not a good thing, background or not. > So it would be good to have some arrangement so that few specified tasks > can be monitored by khungtaskd, on a need basis. > This change introduces a sysctl option, /proc/sys/kernel/ > hung_task_check_selected, to enable monitoring of selected tasks using > khungtask daemon. If this sysctl option is enabled then only the tasks > specified in /proc/hung_task_monitor_list are monitored otherwise all > tasks are monitored, just like the default case. That's horrible. Why not a file in /proc/$PID/ that excludes it from things?