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 X-Spam-Level: X-Spam-Status: No, score=-13.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 47A8BC47095 for ; Mon, 7 Jun 2021 11:11:23 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id DE46961107 for ; Mon, 7 Jun 2021 11:11:22 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DE46961107 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 326CC6B006C; Mon, 7 Jun 2021 07:11:22 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 2D6246B006E; Mon, 7 Jun 2021 07:11:22 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 128B26B0070; Mon, 7 Jun 2021 07:11:22 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0076.hostedemail.com [216.40.44.76]) by kanga.kvack.org (Postfix) with ESMTP id D12CE6B006C for ; Mon, 7 Jun 2021 07:11:21 -0400 (EDT) Received: from smtpin14.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 624DB180AD802 for ; Mon, 7 Jun 2021 11:11:21 +0000 (UTC) X-FDA: 78226661562.14.90B5A3C Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) by imf07.hostedemail.com (Postfix) with ESMTP id 28D62A00025D for ; Mon, 7 Jun 2021 11:11:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=NLj4NYDQW6SbenCIcbS9QrwkO4aohp/HPEuCGPuaREs=; b=cPnEKquwt970ZOfmptV8ZPqMgA nDKIN3sS9ih9nuu8IzgPQnkE+3vwyvAnDc2ZrMU9wmERzTb3IGMYGi4WE6+4lUgqF2JtL/lM/I5kJ eiHF9IMB2d+Y9lTFFFVOwPJJI9S76oa/nkFLOGjGCPqHZTpDXHEuTaeqYbLfHC8bQodhRsFoh+Qy8 dTHV3vTaUZfqdQXrfYxuM6d63mJeyrNKoQ2Zm8n4XPuwlvYtbjKQlZwLanaf8FCczQxwMbK2aY9KZ 5ZBbcHBMtWS/MR3PhHmCJk3dhHVW0UT+bEq4donFnJVNzTVZUBUUF9jUBREUKuzW6aCVhr/V5xCxL LVjMXPEw==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by desiato.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1lqD9a-004Mvt-Aj; Mon, 07 Jun 2021 11:10:53 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 12A093002CA; Mon, 7 Jun 2021 13:10:49 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id A8BB82CF3852B; Mon, 7 Jun 2021 13:10:49 +0200 (CEST) Date: Mon, 7 Jun 2021 13:10:49 +0200 From: Peter Zijlstra To: Daniel Thompson Cc: Thomas Gleixner , Ingo Molnar , Juri Lelli , Vincent Guittot , Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , Daniel Bristot de Oliveira , Borislav Petkov , x86@kernel.org, "H. Peter Anvin" , Jens Axboe , Alasdair Kergon , Mike Snitzer , dm-devel@redhat.com, "David S. Miller" , Jakub Kicinski , Felipe Balbi , Greg Kroah-Hartman , Alexander Viro , Tejun Heo , Zefan Li , Johannes Weiner , Jason Wessel , Douglas Anderson , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , "Rafael J. Wysocki" , Pavel Machek , Will Deacon , Waiman Long , Boqun Feng , Oleg Nesterov , Davidlohr Bueso , "Paul E. McKenney" , Josh Triplett , Mathieu Desnoyers , Lai Jiangshan , Joel Fernandes , John Stultz , Stephen Boyd , Andrew Morton , Paolo Bonzini , linux-kernel@vger.kernel.org, linux-block@vger.kernel.org, netdev@vger.kernel.org, linux-usb@vger.kernel.org, linux-fsdevel@vger.kernel.org, cgroups@vger.kernel.org, kgdb-bugreport@lists.sourceforge.net, linux-perf-users@vger.kernel.org, linux-pm@vger.kernel.org, rcu@vger.kernel.org, linux-mm@kvack.org, kvm@vger.kernel.org Subject: Re: [PATCH 6/6] sched: Change task_struct::state Message-ID: References: <20210602131225.336600299@infradead.org> <20210602133040.587042016@infradead.org> <20210607104500.sopvslejuoxwzhrs@maple.lan> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210607104500.sopvslejuoxwzhrs@maple.lan> Authentication-Results: imf07.hostedemail.com; dkim=pass header.d=infradead.org header.s=desiato.20200630 header.b=cPnEKquw; spf=none (imf07.hostedemail.com: domain of peterz@infradead.org has no SPF policy when checking 90.155.92.199) smtp.mailfrom=peterz@infradead.org; dmarc=none X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: 28D62A00025D X-Stat-Signature: x8xpx66ocn3jmjkuf4fst1m3hiofkk7u X-HE-Tag: 1623064278-346184 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Mon, Jun 07, 2021 at 11:45:00AM +0100, Daniel Thompson wrote: > On Wed, Jun 02, 2021 at 03:12:31PM +0200, Peter Zijlstra wrote: > > Change the type and name of task_struct::state. Drop the volatile and > > shrink it to an 'unsigned int'. Rename it in order to find all uses > > such that we can use READ_ONCE/WRITE_ONCE as appropriate. > > > > Signed-off-by: Peter Zijlstra (Intel) > > --- > > ... > > kernel/debug/kdb/kdb_support.c | 18 +++++++------ > > ... > > --- a/kernel/debug/kdb/kdb_support.c > > +++ b/kernel/debug/kdb/kdb_support.c > > @@ -609,23 +609,25 @@ unsigned long kdb_task_state_string(cons > > */ > > char kdb_task_state_char (const struct task_struct *p) > > { > > - int cpu; > > - char state; > > + unsigned int p_state; > > unsigned long tmp; > > + char state; > > + int cpu; > > > > if (!p || > > copy_from_kernel_nofault(&tmp, (char *)p, sizeof(unsigned long))) > > return 'E'; > > > > cpu = kdb_process_cpu(p); > > - state = (p->state == 0) ? 'R' : > > - (p->state < 0) ? 'U' : > > - (p->state & TASK_UNINTERRUPTIBLE) ? 'D' : > > - (p->state & TASK_STOPPED) ? 'T' : > > - (p->state & TASK_TRACED) ? 'C' : > > + p_state = READ_ONCE(p->__state); > > + state = (p_state == 0) ? 'R' : > > + (p_state < 0) ? 'U' : > > Looks like the U here stands for Unreachable since this patch makes it > more obvious that this clause is (and previously was) exactly that! > > Dropping the U state would be good since I guess this will show up as a > "new" warning in some tools. However it was a preexisting problem so with > or without this cleaned up: > Acked-by: Daniel Thompson Thanks! Note that there's a second instance of this exact code in arch/powerpc/xmon/xmon.c, with the same 'U' issue. I'll repost this soon, as it seems I've fixed all robot failout (fingers crossed).