Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp4643700pxb; Tue, 2 Nov 2021 13:16:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy0/ddEswWTCJQjXnhT8l7XXw4ETttrEfCWp07QyFX9yvb8nLaikXcr+ajoJkRS3VieOPEh X-Received: by 2002:a92:1304:: with SMTP id 4mr19646786ilt.119.1635884206623; Tue, 02 Nov 2021 13:16:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635884206; cv=none; d=google.com; s=arc-20160816; b=kppye9Px9Z1gXYLJlDUnQY05j/+N5F5Cw9K55jhwcI3+RNgbHE/1zW6K3h18xKBXAw FS6H7FAjKxsaa2jwJTp3ljctdlfiM1xz2MCPJ7abuuyzDo7T2r8xcDckWb1tx25ZJzza xTRua1hA1GU8A899WUbE0wpXWwBPdmJEvQ+zmreqWaUpMCLonkPNAJ3F4ipf/4C6Mv3v 73S4EPQruoDBb3E8BD/wAu3kKgLeTgNfChQLBoJmqdJ3C1lqbb6GoxD3saR9c7xxJgIe Kf7cm7XYXfReKXywFuMw4onvYx5ZzWg6Cs0ccwh5kPcRmRkNZsY4hVA4T69ZjjTxfIvX IaDQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=vSPlWm2hs69Rrwv7pMsIZ6ZEjm3Jr85/4hUvPPRbxSY=; b=gkKhpAQdOb2qR/W4EcoJVZnhXxnldi1kvgBvYh4G8ogoHiraaWOPhpl59c89dxgoR4 jsfMSvADKJQ0UKgOtUzZsUyhJ058uLuHl5Su6EnDwbS3Ss7UMP2BIR3dYm/YiGU4xbvt 2s5hfkzZ+dPrZWQFwqz+J5BW2uC8gvgZutEjEjhXF7f8IUKUqo/M88GOCnH2XnuLuPXz P+MKEftCcXDVN493rjA8ikesp++1pWVrBkQo+nkIxOWIqZ98maf884mdcdkNubtNghnk fbLdD9oqrhiJcCCFbT1aIp2Tk3TLg0aLKQ15UQyR4WRmIN1CyaE+25tzbwLmSNme+xJl oHBw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=HYAtKgTX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j3si323365ilq.96.2021.11.02.13.16.32; Tue, 02 Nov 2021 13:16:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=HYAtKgTX; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232100AbhKBUPh (ORCPT + 99 others); Tue, 2 Nov 2021 16:15:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37530 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232112AbhKBUPM (ORCPT ); Tue, 2 Nov 2021 16:15:12 -0400 Received: from mail-io1-xd2c.google.com (mail-io1-xd2c.google.com [IPv6:2607:f8b0:4864:20::d2c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2D74AC06122B for ; Tue, 2 Nov 2021 13:12:15 -0700 (PDT) Received: by mail-io1-xd2c.google.com with SMTP id e144so155497iof.3 for ; Tue, 02 Nov 2021 13:12:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=vSPlWm2hs69Rrwv7pMsIZ6ZEjm3Jr85/4hUvPPRbxSY=; b=HYAtKgTX3PWNExtxLEVgelwQbaKIcCqdFVUUlL+xjFymnNK4MBlki0KZ8xiwn5pTTU 50wtyk9r0viovOjnSlH//z1q/vyUwgLFADoCTESoPdmsy921k2KE7d532c/UbGk5jQqg FppHvZTuqWz/yVxxXUfNpf0ZplB8TbeFFdhPg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=vSPlWm2hs69Rrwv7pMsIZ6ZEjm3Jr85/4hUvPPRbxSY=; b=ZawCivGPOQt6CUdVOhLDNEPj9+TOzStAcZdWIds4r70xfCUr8Bp3gVlwRoBgqBWZco j4UL8KmsWS8v8AfjPKF/0k5P74p8/RjWOmU8okF4LnPxRjmxdAv0z8w2X72fVvy4dQZB TBQbBCqwk8u1c1lQiISOHkqLLr1+EbZMQTGCq3j7SMkxmYoBw2coWkDPOgSNc8rKthpm JukrdWvz1PuzXzcaCGfO02xzoPeyFLgdAYHGzbgCbgurzfGqt+xd3HXrijnz9/c0YnaN Bbx9t7Q9u1+SJg7niBBDA0dmNnrpxI6dSJRryfGN8UQjohu0Le82VxMXaiHfNMe83I/J WwAA== X-Gm-Message-State: AOAM533r+zOOzQ7Yb4k3PtjGPHmxKTX2WWUixeP5vaJTD284cFdGCCro DF83Ub64yFT9uNNJiU56w1TGouTuRB6aCg== X-Received: by 2002:a05:6602:2b10:: with SMTP id p16mr27926726iov.207.1635883934420; Tue, 02 Nov 2021 13:12:14 -0700 (PDT) Received: from mail-io1-f54.google.com (mail-io1-f54.google.com. [209.85.166.54]) by smtp.gmail.com with ESMTPSA id y13sm27685ill.77.2021.11.02.13.12.13 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 02 Nov 2021 13:12:13 -0700 (PDT) Received: by mail-io1-f54.google.com with SMTP id n128so119460iod.9 for ; Tue, 02 Nov 2021 13:12:13 -0700 (PDT) X-Received: by 2002:a6b:109:: with SMTP id 9mr2801480iob.128.1635883932783; Tue, 02 Nov 2021 13:12:12 -0700 (PDT) MIME-Version: 1.0 References: <20211102173158.3315227-1-daniel.thompson@linaro.org> In-Reply-To: <20211102173158.3315227-1-daniel.thompson@linaro.org> From: Doug Anderson Date: Tue, 2 Nov 2021 13:12:01 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v4] kdb: Adopt scheduler's task classification To: Daniel Thompson Cc: Jason Wessel , Xiang wangx , jing yangyang , kgdb-bugreport@lists.sourceforge.net, linux-kernel@vger.kernel.org, patches@linaro.org Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On Tue, Nov 2, 2021 at 10:32 AM Daniel Thompson wrote: > > Currently kdb contains some open-coded routines to generate a summary > character for each task. This code currently issues warnings, is > almost certainly broken and won't make sense to any kernel dev who > has ever used /proc to examine task states. > > Fix both the warning and the potential for confusion by adopting the > scheduler's task classification. Whilst doing this we also simplify the > filtering by using mask strings directly (which means we don't have to > guess all the characters the scheduler might give us). > > Unfortunately we can't quite match the scheduler classification completely. > We add four extra states: - for idle loops and i, m and s sleeping system > daemons (which means kthreads in one of the I, M and S states). These > extra states are used to manage the filters for tools to make the output > of ps and bta less noisy. > > Note: The Fixes below is the last point the original dubious code was > moved; it was not introduced by that patch. However it gives us > the last point to which this patch can be easily backported. > Happily that should be enough to cover the introduction of > CONFIG_WERROR! > > Fixes: 2f064a59a11f ("sched: Change task_struct::state") > Signed-off-by: Daniel Thompson > --- > > Notes: > v4: > - Get rid of the final `DRSTCZEUIMA` from the comments (Doug) > - Change "state [ism]" to "state [ims]" to match other uses > of IMS/ims (Doug) > - Fix broken english in the bta online help (Doug) > - Update ps online help to use to match other > synopses (me) > > v3: > - Fix the uninitialized cpu variable (Doug and 0-day CI bot) > - Added a Fixes: (Doug) > - Changed "state I" -> "state -" and "state M" to "state [ism]" > > v2: > - Fix the typos in the description (Doug) > - Stop trying to bend to world so I can keep 'I' exactly as > it was before. Instead we now replace 'I' with '-' and > fully adopt the scheduler description of tasks. kdb > it an interactive tool, not ABI so this is OK. (Doug) > - Don't try to enumerate all possible letters in the > comments and help. You can learn what to filter from > the output of ps anyway, (Doug) > - Fix the sleeping system daemon stuff. > > kernel/debug/kdb/kdb_bt.c | 16 ++--- > kernel/debug/kdb/kdb_main.c | 37 ++++++----- > kernel/debug/kdb/kdb_private.h | 4 +- > kernel/debug/kdb/kdb_support.c | 118 +++++++-------------------------- > 4 files changed, 53 insertions(+), 122 deletions(-) Reviewed-by: Douglas Anderson