Received: by 10.223.176.5 with SMTP id f5csp1222100wra; Fri, 2 Feb 2018 13:25:16 -0800 (PST) X-Google-Smtp-Source: AH8x225gQ/xj+a+WsEzJNbVtdtMqbxlnM3zxfnj6rGJkwWAW8MwG0gbiTlpsPFaW40U1oDZlRS2K X-Received: by 2002:a17:902:9898:: with SMTP id s24-v6mr12881985plp.275.1517606716464; Fri, 02 Feb 2018 13:25:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517606716; cv=none; d=google.com; s=arc-20160816; b=cRF7cEDQmebv9VA7sycKRY2qfcU0kexSaHENJT9/LW+1nw8I6ir2o4HvG4z2h5PaQL 8yTixGY5QyJXLMJVv4a5QcVyTIOInx51jmQnXVseffLO/QAKfPegqx98QNxka+tiErDr dl/SlrvxaorOIgOSmhAhBJWGuWIQdy0VCsAR8KT9+tCZgi7Wv3H3wVm6VcPoW/OT123c jZc+qSPyIl1MbbXTrIxg2LR1na7+BYjXJOcdo8ddkSzJfSaHUWITODJiuONXOxIDc2u7 gMGkVJ3p84oJgfi98VG/rhMATxCZiGxUnWjWPI51o+myGaY0AxtDOG6yUyBSvFZoxy8r bPJw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:organization:from:references:cc:to:subject :dkim-signature:arc-authentication-results; bh=AYhm2Ku4+R5rQ+IZ8RTEKrQtNufdEmeFqmOhI+kN+qo=; b=kyhBPbBjYEnflFmgBFRZPLBcXPaDAQFlQ+ZWBNPiOwH3OPUidCmkzRnKVMA02sYTiJ v5q5ObvWAkdOoSk0prFDRopZbJKBqbcP3sw91KAm26YHYT5uV829/tF46N+IvMSQmebi ONEI2sC3WmC/omPlOpV5nSYPSg8tJnXHuyFPKwxRCgDAGngJrjLTIv2ZoG3681NPaPU4 eTQmYkRKCM7hOdAGbNmXncqj9ZjeLi+KrK9xzr+nR5CgxDviny5M8WLZIAIprjnjcaUF FPAr0Fp2/fQ9bDjEVE8Ykz7YGeKhMTgOttNJaTHc0g0Fw6NAchy2CoNI2tIrW4bfxcw5 Czdg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2017-10-26 header.b=SS11dbzW; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m39-v6si2422825plg.372.2018.02.02.13.25.01; Fri, 02 Feb 2018 13:25:16 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2017-10-26 header.b=SS11dbzW; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752847AbeBBVHB (ORCPT + 99 others); Fri, 2 Feb 2018 16:07:01 -0500 Received: from userp2130.oracle.com ([156.151.31.86]:37092 "EHLO userp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751878AbeBBVGz (ORCPT ); Fri, 2 Feb 2018 16:06:55 -0500 Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w12L27IS133984; Fri, 2 Feb 2018 21:06:38 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=subject : to : cc : references : from : message-id : date : mime-version : in-reply-to : content-type : content-transfer-encoding; s=corp-2017-10-26; bh=AYhm2Ku4+R5rQ+IZ8RTEKrQtNufdEmeFqmOhI+kN+qo=; b=SS11dbzWvpyRnl0yKCVf5sC8MxicLnUgsUQM4dIXJp0y1OWDg9dEAHWu7E5SpRVZGKhh yLF10FKpcUdIHKCsUfaADdKqzw3HkPruDRdgehg4q8ROWwcdOBRwsGIN579pWTGKj7HJ 2AamUMGRm0sU29dd4Qxk1GEmWi1Db3h7f0xPTRcASL61Q+mbNniqfBNpQIeF6vfSNtVW rI1LhmIltzt5mpSaip6e8t8geXKE+AQ084VcjtBMe5fDIKqvGFKEFouswGX1IuxmeMXb 4eaViahEBxCnGq0o30flcG+7potmUNWBMlja6pBns/AQD5bijr77GFskl322DsWcE2ah uA== Received: from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71]) by userp2130.oracle.com with ESMTP id 2fvxstg6db-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 02 Feb 2018 21:06:38 +0000 Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by userv0021.oracle.com (8.14.4/8.14.4) with ESMTP id w12L6bN8012678 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 2 Feb 2018 21:06:38 GMT Received: from abhmp0014.oracle.com (abhmp0014.oracle.com [141.146.116.20]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id w12L6bFI028419; Fri, 2 Feb 2018 21:06:37 GMT Received: from [10.39.253.191] (/10.39.253.191) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Fri, 02 Feb 2018 13:06:37 -0800 Subject: Re: [RESEND RFC PATCH V3] sched: Improve scalability of select_idle_sibling using SMT balance To: Peter Zijlstra Cc: subhra mazumdar , linux-kernel@vger.kernel.org, mingo@redhat.com, dhaval.giani@oracle.com References: <20180129233102.19018-1-subhra.mazumdar@oracle.com> <20180201123335.GV2249@hirez.programming.kicks-ass.net> <911d42cf-54c7-4776-c13e-7c11f8ebfd31@oracle.com> <20180202195943.GR2269@hirez.programming.kicks-ass.net> From: Steven Sistare Organization: Oracle Corporation Message-ID: <25d67bd2-cbe7-2c2a-e89a-13a7ca5adc10@oracle.com> Date: Fri, 2 Feb 2018 16:06:32 -0500 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 MIME-Version: 1.0 In-Reply-To: <20180202195943.GR2269@hirez.programming.kicks-ass.net> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8793 signatures=668661 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1711220000 definitions=main-1802020253 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2/2/2018 2:59 PM, Peter Zijlstra wrote: > On Fri, Feb 02, 2018 at 11:53:40AM -0500, Steven Sistare wrote: >> On 2/1/2018 7:33 AM, Peter Zijlstra wrote: >>> On Mon, Jan 29, 2018 at 03:31:02PM -0800, subhra mazumdar wrote: >>>> + rcu_read_lock(); >>>> + sd = rcu_dereference(per_cpu(sd_llc, this_cpu)); >>>> + if (util) { >>>> + for_each_lower_domain(sd) { >>>> + if (sd->level == 0) >>>> + break; >>> >>> afaict you really only need this for the core, and here you're assuming >>> everything below the LLC is cores. Would it not be much clearer if you >>> introduce sd_core. >>> >>> As is, for_each_lower_domain includes the starting domain, sd->group >>> then is the first core group for this cpu. But then you continue to the >>> smt domain (on Intel, on other architectures there could be a cluster >>> domain in between) and then you bail using that sd->level == 0 hack >>> because otherwise things would go *bang*. >> >> Hi Peter, >> >> The code here and in smt_balance intentionally visits each level between >> the llc and smt, including core-cluster on architectures that define it. >> smt_balance thus has the chance to randomly pick a better cluster, >> and then within that cluster randomly pick a better core. It makes sense, >> as resources are shared within a cluster, and choosing a less loaded cluster >> should give better performance. As you suggest in a few other places, >> it would be nice to see performance results for this case. We have >> SPARC processors with core clusters. >> > > But then you get that atomic crud to contend on the cluster level, which > is even worse than it contending on the core level. True, but it can still be a net win if we make better scheduling decisions. A saving grace is that the atomic counter is only updated if the cpu makes a transition from idle to busy or vice versa. We need data for this type of system, showing improvements for normal workloads, and showing little downside for a high context switch rate torture test. - Steve