Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp1621933pxu; Tue, 24 Nov 2020 05:11:17 -0800 (PST) X-Google-Smtp-Source: ABdhPJzm3Nhu3HgsupVkCevEHe9GCKZrgeD6IFcAJEpKr9Q7OMGd1BStavkmQ3Y4+aip8oFPody4 X-Received: by 2002:a17:906:2683:: with SMTP id t3mr4245728ejc.414.1606223476881; Tue, 24 Nov 2020 05:11:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606223476; cv=none; d=google.com; s=arc-20160816; b=OGhTn4p4FBVHABl5WOeCXUkUYjlNuAkpukZg5onoRy+ZF2DBlerfcHClvMqcUuy+m7 Xf1IXKdbQEjLOABjeilt2Buy409TMqlRjqE4Ojl+cuxZP/KnawjdelewlOhntaBG6KSH A+tgPfQIfQ2BjoL43joa9pyVo5BlrbBVBftiI5qRl8nkoR0IxrqQCY+05zPAz0aftRLl eZFX3E028Cq1k2hirTaaESqASCN5Hvwe23+ATE09PtwQBNubDgoiiZj922w3eBbQ3xja XwI/we5GtkjqXSWb75AgXnfjCTx4SrTgiG5639gtyK8YQOnuU/vtHZLf0mzt5ZSRbjj2 Hlbg== 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=lqNaNlyCWsqnQiMyNMSmSk9+lyPrlpC34lNClH2VPBk=; b=euxk22xnlAopHS52FGR9pu5q6jb6AOQEZNkZbPNIBK9MX4tA85/rSAO9rABInRLoh9 gaBjqp20W6mrgWqKsjTEN6eLaOzKm3Z97BTMeQmRuS1gKFwDMOWaz3PNbhdbYO5IYhQQ IJMhSQMxmMVIkNSnrv7ghU3b1d921r1Q2ViEJgnYxVW2SgeITLRnjpsP/0DBEH8kfJo9 TJ3I/38WLRClFUJXY13/bfSeWhSEjOb35WZn5K3zbCpN18JuQS6k5eZ4ijvICNymL0SZ Z5yjAWcf3MVeE/h26AqwmAN/BdNGkh/+KTIvWxc9/afnfKXLtjwGAi0rNu94V51O+03S hl5A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=VPgob10u; 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 ga18si8413628ejc.519.2020.11.24.05.10.50; Tue, 24 Nov 2020 05:11:16 -0800 (PST) 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=VPgob10u; 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 S2387802AbgKXNIr (ORCPT + 99 others); Tue, 24 Nov 2020 08:08:47 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58720 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387669AbgKXNIq (ORCPT ); Tue, 24 Nov 2020 08:08:46 -0500 Received: from mail-il1-x143.google.com (mail-il1-x143.google.com [IPv6:2607:f8b0:4864:20::143]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1DC61C0613D6; Tue, 24 Nov 2020 05:08:46 -0800 (PST) Received: by mail-il1-x143.google.com with SMTP id v3so5048393ilo.5; Tue, 24 Nov 2020 05:08:46 -0800 (PST) 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=lqNaNlyCWsqnQiMyNMSmSk9+lyPrlpC34lNClH2VPBk=; b=VPgob10uvPGhhM2Q/eJ5+M+0zDC4wfaaPqDZtGtPtd0sCX53O1aBXy2270lLE8Su5L x2u0axp+y9VoD7brThljKy1XVaFdMPyAV6zl+eJ1IHFPfTM9vIqNGoJMdYrFkHAHqBUz etpK7OeDGn1FYlRxDsAS5HVzxOR9HqqJ/JH4Eh0iK8EnyO5z7ygHDRf62HIOBs/k4A/4 QrpcJ6wXcvSWFcC/CAzfEqRFN8dVI3yw48Zgv3C+NXstnHgWMZ6lnXSiYbUuqhjoGeZw EzmfW78Hd84kexi4oaDm/PvuuvrTqnPBeQGeJYpMmc4dqk4rF4voc3ZbhPuxRWc9a2rn GfGQ== 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=lqNaNlyCWsqnQiMyNMSmSk9+lyPrlpC34lNClH2VPBk=; b=ZmlIO8MFRUOiX0W2M5zJsCIllIlNuxhJspSD0cyDJnruSX/hMDUtFMSlXI17Rb6AT/ j/CPzLB2V5K36Dxkq8xW49UNBEVza9VJyykAXoSVFu8MvWLFrZe6G4+c+WWvQEVI4chL nGeqIfuTf7bDxHp0y+OZeo70cgvanVm3CFsh3uPIMcIvP1Mrbi3ONe5L1/SSU18tZkZr 4dBblAABHHPAo38Bc7RzPaIFclYN4sJgMtnU316vxieutyVK8FZ4xW0G13p5pQW7+Qhi dUJ4aREHB2lf/ARrIF0Yl/TvxlpyYoSkqOkVHb/x6tNfG+Z3XvQa36bbWvfw0xdObxz9 7tVw== X-Gm-Message-State: AOAM533b7is7N1k8NqBpudYxwc8dq5Si1cTFWflpNKKf7YezRE7EAaJV AgN4vNXrwmZDVqNjes4a9wHTuD/gXoqW9WpE0dDEcV/UAeY= X-Received: by 2002:a92:ae10:: with SMTP id s16mr4190848ilh.142.1606223325423; Tue, 24 Nov 2020 05:08:45 -0800 (PST) MIME-Version: 1.0 References: <20201123125808.50896-1-laoar.shao@gmail.com> <20201123125808.50896-4-laoar.shao@gmail.com> <20201124114042.GJ3306@suse.de> In-Reply-To: <20201124114042.GJ3306@suse.de> From: Yafang Shao Date: Tue, 24 Nov 2020 21:08:09 +0800 Message-ID: Subject: Re: [RFC PATCH v2 3/5] sched: make schedstats helper independent of cfs_rq To: Mel Gorman Cc: Ingo Molnar , Peter Zijlstra , Juri Lelli , Vincent Guittot , Dietmar Eggemann , Steven Rostedt , Benjamin Segall , bristot@redhat.com, LKML , linux-rt-users@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Nov 24, 2020 at 7:40 PM Mel Gorman wrote: > > On Mon, Nov 23, 2020 at 08:58:06PM +0800, Yafang Shao wrote: > > The 'cfs_rq' in these helpers > > update_stats_{wait_start, wait_end, enqueue_sleeper} is only used to get > > the rq_clock, so we can pass the rq directly. Then these helpers can be > > used by all sched class after being moved into stats.h. > > > > After that change, the size of vmlinux is increased around 824Bytes. > > w/o this patch, with this patch > > Size of vmlinux: 78443832 78444656 > > > > Signed-off-by: Yafang Shao > > The inline helpers are quite large. When I was suggesting that the overhead > was minimal, what I expected what that the inline functions would be a > schedstat_enabled() followed by a real function call. It would introduce > a small additional overhead when schedstats are enabled but avoid vmlinux > growing too large > > e.g. > > static inline void > update_stats_wait_start(struct cfs_rq *cfs_rq, struct sched_entity *se) > { > if (!schedstat_enabled()) > return; > > __update_stats_wait_start(cfs_rq, se); > } > > where __update_stats_wait_start then lives in kernel/sched/stats.c > Good idea! Now I understand what you mean. Thanks for the detailed explanation. I will update it in the next version. -- Thanks Yafang