Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp4487188pxb; Tue, 31 Aug 2021 06:28:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzDCsCoydIY1sWOnv0gcHD5RO941TdhZQuWwUoTEc4CWCv3n3NT7z+5wxBnzlLdKhYifg2P X-Received: by 2002:a17:906:ca1:: with SMTP id k1mr31315174ejh.369.1630416505449; Tue, 31 Aug 2021 06:28:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1630416505; cv=none; d=google.com; s=arc-20160816; b=pJvceYyaLV7c4HsJO0HVJgg3sh6jBZ7m+be15PA3eLTOPD+H04V2xjcIJRBzcIKN4t DiqZf65Rrsc/qdh5wZE7jYiwVuxd6IGvsnTj/Fo++OWAUEU2xYih80Ig6zyuDqDy3wbk jymk9FsLRxBqOfmecOAwW5CfUBfCI3ShdN9C7HarA7pChty45lxjo833JOMokbAg3J+A EK2HikaQLUUIJQvDr0lSsKQNbaU8Z7oMqQzF7wjcPBwY6lrfkLStwKCPGlWeZ3a3oeyv LvfMnRgx8Qa4+uDVp6+ZENmgzCe5kpeXP1cY0IZlRj/BHC31l3WPk9yu8jW1KsOI4s28 KNvg== 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=7NvgPHh532zLFsZQEQ10urcOdKS8PwchEX/gRShxyoU=; b=LDHBwApswDtjWoj9SEqC6rO9kF6iM8Sdlbc2X7OuMqwnCwNw3p445ESke0C9jkk4qR htXUbNt0WAB6wPcjAgNpsnGYSUocLU0jRIurcgs+2kmNRN6VU1NWOSI2MoHUfr+GeSTI B7DGXFI9WVjatm3ON5N4a62KiRUuPcUYRbhBJ4epmbSC43SpC08RJhEqIWjNdo6xQkVk tX1L5tsGtvSiDydR7aIUyKYGHHyGdwLuHt3xtK36wXHc4BPmR5S3aRQMfkMfcMt6pzdv 4tTlEfA2flec94N1rQx/dgWrigKKqAvOwFJTaK9nUxi9q+m7DmQH4MwUnrN1lphVRDvQ 8b9A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=nNOrZH+d; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id o10si4749864edc.75.2021.08.31.06.27.56; Tue, 31 Aug 2021 06:28:25 -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=@gmail.com header.s=20161025 header.b=nNOrZH+d; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234490AbhHaN07 (ORCPT + 99 others); Tue, 31 Aug 2021 09:26:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50284 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234255AbhHaN0u (ORCPT ); Tue, 31 Aug 2021 09:26:50 -0400 Received: from mail-io1-xd2d.google.com (mail-io1-xd2d.google.com [IPv6:2607:f8b0:4864:20::d2d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DAEB7C061575; Tue, 31 Aug 2021 06:25:55 -0700 (PDT) Received: by mail-io1-xd2d.google.com with SMTP id y18so24806614ioc.1; Tue, 31 Aug 2021 06:25:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=7NvgPHh532zLFsZQEQ10urcOdKS8PwchEX/gRShxyoU=; b=nNOrZH+dH+SQd2F+GrdNHDcvmF0JiO9rqTOgY9HF7Ggo+N6UbSrvgkCkGfJA76Y/Td 6VLGjXweZdUPteQJvgsnmrXVzCwSCNhgDbQlSLNWUed7pPF0pYovKj1ZSZJqlLtnhDbE gQeSw4ytqIm0U9fV8S/J3C+pA0MzoH+mhRTb0fKm5Vv/9+oOZ6Rpw93VCNRhNahY/fn6 eHp9NIyNINZHASm2otSsV5S1VRaJMr0PxB7c/FwKOoE/adVW83RhyXGHs0g2HESql1BC KU/82OsqCaMXkJ7CzxNdzHJRV/6DIMtc4m47NbZ8qi5801xGZcI0xILC4AAJeFTCiWYa zROQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=7NvgPHh532zLFsZQEQ10urcOdKS8PwchEX/gRShxyoU=; b=PPMslF/NlSd1JyEbq9QcijNYEnkUeuo4naNpB6wVpmnmhTyn/YUyt9JKoDW+PeuEXW VFdVD0DzNtfXiJD5TredGwv7ppfPKMY0e8Q+ALglG/zEEqhaPMZ7lGt0gp0hsvg5Wlt6 Y96jFMPAfpiXU2iIkhCxReAcbk+66QzdANgfiE92Klvyxab06QYv1R5Depl2kF/hvYF6 A/Uw8GznhTUWAyZ2mz7PimefYFYQN52xedJOYVV78MVzLeEb8l/Iejw0qqmSiHTTeMF5 LXUD73PNClEMcmc/RxDDHDt5JyiYbQLTRn2nA4urPa7XvYn7/7PJv7+6ps2yYE8OY+lT mePg== X-Gm-Message-State: AOAM5307gU5cT9+C/6MouR+DkxJzOm5JzegLpxyJcKzbdZZy+95H+7sC b25HqCS/kVr7cpSTUMVzjmLJcTaO+7XTytIBqAA= X-Received: by 2002:a5d:94c6:: with SMTP id y6mr23174101ior.202.1630416355361; Tue, 31 Aug 2021 06:25:55 -0700 (PDT) MIME-Version: 1.0 References: <20210824112946.9324-1-laoar.shao@gmail.com> <20210824112946.9324-3-laoar.shao@gmail.com> In-Reply-To: From: Yafang Shao Date: Tue, 31 Aug 2021 21:25:19 +0800 Message-ID: Subject: Re: [PATCH v3 2/7] sched: make struct sched_statistics independent of fair sched class To: Peter Zijlstra Cc: Ingo Molnar , Mel Gorman , Juri Lelli , Vincent Guittot , Dietmar Eggemann , Steven Rostedt , Benjamin Segall , Daniel Bristot de Oliveira , Alison Chaiken , kbuild test robot , LKML , linux-rt-users Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Aug 31, 2021 at 6:15 PM Peter Zijlstra wrote: > > On Tue, Aug 24, 2021 at 11:29:41AM +0000, Yafang Shao wrote: > > diff --git a/kernel/sched/debug.c b/kernel/sched/debug.c > > index 49716228efb4..4cfee2aa1a2d 100644 > > --- a/kernel/sched/debug.c > > +++ b/kernel/sched/debug.c > > > @@ -442,9 +442,11 @@ static void print_cfs_group_stats(struct seq_file *m, int cpu, struct task_group > > struct sched_entity *se = tg->se[cpu]; > > > > #define P(F) SEQ_printf(m, " .%-30s: %lld\n", #F, (long long)F) > > -#define P_SCHEDSTAT(F) SEQ_printf(m, " .%-30s: %lld\n", #F, (long long)schedstat_val(F)) > > +#define P_SCHEDSTAT(F) SEQ_printf(m, " .%-30s: %lld\n", \ > > + "se->statistics."#F, (long long)schedstat_val(tg->stats[cpu]->F)) > > #define PN(F) SEQ_printf(m, " .%-30s: %lld.%06ld\n", #F, SPLIT_NS((long long)F)) > > -#define PN_SCHEDSTAT(F) SEQ_printf(m, " .%-30s: %lld.%06ld\n", #F, SPLIT_NS((long long)schedstat_val(F))) > > +#define PN_SCHEDSTAT(F) SEQ_printf(m, " .%-30s: %lld.%06ld\n", \ > > + "se->statistics."#F, SPLIT_NS((long long)schedstat_val(tg->stats[cpu]->F))) > > > > if (!se) > > return; > > > @@ -948,8 +950,8 @@ void proc_sched_show_task(struct task_struct *p, struct pid_namespace *ns, > > "---------------------------------------------------------" > > "----------\n"); > > > > -#define P_SCHEDSTAT(F) __PS(#F, schedstat_val(p->F)) > > -#define PN_SCHEDSTAT(F) __PSN(#F, schedstat_val(p->F)) > > +#define P_SCHEDSTAT(F) __PS("se.statistics."#F, schedstat_val(p->stats.F)) > > +#define PN_SCHEDSTAT(F) __PSN("se.statistics."#F, schedstat_val(p->stats.F)) > > > > PN(se.exec_start); > > PN(se.vruntime); > > That's sad... can't we keep it #F, this is all SCHED_DEBUG code anyway. Sure, I will change it. -- Thanks Yafang