Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp2253225pxu; Mon, 7 Dec 2020 01:19:00 -0800 (PST) X-Google-Smtp-Source: ABdhPJzq+xEdrYpNSwdmNp3EMOpKcsnhfvbb4jyy8+701+gS20iWgZxv6wXy/YHb8wtAIr82seEU X-Received: by 2002:aa7:d297:: with SMTP id w23mr19118618edq.374.1607332739986; Mon, 07 Dec 2020 01:18:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607332739; cv=none; d=google.com; s=arc-20160816; b=Lm3n9Ue7mo1a/BpzkIo8HVYXdDooqZdwkonOeO+Yte0AF98mNIJXHyWlA2ylqohm+a WANXOH7Kc0EejRtYLbti5Jccf0HWmSpvKY1GAYEjhiYpNLhoa99rB92wOFsp6YWKGIYA 4tWD083c1gPglGUhUkOA0NiJtgKD0ScS2I7sHWsOiNZhmCp8wkJOk8h8E847rD5rwSGk BN/wmqstwX+HiNPXM4WbzL7AhwChJSsuCvKWd4Mg+QDsyhpiKW0UOkiD/7AKixevzmVj n5wFyKem4VyOEkt4BaCg2qytA+/uQTMryTQ+T9wKnEJTRdiSpgxAMMpD8Xp92vd/8CGo qEJQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=7U0ovs+VHufjQ1Tmwbv0N7LVXeBHqYVvny/yFenSee4=; b=Qgonqz2fcQ6TFQvcrxQbb8CYdJ/zU4MUQDsBhz8VRW2Ek07VpPHw104zuKzFoktZBG hEpKWu9DUkVZxzCM/GwKjcldnUlkUvTpPs1wd45DMN0JT70xmDEF2839sdg5R40d1grO kVIMaVoUVqtAorHYoH8ta+zzhGW81Zx0DlR9wV1eZ/GmAcy2/2qi4QLSPFhuwl5lY+s+ Klt369iAAtWLOeUdwG2nVY80KSt1o/3lFDqWPGl4Ta2ICKaw4QaC55/K8iuOWiuXLc0Z A0pDFu3FJB/7rW3f0PVF7S6dtD1SedcP1hPrH583jddZ2THpEYIr0PykBg2gETSBhClq SeRA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f21si480782eds.396.2020.12.07.01.18.37; Mon, 07 Dec 2020 01:18:59 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726626AbgLGJQQ (ORCPT + 99 others); Mon, 7 Dec 2020 04:16:16 -0500 Received: from outbound-smtp29.blacknight.com ([81.17.249.32]:56941 "EHLO outbound-smtp29.blacknight.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726395AbgLGJQP (ORCPT ); Mon, 7 Dec 2020 04:16:15 -0500 Received: from mail.blacknight.com (pemlinmail02.blacknight.ie [81.17.254.11]) by outbound-smtp29.blacknight.com (Postfix) with ESMTPS id 4E9FABEC6E for ; Mon, 7 Dec 2020 09:15:27 +0000 (GMT) Received: (qmail 11227 invoked from network); 7 Dec 2020 09:15:27 -0000 Received: from unknown (HELO stampy.112glenside.lan) (mgorman@techsingularity.net@[84.203.22.4]) by 81.17.254.9 with ESMTPA; 7 Dec 2020 09:15:26 -0000 From: Mel Gorman To: LKML Cc: Aubrey Li , Barry Song , Ingo Molnar , Peter Ziljstra , Juri Lelli , Vincent Guittot , Valentin Schneider , Linux-ARM , Mel Gorman Subject: [RFC PATCH 0/4] Reduce worst-case scanning of runqueues in select_idle_sibling Date: Mon, 7 Dec 2020 09:15:12 +0000 Message-Id: <20201207091516.24683-1-mgorman@techsingularity.net> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This is a minimal series to reduce the amount of runqueue scanning in select_idle_sibling in the worst case. Patch 1 removes SIS_AVG_CPU because it's unused. Patch 2 improves the hit rate of p->recent_used_cpu to reduce the amount of scanning. It should be relatively uncontroversial Patch 3-4 scans the runqueues in a single pass for select_idle_core() and select_idle_cpu() so runqueues are not scanned twice. It's a tradeoff because it benefits deep scans but introduces overhead for shallow scans. Even if patch 3-4 is rejected to allow more time for Aubrey's idle cpu mask approach to stand on its own, patches 1-2 should be fine. The main decision with patch 4 is whether select_idle_core() should do a full scan when searching for an idle core, whether it should be throttled in some other fashion or whether it should be just left alone. -- 2.26.2