Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp4436031pxb; Tue, 2 Nov 2021 09:41:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxX0o7C2y77agrUQU1h42HMZhiZrmdN9FKZQiuQZaAC4wh/eNHF6RwvDVXgxxx6I30PX4vh X-Received: by 2002:a92:ca05:: with SMTP id j5mr25266592ils.112.1635871260664; Tue, 02 Nov 2021 09:41:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635871260; cv=none; d=google.com; s=arc-20160816; b=OXxTg2DCyEf/iLcY4hjZiAls27yeRf1w5Y1i3Bmgkrt8QeFYLxl5bWKobet14CQhvH 6pIctAXVZG4FBH7bt0UxbaiBj9nfjqLVyrOepLpZK6XtOvJsmE9DZwvisSze4cCX3IDY 57ijOwbjbaTYVltzCsak733qduaCP8dISKH0jloioYXijhmZMwtQi4rIbt006eBBVB/0 JazHBqLeBj92eByyir/eXIGdS4w+WXrsub4BGrJjDABp7jKPD+dM6afP9nHB4RSmgDOj 1IxU6JKQn8NZenq4KT2Pcqq51E9wIUkjvKcuf+YpKxDuy9eohIfiZawq7TO48LKOMvK5 NmWg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=CpUJOmzAX/8URtDkwbVdkTj3rb0UDdNphvTprVMTsPc=; b=u4JZp2JoJpzZlmQhqRgewzu//cPTKztmajJNZJUt5xla7sLseEPMtnIcTG16no2wW8 Nbc6Wo9VhaD0UByIUdoYMFT0c4csGOOYYI/xh1/RVrskfYNzqqeAZY8eJ2IFQMJe3FwO WBKrSzz9JjC7mLi6AAOIip/M9diswgUw0zjNdbYcffVgVYLiqeEurta7PYeJDQ5VpfNW zPK3Xgj9wqUKiTNoODxsVjL3nuKAPQmuxiDl0YcPbvodQpb+DstwG36Lufo/5wL/kSjO NOemy0xS1gUt7kiIh+zIq1Qais3raSjHRG2kezUd8+lHKsQQ6YhqZaJIHznabkmmc+LL 5Jvw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=A1vwiunF; 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=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 8si19221382ilx.88.2021.11.02.09.40.48; Tue, 02 Nov 2021 09:41:00 -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=@linaro.org header.s=google header.b=A1vwiunF; 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=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234709AbhKBQmU (ORCPT + 99 others); Tue, 2 Nov 2021 12:42:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42556 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234682AbhKBQmO (ORCPT ); Tue, 2 Nov 2021 12:42:14 -0400 Received: from mail-wr1-x432.google.com (mail-wr1-x432.google.com [IPv6:2a00:1450:4864:20::432]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5F7B8C0797B1 for ; Tue, 2 Nov 2021 09:19:38 -0700 (PDT) Received: by mail-wr1-x432.google.com with SMTP id d27so16199127wrb.6 for ; Tue, 02 Nov 2021 09:19:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=CpUJOmzAX/8URtDkwbVdkTj3rb0UDdNphvTprVMTsPc=; b=A1vwiunFsjHUdX4UhJsd2VuGwcx8879Ito38Bw5Z+CDChY+JvT6+9VdPKIagndQl68 Og88/XHn4hWv7jPsWEI8vrmL1C/Hc/2mEQ9VdWVEzqdeb3+ZFzYdkKzk8M76yHKf2DGq uwGggZzG2onxTwiykA04zouRFH1h+4GfgWU5TC5C2w6RuDpXckcllrNcKsv8M5Mq6Cyp X1nmFXPBJO0zVR0TYc5IJ9txNp7kPo+wePNybRPcMKR8W05pyGzsbaxtBE51gquTAzRf uFYRs799Vw3j55o5AyaNmxeBvPuUOyKR4QUA0Y04elwgeoKZTwVuBp5mU67wB9ifnjqJ Lb+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=CpUJOmzAX/8URtDkwbVdkTj3rb0UDdNphvTprVMTsPc=; b=lIvdjRcXNOoWunEMAtRPCX1fxok0IrCShmlQYh5MRdd0wpXfhI4kgbS+gcuSmS5EXB RznjyVJUGjLRTVJo/WrtJdCPjG9Pu5Uorud6TtA6Fj7y4RvHbbeT/pfdezu8HkIAzHB7 +EiBpQZaErHBCmjgTyAVkAF419p82eBViqhSGUzpdHQ5UBiyssAuTiv2xpM9zFS8SWU7 zNxPdPXCx9D2gqLh4lgSTcTRLsTvcAKIwkPzXDEVzvv7FSEpW6YIkA/wKuiuhwwxTjM0 VHqIAnBslJHAxfmyWua755NLoCb/jLf7HvV0pApkHvVwMgATnXa0Nw/HUgjisYd/sqkl YBFg== X-Gm-Message-State: AOAM5305ckLvNIjNUC5szsdwI1qYgBSEgOK0E0KwRaw3/TmPG3my4WAq yiaFiUYHYO3Y78CU1/BGf1WZ3g== X-Received: by 2002:a5d:64c8:: with SMTP id f8mr49212985wri.398.1635869976925; Tue, 02 Nov 2021 09:19:36 -0700 (PDT) Received: from maple.lan (cpc141216-aztw34-2-0-cust174.18-1.cable.virginm.net. [80.7.220.175]) by smtp.gmail.com with ESMTPSA id n184sm1327774wme.2.2021.11.02.09.19.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Nov 2021 09:19:36 -0700 (PDT) Date: Tue, 2 Nov 2021 16:19:34 +0000 From: Daniel Thompson To: Doug Anderson Cc: Jason Wessel , Xiang wangx , jing yangyang , kgdb-bugreport@lists.sourceforge.net, LKML , Patch Tracking Subject: Re: [PATCH v3] kdb: Adopt scheduler's task classification Message-ID: <20211102161934.664jrypn5rxaszae@maple.lan> References: <20211101174344.3220974-1-daniel.thompson@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Nov 01, 2021 at 12:56:13PM -0700, Doug Anderson wrote: > Hi, > > On Mon, Nov 1, 2021 at 10:44 AM Daniel Thompson > wrote: > > diff --git a/kernel/debug/kdb/kdb_bt.c b/kernel/debug/kdb/kdb_bt.c > > index 1f9f0e47aeda..3368a2d15d73 100644 > > --- a/kernel/debug/kdb/kdb_bt.c > > +++ b/kernel/debug/kdb/kdb_bt.c > > @@ -74,7 +74,7 @@ static void kdb_show_stack(struct task_struct *p, void *addr) > > */ > > > > static int > > -kdb_bt1(struct task_struct *p, unsigned long mask, bool btaprompt) > > +kdb_bt1(struct task_struct *p, const char *mask, bool btaprompt) > > (Copied from v1 review): > > In the comment above this function there is still a reference to > "DRSTCZEUIMA". Update that? /me slaps head Sorry. This patch really doesn't seem to have been my finest hour. Really thought I'd got it right at v3 (even threw in extra manual testing for good measure). Will fix... immediately. > > @@ -2271,37 +2271,30 @@ static int kdb_cpu(int argc, const char **argv) > > void kdb_ps_suppressed(void) > > { > > int idle = 0, daemon = 0; > > - unsigned long mask_I = kdb_task_state_string("I"), > > - mask_M = kdb_task_state_string("M"); > > unsigned long cpu; > > const struct task_struct *p, *g; > > for_each_online_cpu(cpu) { > > p = kdb_curr_task(cpu); > > - if (kdb_task_state(p, mask_I)) > > + if (kdb_task_state(p, "-")) > > ++idle; > > } > > for_each_process_thread(g, p) { > > - if (kdb_task_state(p, mask_M)) > > + if (kdb_task_state(p, "ims")) > > ++daemon; > > } > > if (idle || daemon) { > > if (idle) > > - kdb_printf("%d idle process%s (state I)%s\n", > > + kdb_printf("%d idle process%s (state -)%s\n", > > idle, idle == 1 ? "" : "es", > > daemon ? " and " : ""); > > if (daemon) > > - kdb_printf("%d sleeping system daemon (state M) " > > + kdb_printf("%d sleeping system daemon (state [ism]) " > > super nitty: elsewhere you use "ims", not "ism". Can you be consistent > and change the above to "ims"? Ack. > @@ -2742,8 +2743,8 @@ static kdbtab_t maintab[] = { > > }, > > { .name = "bta", > > .func = kdb_bt, > > - .usage = "[D|R|S|T|C|Z|E|U|I|M|A]", > > - .help = "Backtrace all processes matching state flag", > > + .usage = "[|A]", > > + .help = "Backtrace all processes matching whose state matches", > > "matching whose state matches" sounds odd. Clean it up and use the > saved chars to document "A": > > .help = "Backtrace all processes whose state matches (A=all)", Turns out we don't have enough characters to document A on an 80 character terminal (some of the other help text is too long as well but I'll put that on the list for later). Will settle for "Backtrace all processes whose state matches" and leave it at that. Will also updates the .usage for ps which doesn't use the . Daniel.