Received: by 2002:ac0:98c7:0:0:0:0:0 with SMTP id g7-v6csp3987983imd; Mon, 29 Oct 2018 15:54:44 -0700 (PDT) X-Google-Smtp-Source: AJdET5eHeznKZC2P22t+tCseYWn18stZLxoTdjH+SXoeBBYMD5YUro4PDMumMeKlWzX9zv5rsRpL X-Received: by 2002:a63:9a09:: with SMTP id o9mr13984878pge.94.1540853683976; Mon, 29 Oct 2018 15:54:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540853683; cv=none; d=google.com; s=arc-20160816; b=FpR6MN0tNhtbkZvvGrkuSMMFUKzMVJ8A8ImslZFqQ+BnsStD5gjQ+zU5za7+RTmgUI 5EbSrOsuM922rhHXLsPBiVs8D/+EcF3IFMB+TR0o9Z9rmlpJKYCs7Pm+x8XS7HvoLDj8 QZsq9mb7FGuKGsLEdQ1giS2M/CdG+UPK/LuM809jfnRE9nsRBJlhUeR2EDe1kGGqyAeg 3UTNWLL+Fr+krol+9mxZ+W7biQvgRnbBHSC/xxuLRpMo9+EPJ1P+us8nTeh+fV3j6FE0 I3/f3/uQx66ASdeN9hrbefgiHj8+1OjgT85oPHcG0ET5nhLafTVOq8f8JC01noFmKUe/ Gsbg== 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; bh=u7NaTaeQxbnEG0iQy2qlxw2UUCg6egVNojtu2VcY9M0=; b=OmWuk+0rZJ7VDK8DElQhmO8qFoYqhL1/fRFuEXDsN7WNnpbsU8wYYxEL4282lgjYh6 nV1NnX0b4rDv2yWVDNT5xmQ6Wwba/5B1dt2OQqywQznYrPhkgZlpGN62Nr7YB8D5hNVl yWQHD/Jx/tFl9Vl1CrOrflxqNARr8wrAcPLIaDjHrMVBZ/UesK52oD1B9Dm+f8y5vmWb nkHiSfBoNPG5FaBqUNKZ2hHBP4px5bxk6QJz7NDKvdpCdhtuCPz7P+AABXfQW7B0VaC0 x6uy2u8QtB767cAVoUnzThgxdgUzztP+cWM8fN82IlXpCamJdQ3HE0o/lEn31u8Y1Edq zW6g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2018-07-02 header.b=TA+66MPv; 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 h18-v6si20352545pgv.47.2018.10.29.15.54.27; Mon, 29 Oct 2018 15:54:43 -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-2018-07-02 header.b=TA+66MPv; 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 S1730866AbeJ3Hng (ORCPT + 99 others); Tue, 30 Oct 2018 03:43:36 -0400 Received: from userp2130.oracle.com ([156.151.31.86]:55162 "EHLO userp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730742AbeJ3Hng (ORCPT ); Tue, 30 Oct 2018 03:43:36 -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 w9TMn7v2171186; Mon, 29 Oct 2018 22:52:25 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-2018-07-02; bh=u7NaTaeQxbnEG0iQy2qlxw2UUCg6egVNojtu2VcY9M0=; b=TA+66MPvJDM2HRRzIU2XZVnJCUcMQxqE4RzO1YxhT/7Msdnc7j6UupTaX6JaF3nyoZBx AA/4iwAEypySEnxd9JHvWf0QZ64QLn3wuRKJAdfk0ZJi5jka/EIiEUr8fgpl11KbUDHj 0n1M+5xG0XYKjip5b/SA9hYZ7zkMZej8ujt+p++yMpDLvjrp6dW48gLwpAO9fQ4w4jNm 4cTLR45x77cc70lUIdlHpGVsG+dZS9ZednWdDrGe97fx93p2mcwr6uFtMPLUfx9B6ZB7 JXsZv3sgwVQujr0yxZ1+jNYRCEAFllUsL1r9lTz4wMeSaTkkw40PsGtF3CG8MifZ1zVP WA== Received: from userv0022.oracle.com (userv0022.oracle.com [156.151.31.74]) by userp2130.oracle.com with ESMTP id 2nduckwcck-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 29 Oct 2018 22:52:25 +0000 Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by userv0022.oracle.com (8.14.4/8.14.4) with ESMTP id w9TMqOS9019538 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 29 Oct 2018 22:52:24 GMT Received: from abhmp0009.oracle.com (abhmp0009.oracle.com [141.146.116.15]) by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id w9TMqN8V021828; Mon, 29 Oct 2018 22:52:23 GMT Received: from [10.132.91.175] (/10.132.91.175) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 29 Oct 2018 15:52:23 -0700 Subject: Re: [RFC 00/60] Coscheduling for Linux To: =?UTF-8?Q?Jan_H=2e_Sch=c3=b6nherr?= Cc: Ingo Molnar , Peter Zijlstra , linux-kernel@vger.kernel.org References: <20180907214047.26914-1-jschoenh@amazon.de> <50b88e33-110f-c67a-671a-47c67017a563@amazon.de> From: Subhra Mazumdar Message-ID: <5dbc627c-15a7-1c48-cb88-cf60b445dd0b@oracle.com> Date: Mon, 29 Oct 2018 15:52:51 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 MIME-Version: 1.0 In-Reply-To: <50b88e33-110f-c67a-671a-47c67017a563@amazon.de> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9061 signatures=668683 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-1807170000 definitions=main-1810290201 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10/26/18 4:44 PM, Jan H. Schönherr wrote: > On 19/10/2018 02.26, Subhra Mazumdar wrote: >> Hi Jan, > Hi. Sorry for the delay. > >> On 9/7/18 2:39 PM, Jan H. Schönherr wrote: >>> The collective context switch from one coscheduled set of tasks to another >>> -- while fast -- is not atomic. If a use-case needs the absolute guarantee >>> that all tasks of the previous set have stopped executing before any task >>> of the next set starts executing, an additional hand-shake/barrier needs to >>> be added. >>> >> Do you know how much is the delay? i.e what is overlap time when a thread >> of new group starts executing on one HT while there is still thread of >> another group running on the other HT? > The delay is roughly equivalent to the IPI latency, if we're just talking > about coscheduling at SMT level: one sibling decides to schedule another > group, sends an IPI to the other sibling(s), and may already start > executing a task of that other group, before the IPI is received on the > other end. Can you point to where the leader is sending the IPI to other siblings? I did some experiment and delay seems to be sub microsec. I ran 2 threads that are just looping in one cosched group and affinitized to the 2 HTs of a core. And another thread in a different cosched group starts running affinitized to the first HT of the same core. I time stamped just before context_switch() in __schedule() for the threads switching from one to another and one to idle. Following is what I get on cpu 1 and 45 that are siblings, cpu 1 is where the other thread preempts: [  403.216625] cpu:45 sub1->idle:403216624579 [  403.238623] cpu:1 sub1->sub2:403238621585 [  403.238624] cpu:45 sub1->idle:403238621787 [  403.260619] cpu:1 sub1->sub2:403260619182 [  403.260620] cpu:45 sub1->idle:403260619413 [  403.282617] cpu:1 sub1->sub2:403282617157 [  403.282618] cpu:45 sub1->idle:403282617317 .. Not sure why the first switch on cpu to idle happened. But then onwards the difference in timestamps is less than a microsec. This is just a crude way to get a sense of the delay, may not be exact. Thanks, Subhra > > Now, there are some things that may delay processing an IPI, but in those > cases the target CPU isn't executing user code. > > I've yet to produce some current numbers for SMT-only coscheduling. An > older ballpark number I have is about 2 microseconds for the collective > context switch of one hierarchy level, but take that with a grain of salt. > > Regards > Jan >