From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9274CC433EF for ; Sun, 10 Apr 2022 06:14:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232661AbiDJGQZ (ORCPT ); Sun, 10 Apr 2022 02:16:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42124 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229994AbiDJGQT (ORCPT ); Sun, 10 Apr 2022 02:16:19 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E2F81BA3; Sat, 9 Apr 2022 23:14:07 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 0C1A260ED2; Sun, 10 Apr 2022 06:14:07 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C9DD8C385A1; Sun, 10 Apr 2022 06:14:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1649571246; bh=riXjiNxoLF8mDSf3ncTuLYxn5erKsgT1pWzC0ZYs/yE=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=U64HF4HQ04+XF3DuslJ07g8B8r53kPQw0qbe6DDzegUIzwPraU9NpcoUTtn+Zjne7 on9wj0WjdSWqyKyU0pPiu5tqPmZMEmM1cULh87Gi3CoW1p2s4alhSAgzDkHr9NLst+ 8/qFf7q/fsZ4ROBKgHwiTF9VAJe4ipFYoR0L4YYo= Date: Sun, 10 Apr 2022 08:14:03 +0200 From: Greg KH To: Qais Yousef Cc: stable@vger.kernel.org, linux-kernel@vger.kernel.org, Uwe =?iso-8859-1?Q?Kleine-K=F6nig?= , Abhijeet Dharmapurikar , Dietmar Eggemann , Steven Rostedt , Peter Zijlstra , Ingo Molnar , Vincent Guittot , Thomas Gleixner , Sebastian Andrzej Siewior , Juri Lelli , Daniel Bristot de Oliveira , Kees Cook , Andrew Morton , "Eric W. Biederman" , Alexey Gladkov , "Kenta.Tada@sony.com" , Randy Dunlap , Ed Tsai , Valentin Schneider Subject: Re: [PATCH v3 2/2] sched/tracing: Report TASK_RTLOCK_WAIT tasks as TASK_UNINTERRUPTIBLE Message-ID: References: <20220120162520.570782-1-valentin.schneider@arm.com> <20220120162520.570782-3-valentin.schneider@arm.com> <20220409234224.q57dr43bpcll3ryv@airbuntu> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20220409234224.q57dr43bpcll3ryv@airbuntu> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Apr 10, 2022 at 12:42:24AM +0100, Qais Yousef wrote: > +CC stable > > On 01/20/22 16:25, Valentin Schneider wrote: > > TASK_RTLOCK_WAIT currently isn't part of TASK_REPORT, thus a task blocking > > on an rtlock will appear as having a task state == 0, IOW TASK_RUNNING. > > > > The actual state is saved in p->saved_state, but reading it after reading > > p->__state has a few issues: > > o that could still be TASK_RUNNING in the case of e.g. rt_spin_lock > > o ttwu_state_match() might have changed that to TASK_RUNNING > > > > As pointed out by Eric, adding TASK_RTLOCK_WAIT to TASK_REPORT implies > > exposing a new state to userspace tools which way not know what to do with > > them. The only information that needs to be conveyed here is that a task is > > waiting on an rt_mutex, which matches TASK_UNINTERRUPTIBLE - there's no > > need for a new state. > > > > Reported-by: Uwe Kleine-König > > Signed-off-by: Valentin Schneider > > Any objection for this to be picked up by stable? We care about Patch 1 only in > this series for stable, but it seems sensible to pick this one too, no strong > feeling if it is omitted though. > > AFAICT it seems the problem dates back since commit: > > 1593baab910d ("sched/debug: Implement consistent task-state printing") > > or even before. I think v4.14+ is good enough. This is not the correct way to submit patches for inclusion in the stable kernel tree. Please read: https://www.kernel.org/doc/html/latest/process/stable-kernel-rules.html for how to do this properly.