Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3476739pxf; Mon, 22 Mar 2021 07:21:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzJbNEGbCuKnGKlC+mi+NM83j+ETVwNwSgthjLQhNbuoEdCRum7KlC6EPS4wq0agAWm1NAz X-Received: by 2002:a05:6402:2058:: with SMTP id bc24mr26287079edb.243.1616422874549; Mon, 22 Mar 2021 07:21:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616422874; cv=none; d=google.com; s=arc-20160816; b=uCVAmI+sbCBJBbXE2L5ncNygLPIg74L6y1+N9fUMRKxJ2p3eWtqMvu3fNgNRV3goj7 1hkDhU/o12Lr9UGbA5CH3C5dY95S7XVhQ2mYSrjys9RAMFgA6H+HkJ8ZtleokHeGzqMo 2+UXch3Wt2s93OQw9AKvYha3Qi8CNed5DnwFJ27IwO5fX8d1EI3t9TcRb2HQO6eSqnne XRbsmu6gbzs7URI5ywIFAI3tcyZ8PlMh27HRGnXGl29sHrOw1CeYy4lwEshB1gCWKqbx AhBiNtJc/9kTU+z7TPvdMj+wEKCOX7L5C3HkHEcNTb+UGHvBBokAgBmK57FVyKtaZZx5 1MQg== 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:dkim-signature; bh=QYPaK4eZuqY538ZO9STyQwPazRVmaZseW38pdKvXyOA=; b=qC3BeV97oOB6RtTYnWjRwRuSEoMd0T2qvq2iPZJ+xtxBAqS3d6WDy+dPOFZKK6llsK eBGDyx2wmas0JnvWs6B0qwH1xWD/vPkpFse8RvfyOF2KxRp2mt/CK9Ap7oXnMgvhDN47 ho6EbTlH/aQ1GkrIXEH2XOWs9jLa41MCcJ/DusV/lw5I1sr91L2G52tDXdpATw6gDQ0I bdyKiVcywYzk3Eb/ImMzj8+w6U1n/pXU4laD6G9JqW1WuMuVRiEdVutted1jZgM1tJ1m iaJ5ZEXF/s+LbUxkVqOrEXYF+5iuOE8ISVTwsoMW/yXwCX/QgIvYYSLH3jWuqk3XJAwj sj6Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cmpxchg-org.20150623.gappssmtp.com header.s=20150623 header.b=0KkOSF++; 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=fail (p=NONE sp=NONE dis=NONE) header.from=cmpxchg.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c12si11265021edv.455.2021.03.22.07.20.51; Mon, 22 Mar 2021 07:21:14 -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=@cmpxchg-org.20150623.gappssmtp.com header.s=20150623 header.b=0KkOSF++; 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=fail (p=NONE sp=NONE dis=NONE) header.from=cmpxchg.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230131AbhCVOT5 (ORCPT + 99 others); Mon, 22 Mar 2021 10:19:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47272 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229840AbhCVOT2 (ORCPT ); Mon, 22 Mar 2021 10:19:28 -0400 Received: from mail-qv1-xf35.google.com (mail-qv1-xf35.google.com [IPv6:2607:f8b0:4864:20::f35]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 73B0EC061574 for ; Mon, 22 Mar 2021 07:19:26 -0700 (PDT) Received: by mail-qv1-xf35.google.com with SMTP id g8so8698931qvx.1 for ; Mon, 22 Mar 2021 07:19:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cmpxchg-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=QYPaK4eZuqY538ZO9STyQwPazRVmaZseW38pdKvXyOA=; b=0KkOSF++n2pYIA/LC3rHcyiX9uFPtTQUgOjlG8xt4w6Wx+UbWIQgbiI7WrISxv2Zm9 bqABzjEQ6BS8xhIbRLFZLWV8naUFFXeX1IrSq7k6GjSFDoa3t6x9T6Jsw10ijrAys4lH 0HSz36XyHZ6nRtximp4rhyaYg+ogWFUzVuUgJUu23XStQH0Z1igoGyO8ljg2GdOck82k 4qSJJpR/8zUb/au34CZZiydjQTIHedeLi7UIdgaOOglsoMG+OqOFCfR9PXn6AMFJCYvv YRFXcGhXgvjAnTfM/mGVPy5aJtFk24XsDjKdepztg/xuc5zrFSRKf5zqK/fTTb2+A22/ hJng== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=QYPaK4eZuqY538ZO9STyQwPazRVmaZseW38pdKvXyOA=; b=qhRrwdVhE/x2Lmn6AIIzUXKp5COTa88MB8++2h5Qr1IgHSX8EKrzrcqpfJHLR5UwdP in1Vxojl+r+ETMv0NKGeCprsPySainyTH9isAn5u0Jdui47Ie05B6xsSyUw8aoQh816a aYel1lV7YgN/BX+tevP9XeFRHDgQdTspZajf+hkN5pxU4Ky8LZPfMCdNwSfSb5PiOwVE L7jKuPnL/7kVDcvWjUb4NT/rLPjRgmRV60uW+y8+0zz5/Dc68lw35AXDZ6xVlY8evZ2F F0zrGhHqT9+ptIzPY/xXlgBhcD5465YXPQlXQrEoZE3b7qAe75CZmn+ts1g28Ga8TeT7 AK6Q== X-Gm-Message-State: AOAM533ejdhdcBF/+kVuQmSeHfmoG+iCs0yM6hY5uIZ3zNfL/wemK4by MqX+MtVHqJhyYz3U9Ry8f+rgOw== X-Received: by 2002:ad4:55ef:: with SMTP id bu15mr21373854qvb.46.1616422765771; Mon, 22 Mar 2021 07:19:25 -0700 (PDT) Received: from localhost ([2620:10d:c091:480::1:b54e]) by smtp.gmail.com with ESMTPSA id l4sm9070555qte.64.2021.03.22.07.19.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Mar 2021 07:19:25 -0700 (PDT) Date: Mon, 22 Mar 2021 10:19:22 -0400 From: Johannes Weiner To: Shakeel Butt Cc: Peter Zijlstra , Ingo Molnar , linux-kernel@vger.kernel.org Subject: Re: [PATCH] psi: reduce calls to sched_clock() in psi Message-ID: References: <20210321205156.4186483-1-shakeelb@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210321205156.4186483-1-shakeelb@google.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Mar 21, 2021 at 01:51:56PM -0700, Shakeel Butt wrote: > We noticed that the cost of psi increases with the increase in the > levels of the cgroups. Particularly the cost of cpu_clock() sticks out > as the kernel calls it multiple times as it traverses up the cgroup > tree. This patch reduces the calls to cpu_clock(). > > Performed perf bench on Intel Broadwell with 3 levels of cgroup. > > Before the patch: > > $ perf bench sched all > # Running sched/messaging benchmark... > # 20 sender and receiver processes per group > # 10 groups == 400 processes run > > Total time: 0.747 [sec] > > # Running sched/pipe benchmark... > # Executed 1000000 pipe operations between two processes > > Total time: 3.516 [sec] > > 3.516689 usecs/op > 284358 ops/sec > > After the patch: > > $ perf bench sched all > # Running sched/messaging benchmark... > # 20 sender and receiver processes per group > # 10 groups == 400 processes run > > Total time: 0.640 [sec] > > # Running sched/pipe benchmark... > # Executed 1000000 pipe operations between two processes > > Total time: 3.329 [sec] > > 3.329820 usecs/op > 300316 ops/sec > > Signed-off-by: Shakeel Butt Acked-by: Johannes Weiner