Received: by 2002:a05:7208:9594:b0:7e:5202:c8b4 with SMTP id gs20csp2388305rbb; Tue, 27 Feb 2024 23:20:02 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUQ3NA30ZmKQ9lAcchEUiVrbikcKQBBu9EP62QtztoNeB4dVjo2xSNhXe7uYmKqiuO9YeIGAn08/O3NH+GbNZPuAN+ILWLpQiShq94xgQ== X-Google-Smtp-Source: AGHT+IHNpYpeqq1yDgVxep5rXtAcHehhL7dSPiY2+ldpCu6GrdyQWoc0KywESF+PvxXzFpHiMGN6 X-Received: by 2002:a05:6a21:9103:b0:1a1:1e94:dd40 with SMTP id tn3-20020a056a21910300b001a11e94dd40mr302717pzb.54.1709104801856; Tue, 27 Feb 2024 23:20:01 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709104801; cv=pass; d=google.com; s=arc-20160816; b=Hn25f/bQfklHo7E4NdLH7RLf8Ewmcu4hZo7ltHqCU/NHH9LfJAEQNlt86k0tjtipJb opeBzarHl3O3Am2cmnN+ZNc0i/X/wrjJLLEOMe5BAPb8RLmmw9LdEdvXWb7NWpjCu/kn ++1R8ZlOqf8bju4LFzLuOQeqid4PXvOMQbmU0yC0i+nIhouzJX3xh0y8+PpwMlpi/tFU yEjYl1A67YVZ1eD+lV+VFYwD1BvRIE8Lry662x7V2CkikVYJR0DPRyBIp6IysCFgHB8E ai17DKLBvUOZJAPgEg1BbWOLUXGLpirXGbuHQB4/HKOKJwSkKmARCGokSXLRNv6YLZJF CkYg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :content-transfer-encoding:message-id:date:subject:cc:to:from :dkim-signature; bh=ESc/2UapGLAFyJdv6XmJP07aYzuxSsXRZE6wYiiGx6I=; fh=7NjeZ8ZmsvURI3QuLAnfz40XZBWrCCclaNdn06VPdo8=; b=oXwKsv3mwQ+H0OZyiU9GFAQj+PHcJtNapBPS4dl/r0Ohb97vbC6mYdCva0SP23Oag0 DdX0ae5tw8Ebuvp6CGxylqnRJjahPgj/Lg8iQ34QJDZSWqHPAaOQ4EuKZraWzDdZt3Ry 1hW++6BgbT6AIO/QbGxJSCez9988pBkI8mziaBL8wiZQInMSywKn7nbsigAFKVioNIuM An2w50ZIPuq6FAo8mm4Ru1kjmWqdgAZjlppR/Cy1UIGzAE0RvTlmfZcJhBZqJNNx3TaM mAW7CKcX/bBPbyl24i9tAVku4zPu8H5+QgUfqbvr4WzR8kAqipQTGuh/ftOiCPoybhpC I9bw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=RHl7JPFa; arc=pass (i=1 spf=pass spfdomain=linux.ibm.com dkim=pass dkdomain=ibm.com dmarc=pass fromdomain=linux.ibm.com); spf=pass (google.com: domain of linux-kernel+bounces-84593-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-84593-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id o13-20020a63e34d000000b005ca5b61ca33si6964596pgj.224.2024.02.27.23.20.01 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Feb 2024 23:20:01 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-84593-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=RHl7JPFa; arc=pass (i=1 spf=pass spfdomain=linux.ibm.com dkim=pass dkdomain=ibm.com dmarc=pass fromdomain=linux.ibm.com); spf=pass (google.com: domain of linux-kernel+bounces-84593-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-84593-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=NONE dis=NONE) header.from=ibm.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 5EF73B25F27 for ; Wed, 28 Feb 2024 07:16:58 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D3D0F2421C; Wed, 28 Feb 2024 07:16:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ibm.com header.i=@ibm.com header.b="RHl7JPFa" Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 90BBA23766 for ; Wed, 28 Feb 2024 07:16:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.163.156.1 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709104610; cv=none; b=jEB6hJCiZzhm7f3SsMZzy93blyiW6dSbKJC49qDHV613ySqHXf11HoCh3MeTlicVXmNmgFoGyJ8vbKQRNH2koXySuh1kiEwtKPqZjg6velHEj4fDd7hc9BkHMfiTPDFGbu2o7L/UWgMcVaMBFB0R4UGsodWLJUb3HQAG1476fcI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709104610; c=relaxed/simple; bh=TGKY1pUMR4qMNKwwM9TvhqXUeW4kz8QoOFAk6Q+0K1w=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=nAoSqQdrrHu6VKPzTdsyzaP6I8W1Y5Kj2/7zbpTND8Ge8r41kN/mBZkssinIEYmCp3HIDR6fKbl1/cnWGPkDo+t3o8wbbqrIJ/11YEw6L9MyV96aFTZWnuZFYGDwi5Mb7Hn6O+AoYQt54Xgz4BSZtp9O/cEk3ZOrDgfTeFdJLTc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.ibm.com; spf=pass smtp.mailfrom=linux.ibm.com; dkim=pass (2048-bit key) header.d=ibm.com header.i=@ibm.com header.b=RHl7JPFa; arc=none smtp.client-ip=148.163.156.1 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.ibm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.ibm.com Received: from pps.filterd (m0360083.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 41S7CFtb013248; Wed, 28 Feb 2024 07:16:37 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : date : message-id : content-transfer-encoding : mime-version; s=pp1; bh=ESc/2UapGLAFyJdv6XmJP07aYzuxSsXRZE6wYiiGx6I=; b=RHl7JPFajtMXYLG4TH3BS8a7oudzg1mkZ/xF/Q/EA6P7EUmgefxXEPjUnpTq7m9QUT7k 3JzPraZ3YvPPtwJdIkVjgfV2s/Tc+TgzDPPCxD1a/MFD8c46jG1U1dbvzVIn3F2UMhOs a3q3kFkfju20RtjaTXUQkzDZOXUkEn4engL+c4GbFJCwDb4nFqjINZpvyFDEO4u+jNTr ASjmNeTHTcnbwJ2Sh8x2eZ7+QeBK86RSH+9xKag4fP17pekBcdIoeynxgd3CxFGKsZwn E8DxzD3xEdtniCQ49aCkYn+jkNev2tvpriTcJyfpPJlhDlRy/rikv796LzKQiZtCuCWk eg== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3wj07w8364-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 28 Feb 2024 07:16:36 +0000 Received: from m0360083.ppops.net (m0360083.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 41S7Do0Q018648; Wed, 28 Feb 2024 07:16:36 GMT Received: from ppma12.dal12v.mail.ibm.com (dc.9e.1632.ip4.static.sl-reverse.com [50.22.158.220]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3wj07w835m-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 28 Feb 2024 07:16:36 +0000 Received: from pps.filterd (ppma12.dal12v.mail.ibm.com [127.0.0.1]) by ppma12.dal12v.mail.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 41S70tT5008792; Wed, 28 Feb 2024 07:16:35 GMT Received: from smtprelay01.fra02v.mail.ibm.com ([9.218.2.227]) by ppma12.dal12v.mail.ibm.com (PPS) with ESMTPS id 3wftstn2te-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 28 Feb 2024 07:16:35 +0000 Received: from smtpav07.fra02v.mail.ibm.com (smtpav07.fra02v.mail.ibm.com [10.20.54.106]) by smtprelay01.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 41S7GToZ19595822 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 28 Feb 2024 07:16:31 GMT Received: from smtpav07.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id A967720043; Wed, 28 Feb 2024 07:16:29 +0000 (GMT) Received: from smtpav07.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 4570E20040; Wed, 28 Feb 2024 07:16:26 +0000 (GMT) Received: from li-c1fdab4c-355a-11b2-a85c-ef242fe9efb4.ibm.com.com (unknown [9.43.91.1]) by smtpav07.fra02v.mail.ibm.com (Postfix) with ESMTP; Wed, 28 Feb 2024 07:16:26 +0000 (GMT) From: Shrikanth Hegde To: mingo@kernel.org, peterz@infradead.org, vincent.guittot@linaro.org Cc: sshegde@linux.ibm.com, yu.c.chen@intel.com, dietmar.eggemann@arm.com, linux-kernel@vger.kernel.org, nysal@linux.ibm.com, aboorvad@linux.ibm.com, srikar@linux.vnet.ibm.com, vschneid@redhat.com, pierre.gondois@arm.com, morten.rasmussen@arm.com, qyousef@layalina.io Subject: [PATCH v2 0/2] sched/fair: Limit access to overutilized Date: Wed, 28 Feb 2024 12:46:19 +0530 Message-Id: <20240228071621.602596-1-sshegde@linux.ibm.com> X-Mailer: git-send-email 2.39.3 X-TM-AS-GCONF: 00 X-Proofpoint-GUID: zMZj_7xZNGonnSimPOyBaQs2MZ6uzDRo X-Proofpoint-ORIG-GUID: v2g_uEG-LdvwpVy3Q8jEQ3CRoAbOOIc8 Content-Transfer-Encoding: 8bit X-Proofpoint-UnRewURL: 0 URL was un-rewritten Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-02-28_04,2024-02-27_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 impostorscore=0 mlxlogscore=999 priorityscore=1501 lowpriorityscore=0 malwarescore=0 spamscore=0 mlxscore=0 clxscore=1015 adultscore=0 bulkscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311290000 definitions=main-2402280056 When running a ISV workload on a large system (240 Cores, SMT8), it was observed from perf profile that newidle_balance and enqueue_task_fair were consuming more cycles. Perf annotate showed that most of the time was spent on accessing overutilized field of root domain. Aboorva was able to simulate similar perf profile by making some changes to stress-ng --wait. Both newidle_balance and enqueue_task_fair consume close to 5-7%. Perf annotate shows that most of the cycles are spent in accessing rd,rd->overutilized field. Overutilized was added for EAS(Energy aware scheduler) to choose either EAS aware load balancing or regular load balance. As checked, on x86 and powerpc both overload and overutilized share the same cacheline in rd. Updating overutilized is not required for non-EAS platforms. Patch 1/2 is the main patch. It helps in reducing the above said issue. Both the functions don't show up in the profile. With patch comparison is in changelog. With the patch stated problem in the ISV workload also got solved and throughput has improved. Patch 2/2 is only code refactoring to use the helper function instead of direct access of the field, so one would come to know that it is accessed only in EAS. This depends on 1/2 to be applied first Thanks to Aboorva Devarajan and Nysal Jan K A for helping in recreating, debugging this issue and verifying the patch. Detailed perf annotate can be found in cover letter of v1. v2 -> v1: Chen Yu pointed out minor issue in code. corrected that code and updated the changelog. v1: https://lore.kernel.org/lkml/20240223150707.410417-1-sshegde@linux.ibm.com/ Shrikanth Hegde (2): sched/fair: Add EAS checks before updating overutilized sched/fair: Use helper function to access rd->overutilized kernel/sched/fair.c | 49 +++++++++++++++++++++++++++++++++------------ 1 file changed, 36 insertions(+), 13 deletions(-) -- 2.39.3