Received: by 10.192.165.148 with SMTP id m20csp5149739imm; Tue, 24 Apr 2018 14:45:24 -0700 (PDT) X-Google-Smtp-Source: AIpwx49PVxxpIsWdA4qPiJxjd5LTbxZph/DxMWmG+ZFHSpTm3baJ4ooWP9+SNUxea/i10nWxvCeB X-Received: by 10.99.126.71 with SMTP id o7mr21299813pgn.366.1524606324637; Tue, 24 Apr 2018 14:45:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524606324; cv=none; d=google.com; s=arc-20160816; b=LODjscl7uoFJ8M8SSCrx8Hli/mytLnaO6GdGDGe+hBMwf4KymJRo1kFuEG97ChT3j7 QQvqNns6qWYaPi7gsmCRU5FIMfPXOIqNLMYzO50ozc66Hl16Wm9OCQ5r0nu9JY84WSOZ OkJVSrdpMrcM+8KZjGqkIsuMtDm+ZtqOId8NyMaQL0w8GjTyADGVgcknXYnfo+SlveQa DHT3dC3LwNzDsREM2ON1bA1tN6URDXfcxEoufYmlfzdXy3dabSq9HGGyNmdcneaqZPmV Ih+HGocmsL3CQpJqgwoxtD/JeRi6Ik/NEg2YTKZ9sDeTSXyGzob9R2h6qEWK7g2LQH2a La9w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature :arc-authentication-results; bh=okrF8G40NHNkSoOHISWpPNTFgVhj8A+fQ2yQqN4v7D4=; b=tvwgKSIwRewOguc6t/pwS9kh0PIhD6a+wsiTJb2MIdpeHRLGCKIgCLqWsfJJpnePCc jy2qz2IZ5mAWLHObGo9eTJ5+JvbrUvfbrA5WTbRDIGFoQofjdr40LcuC4yW15J7ZSdQS fGki1pqQ+ie4ihVD0ZyFs5cmzIO7FFpwQ23faqlBX2ItqEby54oLNjz1bkOyzIEHtUqV hywUwfHQCHIL2JgOp8acB2JJP1+JqXOAbUdjP+mSnr6kpSJs7xvKwJFGX0pPtdpr4Rfx JIU7rIACn80WbbJEqhvG3afezwTb5YZ4XlQENDQBDIH/v1j3LQZCDT9YVTiQvCJgSzHF tGEA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2017-10-26 header.b=i5fYEEY7; 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 g18-v6si14545143plo.586.2018.04.24.14.44.53; Tue, 24 Apr 2018 14:45:24 -0700 (PDT) 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=i5fYEEY7; 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 S1751184AbeDXVn1 (ORCPT + 99 others); Tue, 24 Apr 2018 17:43:27 -0400 Received: from userp2130.oracle.com ([156.151.31.86]:46030 "EHLO userp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750902AbeDXVn0 (ORCPT ); Tue, 24 Apr 2018 17:43:26 -0400 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 w3OLVJos134158; Tue, 24 Apr 2018 21:42:54 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=okrF8G40NHNkSoOHISWpPNTFgVhj8A+fQ2yQqN4v7D4=; b=i5fYEEY7hZb8AofZAqlB+DRGD3lSbtI0eEDeeqHe5YjyAqLXHA+w1D/dNU8XfD0L9Mft a50ilNxAcyQMt6m525pd71e/+J1FSiXGJB7Z2TVDXN6qPdP9zed3sahvkUvWNO59lgqD U7gZCfZ6mw8xkA69LqNTjN/V2UMOpLEr6lDL+ZWZZbQtt1XjZXo/QuE6mkNUg5cE8KZN EjrKdPu4r2YiQ08TFMe6wZKuQsvtZz1HrYISeS/8t5Kbc421v+O+4zCd+oijQMkBImeM mjoLHiP81+3E8S5Tq3memGlvQHAe6O219G7wiBX3fFgVhZ5Coqj8WW7KA20qUpD4K0kg 5g== Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by userp2130.oracle.com with ESMTP id 2hfvrbv6f0-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 24 Apr 2018 21:42:54 +0000 Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by aserv0021.oracle.com (8.14.4/8.14.4) with ESMTP id w3OLgrpi000420 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 24 Apr 2018 21:42:53 GMT Received: from abhmp0015.oracle.com (abhmp0015.oracle.com [141.146.116.21]) by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id w3OLgrIT009264; Tue, 24 Apr 2018 21:42:53 GMT Received: from [10.132.91.87] (/10.132.91.87) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 24 Apr 2018 14:42:53 -0700 Subject: Re: [PATCH 1/3] sched: remove select_idle_core() for scalability To: Peter Zijlstra Cc: linux-kernel@vger.kernel.org, mingo@redhat.com, daniel.lezcano@linaro.org, steven.sistare@oracle.com, dhaval.giani@oracle.com, rohit.k.jain@oracle.com References: <20180424004116.28151-1-subhra.mazumdar@oracle.com> <20180424004116.28151-2-subhra.mazumdar@oracle.com> <20180424124621.GQ4082@hirez.programming.kicks-ass.net> From: Subhra Mazumdar Message-ID: Date: Tue, 24 Apr 2018 14:45:50 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <20180424124621.GQ4082@hirez.programming.kicks-ass.net> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8873 signatures=668698 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-1804240204 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 04/24/2018 05:46 AM, Peter Zijlstra wrote: > On Mon, Apr 23, 2018 at 05:41:14PM -0700, subhra mazumdar wrote: >> select_idle_core() can potentially search all cpus to find the fully idle >> core even if there is one such core. Removing this is necessary to achieve >> scalability in the fast path. > So this removes the whole core awareness from the wakeup path; this > needs far more justification. > > In general running on pure cores is much faster than running on threads. > If you plot performance numbers there's almost always a fairly > significant drop in slope at the moment when we run out of cores and > start using threads. The only justification I have is the benchmarks I ran all most all improved, most importantly our internal Oracle DB tests which we care about a lot. So what you said makes sense in theory but is not borne out by real world results. This indicates that threads of these benchmarks care more about running immediately on any idle cpu rather than spending time to find fully idle core to run on. > Also, depending on cpu enumeration, your next patch might not even leave > the core scanning for idle CPUs. > > Now, typically on Intel systems, we first enumerate cores and then > siblings, but I've seen Intel systems that don't do this and enumerate > all threads together. Also other architectures are known to iterate full > cores together, both s390 and Power for example do this. > > So by only doing a linear scan on CPU number you will actually fill > cores instead of equally spreading across cores. Worse still, by > limiting the scan to _4_ you only barely even get onto a next core for > SMT4 hardware, never mind SMT8. Again this doesn't matter for the benchmarks I ran. Most are happy to make the tradeoff on x86 (SMT2). Limiting the scan is mitigated by the fact that the scan window is rotated over all cpus, so idle cpus will be found soon. There is also stealing by idle cpus. Also this was an RFT so I request this to be tested on other architectrues like SMT4/SMT8. > > So while I'm not adverse to limiting the empty core search; I do feel it > is important to have. Overloading cores when you don't have to is not > good. Can we have a config or a way for enabling/disabling select_idle_core?