Received: by 2002:a25:f815:0:0:0:0:0 with SMTP id u21csp111736ybd; Fri, 28 Jun 2019 15:41:20 -0700 (PDT) X-Google-Smtp-Source: APXvYqxrSpvSBI7eC5l6vA6y81PFOCZpJBhhqLE0gxfAVrhv3ICo/Az6P3eNNu0BunQ+1j0ZeuIq X-Received: by 2002:a17:90a:db08:: with SMTP id g8mr15395381pjv.39.1561761680591; Fri, 28 Jun 2019 15:41:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561761680; cv=none; d=google.com; s=arc-20160816; b=e5Jws/R0erBNcp7Aq1k5mAkmEO22P9XRXxO2bOV4fLZfSkO3mVkFZP/5p+d6wu0kFh sApzGvX41XKzh0OoJhI1Bj5M2AO5o7WiJT0nBpGCb2Vg7a9DDBWXWbi4YmbSXFAzEFav tcicLSRy5lRRRBu+1+2urPA23HZDvzo/Lbobflr+Sm9RSaRrN+fupzcWJoH34pWbGN1h 7o/sr2dXDJngUwooVvwnyijGzcaH7IzFA9UDhmWnBLbNST2vXMXCMmxEnU/F4MUDxYAM nJVj0JBdDuc7ZrjjLYsDKneV57sxpehB8NbdrPpn3w50oEz/Nbmmvm6DmrTsujJnM8Kp pEHg== 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=kjjlgFi6AgD2bzIvdYF4FhcBGFgr7Z4+4fAYVr9/hzg=; b=ArxAchEchJ8YbiiP4WmyoBAb6FkhgOmOWUobVCINOYUZ6AnK6MnqYPC+8g/HH3DViV 1YKpPFCnsdFvcHmM7Jua0tefLNcYfA1+UXQkr5nmT1vOeKeJfKUETVrdE6bpF36GfgE5 t2b0Vdc+NQdIHbxb/ighOPC8QlVQgivb92joUHSVkX+vphP44YwFooMahYQEqNUKwt84 fZTkHGr6CkfYVXTM150xNfEV31wujIps3PnbwZtjkhZfpu87ggAZMWZbk8wz/2Ek4COC ga4EopvD3wdaQH3sE8i8erge+32uHqVu3UuCGLKosOfu1U6bwnxvZ62hDSqf/eDRZBHM XHgQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2018-07-02 header.b=NmrPSDVm; 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 b24si3920229pfi.180.2019.06.28.15.41.04; Fri, 28 Jun 2019 15:41:20 -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=NmrPSDVm; 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 S1726818AbfF1Wkg (ORCPT + 99 others); Fri, 28 Jun 2019 18:40:36 -0400 Received: from userp2130.oracle.com ([156.151.31.86]:50432 "EHLO userp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726563AbfF1Wkg (ORCPT ); Fri, 28 Jun 2019 18:40:36 -0400 Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x5SMYjXD075488; Fri, 28 Jun 2019 22:39:35 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=kjjlgFi6AgD2bzIvdYF4FhcBGFgr7Z4+4fAYVr9/hzg=; b=NmrPSDVm9DEiOab3SuM1JEoN7CXABw5E1fcd81Jy/AIjA4QOa9vy16k/AWUCEab/j/U4 9rXlDLMcQxGvJu8l6fqckrdUeFOlsIDcxukt0KBYCYmA/Y1Fb5mECYhUi65GN6Tqe21v KFqKnSVARnFrcSfosCqMBBUSu0XQ96XEHnnTaY/rsr9QBQ8j94moBNaneFJeky7af5l2 h5PT5sBEi7Us/uTzpduMtpO8imMeUyOKJNsndVjWUXIzQk0t+sIb42zdSX+kujkUi7yN +ontIoOvgI3q/qofC7qGADL1NdC9K6ZyO+/duAIudWRm+cZodCBOXLMKEgz/EtWWWwCa tA== Received: from aserp3020.oracle.com (aserp3020.oracle.com [141.146.126.70]) by userp2130.oracle.com with ESMTP id 2t9brtqs3h-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 28 Jun 2019 22:39:35 +0000 Received: from pps.filterd (aserp3020.oracle.com [127.0.0.1]) by aserp3020.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x5SMdGDH067305; Fri, 28 Jun 2019 22:39:34 GMT Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by aserp3020.oracle.com with ESMTP id 2t9p6w4ufh-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 28 Jun 2019 22:39:34 +0000 Received: from abhmp0019.oracle.com (abhmp0019.oracle.com [141.146.116.25]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id x5SMdWYA004877; Fri, 28 Jun 2019 22:39:32 GMT Received: from [10.132.91.175] (/10.132.91.175) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Fri, 28 Jun 2019 15:39:32 -0700 Subject: Re: [PATCH v3 3/7] sched: rotate the cpu search window for better spread To: Srikar Dronamraju Cc: linux-kernel@vger.kernel.org, peterz@infradead.org, mingo@redhat.com, tglx@linutronix.de, steven.sistare@oracle.com, dhaval.giani@oracle.com, daniel.lezcano@linaro.org, vincent.guittot@linaro.org, viresh.kumar@linaro.org, tim.c.chen@linux.intel.com, mgorman@techsingularity.net References: <20190627012919.4341-1-subhra.mazumdar@oracle.com> <20190627012919.4341-4-subhra.mazumdar@oracle.com> <20190628115441.GA30685@linux.vnet.ibm.com> From: Subhra Mazumdar Message-ID: <0dbdf3d0-8547-3290-0ad6-adf65d8aa976@oracle.com> Date: Fri, 28 Jun 2019 15:34:25 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.5.1 MIME-Version: 1.0 In-Reply-To: <20190628115441.GA30685@linux.vnet.ibm.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9302 signatures=668688 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-1810050000 definitions=main-1906280259 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9302 signatures=668688 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1011 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1906280259 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 6/28/19 4:54 AM, Srikar Dronamraju wrote: > * subhra mazumdar [2019-06-26 18:29:15]: > >> Rotate the cpu search window for better spread of threads. This will ensure >> an idle cpu will quickly be found if one exists. > While rotating the cpu search window is good, not sure if this can find a > idle cpu quickly. The probability of finding an idle cpu still should remain > the same. No? > >> Signed-off-by: subhra mazumdar >> --- >> kernel/sched/fair.c | 10 ++++++++-- >> 1 file changed, 8 insertions(+), 2 deletions(-) >> >> @@ -6219,9 +6219,15 @@ static int select_idle_cpu(struct task_struct *p, struct sched_domain *sd, int t >> } >> } >> >> + if (per_cpu(next_cpu, target) != -1) >> + target_tmp = per_cpu(next_cpu, target); >> + else >> + target_tmp = target; >> + >> time = local_clock(); >> >> - for_each_cpu_wrap(cpu, sched_domain_span(sd), target) { >> + for_each_cpu_wrap(cpu, sched_domain_span(sd), target_tmp) { >> + per_cpu(next_cpu, target) = cpu; > Shouldn't this assignment be outside the for loop. > With the current code, > 1. We keep reassigning multiple times. > 2. The last assignment happes for idle_cpu and sometimes the > assignment is for non-idle cpu. We want the last assignment irrespective of it was an idle cpu or not since in both cases we want to track the boundary of search. Thanks, Subhra