Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp7472262ybi; Mon, 8 Jul 2019 22:39:37 -0700 (PDT) X-Google-Smtp-Source: APXvYqw7pr6cNvshZHkBW77uvIElasgTd19h4nvpFr2t/EqHjyR3DUkaECHZ6eZJTQbaZGgSfUnQ X-Received: by 2002:a63:5c1c:: with SMTP id q28mr27785823pgb.288.1562650777524; Mon, 08 Jul 2019 22:39:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562650777; cv=none; d=google.com; s=arc-20160816; b=Hq9xF0LBTScTU7ox6afk+hcAUH+99uMjfKp2jNt4jF+dmsEBx7+VoRrw//+dfxxOYY lhQe8nKfs3SXg38WAB35mGpIhBkjjzLu5ZMG2vCt8IDmMUBMArS+yDt8t1enxK2YR2qJ XKsTa0qS/s+o88xF/U5EqXWlu1WDtkmaWG0r4wMJNfagkA2siXO/lBVkSekL2Q2G1gzO 9iLMauHXUyn0hIFKU/NlhsVcO8+HWWb6RKgYIQ7xpa+kcqkrUA9KnKJmrMza8rEpYdZv 1nXwVf5BHcORpuoZHD15ThaZvTQca2HawjzjyClRbAFWK4OCg9kPJXXVi+Yo2pOEoJ0+ rwBQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date:from :references:cc:to:subject; bh=rkmvVIbxXnjq3FPiLuyp7HN+xP1FCmFSJ3VepyiPAqU=; b=Eka33b8JA0pd4kZ9FEw3B5pAttyiCLqyYLUExKUB/q/9REXQYG3RYjWvneF9JpKH2W lOLNQHbw54EUqQfoxdpd8zj79e0Ry2oQCVF5OgpK8e5COfMIrIlm82RNcZrz7fqTEOHu EV+lAY/DPYGkIyL3xTNNWnnFHfYwK72bRMWJQHKw1dkh2pard9MiYe4Vd+X379B/l9KN Jxf9x8fVSPolF5uXpWI9DUeyTQyITnTkSlIUUYnFmP5cJ+sYJ/9V84EMLEsn3WZg/ENI Lr6ynmdVCWYw3DKuRwTM1n3zzVDeX4FZ1dLF87wLQudfK3oSXAsPS7zy0C3PDuqMT5cZ 29Zw== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f34si20397671plf.305.2019.07.08.22.39.21; Mon, 08 Jul 2019 22:39:37 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726025AbfGIFi1 (ORCPT + 99 others); Tue, 9 Jul 2019 01:38:27 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:49658 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725818AbfGIFi1 (ORCPT ); Tue, 9 Jul 2019 01:38:27 -0400 Received: from pps.filterd (m0098421.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x695au27037681 for ; Tue, 9 Jul 2019 01:38:25 -0400 Received: from e06smtp04.uk.ibm.com (e06smtp04.uk.ibm.com [195.75.94.100]) by mx0a-001b2d01.pphosted.com with ESMTP id 2tmjtukw1p-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 09 Jul 2019 01:38:25 -0400 Received: from localhost by e06smtp04.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 9 Jul 2019 06:38:23 +0100 Received: from b06avi18878370.portsmouth.uk.ibm.com (9.149.26.194) by e06smtp04.uk.ibm.com (192.168.101.134) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Tue, 9 Jul 2019 06:38:20 +0100 Received: from d06av25.portsmouth.uk.ibm.com (d06av25.portsmouth.uk.ibm.com [9.149.105.61]) by b06avi18878370.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x695cJwq41222472 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 9 Jul 2019 05:38:19 GMT Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 8F9EB11C04C; Tue, 9 Jul 2019 05:38:19 +0000 (GMT) Received: from d06av25.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 9C26B11C04A; Tue, 9 Jul 2019 05:38:18 +0000 (GMT) Received: from localhost.localdomain (unknown [9.124.35.246]) by d06av25.portsmouth.uk.ibm.com (Postfix) with ESMTP; Tue, 9 Jul 2019 05:38:18 +0000 (GMT) Subject: Re: [RFC 0/2] Optimize the idle CPU search To: Subhra Mazumdar , linux-kernel@vger.kernel.org Cc: peterz@infradead.org, mingo@redhat.com, vincent.guittot@linaro.org References: <20190708045432.18774-1-parth@linux.ibm.com> <839c6cc8-b550-3066-d856-3c8a919cc318@oracle.com> From: Parth Shah Date: Tue, 9 Jul 2019 11:08:17 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.0 MIME-Version: 1.0 In-Reply-To: <839c6cc8-b550-3066-d856-3c8a919cc318@oracle.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 x-cbid: 19070905-0016-0000-0000-000002907EFB X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19070905-0017-0000-0000-000032EE2FBA Message-Id: <708a2726-628c-196b-1fc0-43067e1e740f@linux.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2019-07-09_02:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=842 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1907090068 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 7/9/19 5:38 AM, Subhra Mazumdar wrote: > > On 7/8/19 10:24 AM, Parth Shah wrote: >> When searching for an idle_sibling, scheduler first iterates to search for >> an idle core and then for an idle CPU. By maintaining the idle CPU mask >> while iterating through idle cores, we can mark non-idle CPUs for which >> idle CPU search would not have to iterate through again. This is especially >> true in a moderately load system >> >> Optimize idle CPUs search by marking already found non idle CPUs during >> idle core search. This reduces iteration count when searching for idle >> CPUs, resulting in lower iteration count. >> > I believe this can co-exist with latency-nice? We can derive the 'nr' in > select_idle_cpu from latency-nice and use the new mask to iterate. > I agree, can be done with latency-nice. Maybe something like below? smt = nr_cpus / nr_cores nr = smt + (p->latency_nice * (total_cpus-smt) / max_latency_nice) This limits lower bounds to 1 core and goes through all the cores if latency_nice is maximum for a task. Thanks Parth