Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752113AbdHHKgo (ORCPT ); Tue, 8 Aug 2017 06:36:44 -0400 Received: from mail-io0-f173.google.com ([209.85.223.173]:34966 "EHLO mail-io0-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751464AbdHHKgm (ORCPT ); Tue, 8 Aug 2017 06:36:42 -0400 MIME-Version: 1.0 In-Reply-To: <20170808102438.teglqelqih52tnst@hirez.programming.kicks-ass.net> References: <1502196790-12585-1-git-send-email-laoar.shao@gmail.com> <20170808083053.37aaregzlws4aquz@hirez.programming.kicks-ass.net> <20170808102438.teglqelqih52tnst@hirez.programming.kicks-ass.net> From: Yafang Shao Date: Tue, 8 Aug 2017 18:36:41 +0800 Message-ID: Subject: Re: [PATCH v2] scheduler: enhancement to show_state_filter To: Peter Zijlstra Cc: gregkh@linuxfoundation.org, jslaby@suse.com, mingo@redhat.com, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1224 Lines: 34 Hi Peter, In oder to make it readable, I have comment in the patch why this change is made, - if (!state_filter || (p->state & state_filter)) + /* in case we want to set TASK_RUNNING specifically */ + if ((p->state != TASK_RUNNING ? p->state << 1 : 1) & state_filter) sched_show_task(p); show_state_filter() is only used in SysRq, in which we can dump all tasks (with the key 't'), or uninterruptible tasks(with the key 'w'). I think we should also dump only running tasks (with a new key, or something else). But in order to introduce the new key, we should made this change first. After this change got approved, I will try to make some changes in SysRq. Thanks Yafang 2017-08-08 18:24 GMT+08:00 Peter Zijlstra : > On Tue, Aug 08, 2017 at 04:50:23PM +0800, Yafang Shao wrote: >> Hi Peter, >> >> The point is we call use it as bellow, >> show_state_filter(TASK_RUNNING); >> because TASK_RUNNING is 0, that will dump all tasks. >> >> Under some circumstance, we need this to dump only tasks in TASK_RUNNING state. > > But the patch doesn't introduce any of that. It just makes the existing > code unreadable.