Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp3490366pxp; Tue, 8 Mar 2022 15:48:10 -0800 (PST) X-Google-Smtp-Source: ABdhPJxi9R+7I1ecNvnhO5cqW8RPLX8FCw5a+pwQB2YkEQBqpznwNtj+xf7pDNluqH04VWT1QQv3 X-Received: by 2002:a17:902:b189:b0:14d:6f87:7c25 with SMTP id s9-20020a170902b18900b0014d6f877c25mr20514573plr.31.1646783289995; Tue, 08 Mar 2022 15:48:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646783289; cv=none; d=google.com; s=arc-20160816; b=PCb3vcvq+IfrhD8PnU0peDMOV6StExNYk80nCS9qfFWHLsH/ZwCvgwk8xNeFEgmtH+ MdC7cjaAgVtIkn3hti0gzMWNI80hFmJL6fIrqzpYU8BlJlW7w2tN+gOx2KrE8AZgu8C6 hERYjc/hkTb5nDB3WfyiKgnC2jp30ocJvMRPPnfqG3i+T6ExAQ+KokIC7AD0Cf5120dl TVl9ZodpJ7y6FwniZBaxC3k8cr+mFu4JuQkp/XK4NMdmCgzNqO60KdAFYeaXKStWxvjt 7wGhIuB/q51XKai9UkxX1J1FyKCYsA7x2pZsx5htpcqoEr/k/KIC3vHhmv/0u0zSWHvR Z6OQ== 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; bh=LdiWd4HshJOtiN+fQCDc5s3/aP3NYZOf4LCg27JOnL0=; b=GreyCX3RP0vBBIEp2WMLGwK8R3P43FgknD0ZpGgtG7DFPA83r6KQXch3VxvOV2IMZQ gA7Ypebf3KlJC0HfSU4VhxEAGSHuidvOawhCbq3dok7GGc+1498Me+kuk1nTwuIcyBDi vq5legcri/qVeOY24R+MtiGR2MzoEuEkEcOZmZLQNPEl7lu9+HnbfZMlFmTduvnpaG2S W0vuxnD7vIy7yy7jQyNBMR4NIfUqeTNAbw+ILYoT8U42oJkBtMIdPJ5875x3FRLyFlnI fpCZ4QynkLithTpIBNM0hzJOqXg3KSdScH1Q3xNIcFvHSLcqqhmMYYcOhe+N8+KFYxXz a4wA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id s140-20020a632c92000000b0038081451114si265017pgs.47.2022.03.08.15.48.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Mar 2022 15:48:09 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 840A8C42B7; Tue, 8 Mar 2022 15:28:41 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236338AbiCHSDo (ORCPT + 99 others); Tue, 8 Mar 2022 13:03:44 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35788 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234429AbiCHSDk (ORCPT ); Tue, 8 Mar 2022 13:03:40 -0500 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 24AF724F2B; Tue, 8 Mar 2022 10:02:43 -0800 (PST) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id E7FFE1516; Tue, 8 Mar 2022 10:02:42 -0800 (PST) Received: from wubuntu (unknown [10.57.71.199]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id C8AB03FA45; Tue, 8 Mar 2022 10:02:41 -0800 (PST) Date: Tue, 8 Mar 2022 18:02:40 +0000 From: Qais Yousef To: linux-kernel@vger.kernel.org Cc: linux-tip-commits@vger.kernel.org, Abhijeet Dharmapurikar , Valentin Schneider , "Peter Zijlstra (Intel)" , "Steven Rostedt (Google)" , x86@kernel.org, stable@vger.kernel.org Subject: Re: [tip: sched/core] sched/tracing: Don't re-read p->state when emitting sched_switch event Message-ID: <20220308180240.qivyjdn4e3te3urm@wubuntu> References: <20220120162520.570782-2-valentin.schneider@arm.com> <164614827941.16921.4995078681021904041.tip-bot2@tip-bot2> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <164614827941.16921.4995078681021904041.tip-bot2@tip-bot2> X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org +CC stable On 03/01/22 15:24, tip-bot2 for Valentin Schneider wrote: > The following commit has been merged into the sched/core branch of tip: > > Commit-ID: fa2c3254d7cfff5f7a916ab928a562d1165f17bb > Gitweb: https://git.kernel.org/tip/fa2c3254d7cfff5f7a916ab928a562d1165f17bb > Author: Valentin Schneider > AuthorDate: Thu, 20 Jan 2022 16:25:19 > Committer: Peter Zijlstra > CommitterDate: Tue, 01 Mar 2022 16:18:39 +01:00 > > sched/tracing: Don't re-read p->state when emitting sched_switch event > > As of commit > > c6e7bd7afaeb ("sched/core: Optimize ttwu() spinning on p->on_cpu") > > the following sequence becomes possible: > > p->__state = TASK_INTERRUPTIBLE; > __schedule() > deactivate_task(p); > ttwu() > READ !p->on_rq > p->__state=TASK_WAKING > trace_sched_switch() > __trace_sched_switch_state() > task_state_index() > return 0; > > TASK_WAKING isn't in TASK_REPORT, so the task appears as TASK_RUNNING in > the trace event. > > Prevent this by pushing the value read from __schedule() down the trace > event. > > Reported-by: Abhijeet Dharmapurikar > Signed-off-by: Valentin Schneider > Signed-off-by: Peter Zijlstra (Intel) > Reviewed-by: Steven Rostedt (Google) > Link: https://lore.kernel.org/r/20220120162520.570782-2-valentin.schneider@arm.com Any objection to picking this for stable? I'm interested in this one for some Android users but prefer if it can be taken by stable rather than backport it individually. I think it makes sense to pick the next one in the series too. Thanks! -- Qais Yousef