Received: by 2002:a05:6602:2086:0:0:0:0 with SMTP id a6csp4425310ioa; Wed, 27 Apr 2022 03:41:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx8sRN4+adchMpo0U9e14ytFQRXH3OSQ5WoAkDY7XNIOs9ZRGixwl/jXWzfCj0gTbgURsVT X-Received: by 2002:a17:902:bf09:b0:153:99a6:55b8 with SMTP id bi9-20020a170902bf0900b0015399a655b8mr27821572plb.142.1651056108029; Wed, 27 Apr 2022 03:41:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651056108; cv=none; d=google.com; s=arc-20160816; b=nzKc2R21VT0zOGzAhSr9250tmdp+GkVwrjmpZPHOo9WzZSak+58G6i5/qZ7y5gr8Az ZbCvmm1N6x8o8eWFiA1YcYpC8nymT4vIEYdzMwI+vQ01a/ovqfK4ZeodTuYRw2nu6auV rbWt91Zqooxb9DhzkZ7Fnf0C6DQYPL9KsXVqLHD/q3cLOFeHlwHQor3BXGcM0fGK3HUD 2RngWyIZG5/C+RDYwv5BDvtXpiSAioNp9Dz2heIgfCpM957PaN0pc0iELyJtbvQ9WyS9 ocl4cFpK6anKLJeVoE1I42EnDoU36JShXKIalaxPUxpPK8uu3MnuscW9SFaj49P2BLfV mjpw== 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=iIs67QnNUNxaSSEjZH8MNbvcuJ7fdQbyxSnWaC1EAwA=; b=wGRRknvxbb/QWyMC/OHsq2Zr2nJvt+uZKtzErWc0o3ynQ/eLnUSTF02LfPatwFoFsE VbDf+j+zUiUyKFOR7ZJ70y0Z2tWRLHQTvzWzdg0mzUdLLgSHq86DdsRIJ2M7N8BZBmjs NoQoJk04GHemp+QcY8NOkLgmDpB502fCGcp7gefO3og4bUtK6sYbJSLikzLAQcrpK9Zu I7d34E1XQwmeNQMwK6DLBQSDV/ObjmoCU1eAhL1dykS72TREOVSrx5Z5No00FRZwGk9i /+QX2JfifPC79KrTZnMrTUKh2FO99rDHGdU0Vt/iTQVRElp7FE9GAY4MFc81bE7fH8Rn tgdQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=EMXbacDF; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id 17-20020a630b11000000b003816043f110si1123841pgl.773.2022.04.27.03.41.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Apr 2022 03:41:48 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=EMXbacDF; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 84FA93E8D68; Wed, 27 Apr 2022 02:51:27 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1357820AbiD0FMA (ORCPT + 99 others); Wed, 27 Apr 2022 01:12:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54752 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1357810AbiD0FL7 (ORCPT ); Wed, 27 Apr 2022 01:11:59 -0400 Received: from mail-pg1-x531.google.com (mail-pg1-x531.google.com [IPv6:2607:f8b0:4864:20::531]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5935D986DA for ; Tue, 26 Apr 2022 22:08:48 -0700 (PDT) Received: by mail-pg1-x531.google.com with SMTP id v10so569100pgl.11 for ; Tue, 26 Apr 2022 22:08:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=iIs67QnNUNxaSSEjZH8MNbvcuJ7fdQbyxSnWaC1EAwA=; b=EMXbacDFYEoeKbtEYuaHWu1PzMxGnjYKjYtKgtv3mNi2ppYS4/qeGGGiy3zPOmgYjB ZYC6jwDIEmpNN2xdQgsl0G9BtZY00K6RZR1Bk4PU1Vt2IxXEOlFQyJc9Ue2T1cf0WUoH BUFpgwcgEMesC0MatONa8YJZtdKXAwCot8fpHvpab2+Lgt6Jw3zbpOdo/F2eIqS+Fycl Zl3nXlnZktIxrrLsgnKu9cZgx+U5ejgVMub/8bMG3ylP8zIcWwao3O7pEWfTGWXK1JZl hvn7ej/edU9tLcY0JoGaOLOAScgMdfcTGOCGIbBQyvpRnybY7VFo5UW279ik8PhbcWWh ZW9g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=iIs67QnNUNxaSSEjZH8MNbvcuJ7fdQbyxSnWaC1EAwA=; b=itxRefwcrTPVFXfkRX/LSmXi3ImtpGtzmErGiO6Qr1cpwfujOVBuAACRr1AkSq9BhM fj93+vZZJxb9YVlG/97oKlo/0CPm2twksqj8OyqDYUiuMZBn9Kz4GfXDp3KYz5FqpVKL ZB+YryUJZ+R7J4bSa7e69MuJQ7dbIDdZK02rVuMyIPWRooywAaRLOw9NNu6gfNZY0x2x sNE3Rp6ut1iZJ+KLyJf23hYcyoJ2S6Dkn0TPV2YtpihuCUAEaYeJ28CXeBM3XIXYOJ+J vRrwUU7ZbTUEtGVd9gG1UbCcvuX3YkMrYkrfKr/2WglbgC3o3uz4aE7gX1jpisstiUBw dHGw== X-Gm-Message-State: AOAM533/wU7lJJOSxfA5GZ/hs8Lfn+p/6wJ9ttRiL0dUV89CjaSPCJT6 1d1tvdZOGrexmj+6SsoZXRorYMCyzCHIh4tL8AyOkg== X-Received: by 2002:a05:6a00:238b:b0:50d:7e99:86d4 with SMTP id f11-20020a056a00238b00b0050d7e9986d4mr2147908pfc.8.1651036127629; Tue, 26 Apr 2022 22:08:47 -0700 (PDT) MIME-Version: 1.0 References: <20220420055807.GA16310@xsang-OptiPlex-9020> <43598597-72e1-6750-9bee-031fd463fc3b@intel.com> In-Reply-To: From: Shakeel Butt Date: Tue, 26 Apr 2022 22:08:36 -0700 Message-ID: Subject: Re: [memcg] a8c49af3be: hackbench.throughput -13.7% regression To: Yosry Ahmed Cc: Yin Fengwei , kernel test robot , Linus Torvalds , Johannes Weiner , Michal Hocko , Muchun Song , Andrew Morton , LKML , lkp@lists.01.org, kernel test robot , Ying , Feng Tang , Xing Zhengjun Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-9.5 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,USER_IN_DEF_DKIM_WL 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 On Tue, Apr 26, 2022 at 9:34 PM Yosry Ahmed wrote: > [...] > > The only seemingly expensive operation in the mod_memcg_state() path > is the call to cgroup_rstat_updated() (through memcg_rstat_updated()). > One idea off the top of my head is to batch calls to > cgroup_rstat_updated(), similar to what 11192d9c124d ("memcg: flush > stats only if updated") did on the flush side. I am interested to see > what memcg maintainers think about this problem (and the proposed > solution). > I am suspecting this is some code alignment changes which is causing this difference. Let's first confirm the issue before thinking about the optimizations.