Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp549045rwl; Wed, 29 Mar 2023 05:42:29 -0700 (PDT) X-Google-Smtp-Source: AKy350bb16GnkxPsrH2zX0MeNuacbkprGFZ/SncszB6ekWVj+847F+ziNUONBf/SaOUX6fwgJjce X-Received: by 2002:a17:906:edc7:b0:921:54da:831c with SMTP id sb7-20020a170906edc700b0092154da831cmr2342311ejb.31.1680093748973; Wed, 29 Mar 2023 05:42:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680093748; cv=none; d=google.com; s=arc-20160816; b=OxIioRoQmHhXwRQnn8XbWU1BagQNH5jX2SUJEKaUDh+HCSP3lpTTC98DbMkEwUtAoR u8MBSj2zry6rGlwjUPCXr1zMleJZ9nXAT+nTDIvLsNV487neYUjMa3oMXxcDlTQuoTB2 S3Y1kLQOBPFHPehMxkxWiLnws8S40l1X7unVYaUxkzYBa5XcNipVIEWQl+uB/NykqYja Sxb++DG14mAVU7Q0uGfFpBNfhmPmYAVE6fcsHpl4I71TJGMwixjNfuAmmqTQCyaGMA7n 1gTvUv9geLQSej3QgJaGcoREPDSF+ed4+IT2gd2+JkPN8itGXCRJOGsZLx8QiNt5ojdn nYoQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=/fyRBH6ylF+gvZG4QuPjwSRfoWGTZCPqkno2tHPCDBo=; b=s95pSbtkwEy0iUv4rwebpyZKIAyAe1Dyxu4RpcM5oNV2PVWKDiEV0eAfFR+RDKOLnt 7coAAQFG1r6B93VDyfCFCiAowO/D/DD0SR2I6noAq9jwhK2x3u7oIjp9sSToqCPIjyI0 N26WwVgbotOaot1DMad+67COWj+pEU2P1DFdh6q0Wc0IkWlJSjmUPutxWZopTCEAeWfA NnnGyG82fUm8luG1TtyzvTlzMS32DZnbQt29lZvHIUyRalTIEplRTSUiOCql8sr6XJxR cj+2cOcNztpm1XaX7OVdFjuyOgEoN635Oh9Py6HqzM6FUDqVrTFGo4xVv71ZFdtn0Z86 LL/Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u19-20020aa7db93000000b004fd1ef9b95csi31334312edt.598.2023.03.29.05.42.04; Wed, 29 Mar 2023 05:42:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229852AbjC2Mgy (ORCPT + 99 others); Wed, 29 Mar 2023 08:36:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46820 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229549AbjC2Mgx (ORCPT ); Wed, 29 Mar 2023 08:36:53 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 432204201 for ; Wed, 29 Mar 2023 05:36:52 -0700 (PDT) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 4045A1FB; Wed, 29 Mar 2023 05:37:36 -0700 (PDT) Received: from [192.168.178.6] (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id BE0543F6C4; Wed, 29 Mar 2023 05:36:49 -0700 (PDT) Message-ID: <76939bf6-1d9d-5f8f-f15c-f03b2322d684@arm.com> Date: Wed, 29 Mar 2023 14:36:44 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.8.0 Subject: Re: [RFC PATCH] sched/fair: Make tg->load_avg per node Content-Language: en-US To: Aaron Lu Cc: Peter Zijlstra , Ingo Molnar , Juri Lelli , Vincent Guittot , Steven Rostedt , Ben Segall , Mel Gorman , Daniel Bristot de Oliveira , Valentin Schneider , Tim Chen , Nitin Tekchandani , Waiman Long , Yu Chen , linux-kernel@vger.kernel.org References: <20230327053955.GA570404@ziqianlu-desk2> <943d44f7-1fa9-8545-dc1d-890e4dd20854@arm.com> <20230328125624.GA6130@ziqianlu-desk2> From: Dietmar Eggemann In-Reply-To: <20230328125624.GA6130@ziqianlu-desk2> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.3 required=5.0 tests=NICE_REPLY_A, RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_NONE autolearn=unavailable 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 28/03/2023 14:56, Aaron Lu wrote: > Hi Dietmar, > > Thanks for taking a look. > > On Tue, Mar 28, 2023 at 02:09:39PM +0200, Dietmar Eggemann wrote: >> On 27/03/2023 07:39, Aaron Lu wrote: [...] > Did you test with a v6.3-rc based kernel? > I encountered another problem on those kernels and had to temporarily use > a v6.2 based kernel, maybe you have to do the same: > https://lore.kernel.org/lkml/20230327080502.GA570847@ziqianlu-desk2/ No, I'm also on v6.2. >> Is your postgres/sysbench running in a cgroup with cpu controller >> attached? Mine isn't. > > Yes, I had postgres and sysbench running in the same cgroup with cpu > controller enabled. docker created the cgroup directory under > /sys/fs/cgroup/system.slice/docker-XXX and cgroup.controllers has cpu > there. I'm running postgresql service directly on the machine. I boot now with 'cgroup_no_v1=all systemd.unified_cgroup_hierarchy=1' so I can add the cpu controller to: system.slice/system-postgresql.slice/postgresql@11-main.service where the 96 postgres threads run and to user.slice/user-1005.slice/session-4.scope where the 96 sysbench threads run. Checked with systemd-cgls and `cat /sys/kernel/debug/sched/debug` that those threads are really running there. Still not seeing `update_load_avg` or `update_cfs_group` in perf report, only some very low values for `update_blocked_averages`. Also added CFS BW throttling to both cgroups. No change. Then I moved session-4.scope's shell into `postgresql@11-main.service` so that `postgres` and `sysbench` threads run in the same cgroup. Didn't change much. >> Maybe I'm doing something else differently? > > Maybe, you didn't mention how you started postgres, if you start it from > the same session as sysbench and if autogroup is enabled, then all those > tasks would be in the same autogroup taskgroup then it should have the > same effect as my setup. This should be now close to my setup running `postgres` and `sysbench` in `postgresql@11-main.service`. > Anyway, you can try the following steps to see if you can reproduce this > problem on your Arm64 server: > > 1 docker pull postgres > 2 sudo docker run --rm --name postgres-instance -e POSTGRES_PASSWORD=mypass -e POSTGRES_USER=sbtest -d postgres -c shared_buffers=80MB -c max_connections=250 > 3 go inside the container > sudo docker exec -it $the_just_started_container_id bash > 4 install sysbench inside container > apt update and apt install sysbench > 5 prepare > root@container:/# sysbench --db-driver=pgsql --pgsql-user=sbtest --pgsql_password=mypass --pgsql-db=sbtest --pgsql-port=5432 --tables=16 --table-size=10000 --threads=224 --time=60 --report-interval=2 /usr/share/sysbench/oltp_read_only.lua prepare > 6 run > root@container:/# sysbench --db-driver=pgsql --pgsql-user=sbtest --pgsql_password=mypass --pgsql-db=sbtest --pgsql-port=5432 --tables=16 --table-size=10000 --threads=224 --time=60 --report-interval=2 /usr/share/sysbench/oltp_read_only.lua run I would have to find time to learn how to set up docker on my machine ... But I use very similar values for the setup and sysbench test. > Note that I used 224 threads where this problem is visible. I also tried > 96 and update_cfs_group() and update_load_avg() cost about 1% cycles then. True, I was hopping to see at least the 1% ;-)