Received: by 10.223.176.5 with SMTP id f5csp1067936wra; Fri, 2 Feb 2018 10:36:37 -0800 (PST) X-Google-Smtp-Source: AH8x22669iKMWKLR7NWHUpg4lvDGdUCt2JGz4F81ao1gZZj64PMNjJoieu7dMsnc4TpMyTuD5Atv X-Received: by 2002:a17:902:7e85:: with SMTP id c5-v6mr19179725plm.110.1517596596947; Fri, 02 Feb 2018 10:36:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517596596; cv=none; d=google.com; s=arc-20160816; b=E22rg8Iz7qo0MF9FztWi4gc2MWvh8BtFzRuXsxKFq/d3rnGilhsvWDf2D4dV8x1yZH UgbO7QOT5ul2ABB2XSqMPAo6vIosr2uGvElrZtHDZ1dlphKUk4S3g7yUJFkNVzndndNj lIxGIz8dNBjU4+IjGwKXWzKIWr1JjoFiPHiIh8VkAPIlvdFGHJXlO5dnQpwiYZEQF6M0 EygFdawGPcIYwuJesQZS/J3R2ULxAS062CmhBEBPyE70BUn89g5uQ13CrNex35j23DgC 32AuLMQHblM4+b2b2oGfWjwHd0VsruGj9fEHPX72lalbVUY8NiX0gLsNP2xWSVrJRYdB qvfQ== 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:references:cc:to:from:subject :dkim-signature:arc-authentication-results; bh=E+mb1jPVgTxaaQl5Fb+/Bzug0mU9y/MExmZSbwC0njI=; b=FyYuRKZApKllLxbjaGfJPfqE13rQa4Rrns8+6kKGGiI0ooQzfLPxDJaQbyf7KH3XPf a0JcQqSMO7sDisIzlSTSrkOZSuj1ZD9YKnymf2XNRCJe6zmoDf37wrxhf0JEm3GvRm3P 5nHtM8XSKWQK9rXsD39XCEOUJoNUkbGJ1i3+sM1bPfZy8fQqkyfDLylNS+UCQAQVG4Mf KvxIbjYuOWzyqbidy2oUWzsFANKRFv6gpds+kxYpDaNYSbTw1ZpzgOcTpOIwae8puvKm d9BLxmVCezb8g1iBBmKD4q4mjpX0w5ArBSJNd12GVY+KcxiNvS907VnJlLekcYaXXTbV wLAw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2017-10-26 header.b=dpFV67QD; 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 v2si1795027pgf.201.2018.02.02.10.36.21; Fri, 02 Feb 2018 10:36:36 -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=dpFV67QD; 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 S1754747AbeBBSf0 (ORCPT + 99 others); Fri, 2 Feb 2018 13:35:26 -0500 Received: from aserp2120.oracle.com ([141.146.126.78]:37270 "EHLO aserp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752210AbeBBSfU (ORCPT ); Fri, 2 Feb 2018 13:35:20 -0500 Received: from pps.filterd (aserp2120.oracle.com [127.0.0.1]) by aserp2120.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w12ITcPB190196; Fri, 2 Feb 2018 18:35:04 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=subject : from : to : cc : references : message-id : date : mime-version : in-reply-to : content-type : content-transfer-encoding; s=corp-2017-10-26; bh=E+mb1jPVgTxaaQl5Fb+/Bzug0mU9y/MExmZSbwC0njI=; b=dpFV67QDU1w+hTbIIkHkIVedBEoJDukynLqTBe88r3M1RphqbHyUm3lNQ4aEor+WltqI cAwBQcQ3+9HpvFJjs07W7F2Whmhnzv41mA2slyaLJMonRu6M4cVAfYmcUuzDLblpjEqA O0yNHaL4fLhT7+tl5vUmRH5FjbN4w0Vdw+a+LsKcNykQ561/oAO5I9Eiyg87vjhJAsvS WcYh4O7oc+/uArMTlevYa02v4SjczBcfg8/OVXyhlXp10a4Ty7lM7UjrJcwzdP2H0ugu 6LlTUoFGOrqCuJbrStZ9A71YNLR8iFRY0IGotLyfUL3fOcRUuUOHtg6V4qaAow+BNB7c jw== Received: from userv0022.oracle.com (userv0022.oracle.com [156.151.31.74]) by aserp2120.oracle.com with ESMTP id 2fvv0p0d7m-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 02 Feb 2018 18:35:04 +0000 Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by userv0022.oracle.com (8.14.4/8.14.4) with ESMTP id w12IZ3EM007155 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 2 Feb 2018 18:35:03 GMT Received: from abhmp0001.oracle.com (abhmp0001.oracle.com [141.146.116.7]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id w12IZ36h000588; Fri, 2 Feb 2018 18:35:03 GMT Received: from [10.39.253.191] (/10.39.253.191) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Fri, 02 Feb 2018 10:35:02 -0800 Subject: Re: [RESEND RFC PATCH V3] sched: Improve scalability of select_idle_sibling using SMT balance From: Steven Sistare 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> <20180202172153.GO2269@hirez.programming.kicks-ass.net> Organization: Oracle Corporation Message-ID: <5b9f0828-8d35-885b-3eba-d31ca46da642@oracle.com> Date: Fri, 2 Feb 2018 13:34:58 -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: 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=884 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1711220000 definitions=main-1802020224 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2/2/2018 12:39 PM, Steven Sistare wrote: > On 2/2/2018 12:21 PM, Peter Zijlstra wrote: >> On Fri, Feb 02, 2018 at 11:53:40AM -0500, Steven Sistare wrote: >>> It might be interesting to add a tunable for the number of random choices to >>> make, and clamp it at the max nr computed from avg_cost in select_idle_cpu. >> >> This needs a fairly complicated PRNG for it would need to visit each >> possible CPU once before looping. A LFSR does that, but requires 2^n-1 >> elements and we have topology masks that don't match that.. The trivial >> example is something with 6 cores. > > Or keep it simple and accept the possibility of choosing the same candidate > more than once. > >>> Or, choose a random starting point and then search for nr sequential >>> candidates; possibly limited by a tunable. >> >> And this is basically what we already do. Except with the task-cpu >> instead of a per-cpu rotor. > > Righto. Disregard this suggestion. Actually, I take back my take back. I suspect the primary benefit of random selection is that it breaks up resonance states where CPUs that are busy tend to stay busy, and CPUs that are idle tend to stay idle, which is reinforced by starting the search at target = last cpu ran. Or, a quantitative argument: if sampling a single random CPU gives better results (and the data says it does), then sampling a random cpu and searching nr from it should give better results, since it has nr - 1 more chances to find an idle CPU. - Steve