Received: by 2002:ab2:6991:0:b0:1f7:f6c3:9cb1 with SMTP id v17csp926531lqo; Wed, 8 May 2024 22:08:40 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCU5sbmfzzxjuutFZMsfDumeQC3dnu+7ebVJab2ASnX2ZX23jrLZ6+IuEWPU9cYzXnNKneJj4bUsMTK6SFevvJWeI98EI69+rqJrMiGrAw== X-Google-Smtp-Source: AGHT+IG27veSliphS8vR18pPFFw5ZoHiAHLbbhohPoU81HqJTtijhhPpv1fIS19oz9wiqJod/xyj X-Received: by 2002:a05:620a:8222:b0:792:9475:aed with SMTP id af79cd13be357-792b287d9d3mr466475985a.65.1715231320014; Wed, 08 May 2024 22:08:40 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715231320; cv=pass; d=google.com; s=arc-20160816; b=wjXW27QPsOdvhDUvgvj8n/BUZU1l93zJ+Uz1z92BpVAwuZhlWf+5AO1c6mOr7RyP9a SKc9oAzCdwBEvlRibmpkkDisNWE9H/qcp7QZnDDLAXbQik0tyNegEuTtlgKi7iNjeDsr 7HpYYsutg72RQql96xPr9UHHonu0NZ13YuwcGafp3kEUjch4nrv8Fq+HEDNtizZQit8m YK7oDdW6m/m+6B4Yiu3s7dt+fYZgRW1Is8biLwaPIbFufsYclKtYAbWsA2uogdONc353 9Bxo64XutPCXpBGWbRRoJ/GbcovC1tmm27NP5Sid4Ad6CrDwxCo82xBPQZQTifjXaqRF s/+A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence; bh=GwMe+/sDHvAVGtTIX3MapIIEfVLTv/14jv9BLJ1rN/g=; fh=/qUf4OirTfJ2NGRymIQWQun2DBA7yXkMcwJLWgjYR0Y=; b=MPPavOwAh70VYHhrEX7WsWKempxiHDHcQiSW+3xtuGfWdqNkS6fIp9vN/nBcrh7jf1 5lMi2jCCEHise2AN/2YXgwFFyyeir0MdZS2WgLFJE7k+/9741w77PEGCSmnmff6f5Jlz kCPeTALBIQwuGK0DOVBaEk5FzrBWvpXEKHWzRK+u14Zq6d5B/wYfdbem4qM/2x/DASwX kkBY2y0cz+PmBQz1G6IODaL8VtGfPbPmGWWGn8ihT2I5xNJZhRb2x31SnVhdPnWfEG0s j/t7u5PfHOYO1eMWWcgNikDOHENycuoRA7I5M5WkoJ3FxZp+ecL0gVVBeai9rzDkkwN3 6h7g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-174143-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-174143-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id af79cd13be357-792bf30a3a7si55950885a.243.2024.05.08.22.08.39 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 May 2024 22:08:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-174143-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-174143-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-174143-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id BA8E21C21893 for ; Thu, 9 May 2024 05:08:39 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id CC53E1494C0; Thu, 9 May 2024 05:08:23 +0000 (UTC) Received: from mail-pf1-f182.google.com (mail-pf1-f182.google.com [209.85.210.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EDF391494B4; Thu, 9 May 2024 05:08:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.182 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715231303; cv=none; b=DS36HP3dghJwLOVfZsfHZje+x3yxUc+sl6jm0GSNQBBACkc0NndkE9bi7eMbT6qEe9IjWsBLN29Ub/q0Tc4IceBi/A6uvOszWhVvVm1odgcUi/kBnYRPYooMLsYRI2J2FTze0YNnpVJZeymKBj2NSOI5xP83m9xhHjgynxXqJfg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715231303; c=relaxed/simple; bh=YZYM2CEf8uF3eNWleBd8V23QDnmsujeg+l05B7XGpos=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=nEpHdYfVhLHY2S413cFitaoSFcWWmr2t+/fhcAXnKC+iHlmlXK2YDyza69w9RbORwmnhet94uferbglhkgishiXFzmjq7LIxF1juGF9jCsGAtPTmKcMECZ16ZyciemhvKb8mSkaAfvtLSrOb9Afjw7zQIFLwp3LyEBVBCpQUMF8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org; spf=pass smtp.mailfrom=gmail.com; arc=none smtp.client-ip=209.85.210.182 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pf1-f182.google.com with SMTP id d2e1a72fcca58-6f453d2c5a1so484456b3a.2; Wed, 08 May 2024 22:08:21 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715231301; x=1715836101; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=GwMe+/sDHvAVGtTIX3MapIIEfVLTv/14jv9BLJ1rN/g=; b=fIK4A+tg0L+o7FTBy86+r9UE39wNtbCZ7gMdON+nxylFz3jjIDaaEJqJzY2w/FcAgl lWeHbkBPxoHHOyPFCfLEAeScaUJZz43F29KI1mV0AIg+T6JmTX5dutN1eMwjNQRAYlNC +PVlTXBs8pVNv9vNqGAabR+XLyJtQOioXnsWuZ5IC9QjMqF1KaPQ1Ntm/KzHqrQh21Ky BQzwqFySDd1DZT99nGcaCFMPRURo98601HChpwfispKLO0VYmsI5siCQquv5o4r3bBdP QHo3L2Nkz/CXK6gVp6xHXJLth9mX5URS3TLkcdYtj7Q3dkuyTSqCdiFz/M/KND0EWS+N OGFQ== X-Forwarded-Encrypted: i=1; AJvYcCUT75mwEcBl0iXkSfke+0ivJaYA0QD0sPmKxisWPYkQCKEctAGnlr8GHZ4KFs/mAcVowpilarc692zDRyCSsYiZAGbfIjnj60FBGvKvF7TgKwrX5dOZH3FxQ7XOSDyyEr72QTEIlpfONQMNxYkAxA== X-Gm-Message-State: AOJu0Yxpc85qaRmMeQ6X9hrF/L4G/Y/ZF6ZFAWpfEC+RNF8uJtENl4S5 g6ANgwEgG7OBF6khZYWaNYbnx3sMUlGOGzHjIP7k5fcOBanc4OO9OKO45p8/n5H6/ggxMAaoEsS uTHIcCHWF9oXuzpe285JcIADAuvQ= X-Received: by 2002:a05:6a21:a108:b0:1a7:60d8:a6dd with SMTP id adf61e73a8af0-1afc8dc8605mr5316420637.53.1715231301105; Wed, 08 May 2024 22:08:21 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240508060427.417-1-ravi.bangoria@amd.com> In-Reply-To: <20240508060427.417-1-ravi.bangoria@amd.com> From: Namhyung Kim Date: Wed, 8 May 2024 22:08:09 -0700 Message-ID: Subject: Re: [RFC 0/4] perf sched: Introduce schedstat tool To: Ravi Bangoria Cc: peterz@infradead.org, mingo@redhat.com, acme@kernel.org, irogers@google.com, swapnil.sapkal@amd.com, mark.rutland@arm.com, alexander.shishkin@linux.intel.com, jolsa@kernel.org, rostedt@goodmis.org, vincent.guittot@linaro.org, bristot@redhat.com, adrian.hunter@intel.com, james.clark@arm.com, kan.liang@linux.intel.com, gautham.shenoy@amd.com, kprateek.nayak@amd.com, juri.lelli@redhat.com, yangjihong@bytedance.com, linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, santosh.shukla@amd.com, ananth.narayan@amd.com, sandipan.das@amd.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi Ravi, On Tue, May 7, 2024 at 11:05=E2=80=AFPM Ravi Bangoria wrote: > > MOTIVATION > ---------- > > Existing `perf sched` is quite exhaustive and provides lot of insights > into scheduler behavior but it quickly becomes impractical to use for > long running or scheduler intensive workload. For ex, `perf sched record` > has ~7.77% overhead on hackbench (with 25 groups each running 700K loops > on a 2-socket 128 Cores 256 Threads 3rd Generation EPYC Server), and it > generates huge 56G perf.data for which perf takes ~137 mins to prepare > and write it to disk [1]. Right, this is painful. > > Unlike `perf sched record`, which hooks onto set of scheduler tracepoints > and generates samples on a tracepoint hit, `perf sched schedstat record` > takes snapshot of the /proc/schedstat file before and after the workload, > i.e. there is zero interference on workload run. Also, it takes very > minimal time to parse /proc/schedstat, convert it into perf samples and > save those samples into perf.data file. Result perf.data file is much > smaller. So, overall `perf sched schedstat record` is much more light- > weight compare to `perf sched record`. Nice work! > > We, internally at AMD, have been using this (a variant of this, known as > "sched-scoreboard"[2]) and found it to be very useful to analyse impact > of any scheduler code changes[3][4]. > > Please note that, this is not a replacement of perf sched record/report. > The intended users of the new tool are scheduler developers, not regular > users. Great, I think it's very useful. > > USAGE > ----- > > # perf sched schedstat record > # perf sched schedstat report Hmm. I think we can remove the duplication in 'sched'. :) Given you are thinking of taskstat, how about making it 'cpustat' instead? Also I think it'd be easier if you also provide 'live' mode so that users can skip record + report steps and run the workload directly like uftrace does. :) Something like this # perf sched cpustat myworkload (result here ...) Thanks, Namhyung > > Note: Although perf schedstat tool supports workload profiling syntax > (i.e. -- ), the recorded profile is still systemwide since > the /proc/schedstat is a systemwide file.