From patchwork Fri Oct 21 06:15:56 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hao Jia X-Patchwork-Id: 461 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4242:0:0:0:0:0 with SMTP id s2csp521395wrr; Thu, 20 Oct 2022 23:32:52 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6NUzw/rXfA98FcqNvGMuDDk2m4iJSGizqpdl/sXT1a383tmMH+/721ggwcuIjqE/dy08tQ X-Received: by 2002:a17:906:58c7:b0:722:f4bf:cb75 with SMTP id e7-20020a17090658c700b00722f4bfcb75mr14052555ejs.450.1666333961761; Thu, 20 Oct 2022 23:32:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666333961; cv=none; d=google.com; s=arc-20160816; b=qFgoXY5BaA28G49hoJcklHe/ryP0NoZ+Kk5YiO5M1boO65XDQsZG78THynGGIZNei8 cnR1LzbZ+Yyjl8YsZ0g+0fJZ7l3hXw2xXdzdYyXaa61lKeEBGfcVCg0ZFZHYikhUCCwo jaO+E4ItM0kmwArywC35XmwOjA+N1VXLmtrC0ZV0gMQ+ChHcFTYFJMobOdbsIzBhDG23 P+jRp/+X0lpNHs017sxXusAfSSnCXbpAaZAFJ2EkBP57bSaDK6fn4NvwCAYeAgLGufx/ msrLs3OUFg2sANLxYWYS+0Ii6tPptZMnPImd/0UGbCy9D+CWFQnrmDUceEFTPd2k8Ylf lWig== 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:dkim-signature; bh=/sA7QGSj6y75rxa2eYsPXnOjdBFHP2KYfkI6B1PEkNY=; b=yNHNj7C8LnoeBeNEReroIwYAd+rHhpx/nXIlNqO4eIKDWUKTXXuWUy/AaJo7t+BEaz 1DIz+RxkcIOHK45wwGCHquUO5TVSWdSh9e6m8e7PZbH4/V+b/2/TiUn+URDwSfGgYGTu CcIIl9zw2n5BPvPeR6RkyZ2i85tdd+/5Deqz+gvB0vp9BruiTkNODaPKCAxu0E/Uqt0a QUUkmK/x2KXxAJPmb7rW7XdOBLCu0BQapItAXazMoyONwwaSG8E1+6sYH1+tuOLu/Knw lwhRauUqX1xKN/0hgZQlNYNHKs1XlT2hY66amETpxJS7YkdD0tqke9iTKL15kNw7+Mg5 30uw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bytedance-com.20210112.gappssmtp.com header.s=20210112 header.b=OJyo1zRz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=bytedance.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hd12-20020a170907968c00b0078db8bac984si9416048ejc.830.2022.10.20.23.32.16; Thu, 20 Oct 2022 23:32:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@bytedance-com.20210112.gappssmtp.com header.s=20210112 header.b=OJyo1zRz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=bytedance.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229871AbiJUGQM (ORCPT + 99 others); Fri, 21 Oct 2022 02:16:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59984 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229763AbiJUGQL (ORCPT ); Fri, 21 Oct 2022 02:16:11 -0400 Received: from mail-pj1-x1036.google.com (mail-pj1-x1036.google.com [IPv6:2607:f8b0:4864:20::1036]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 895D01FB7A3 for ; Thu, 20 Oct 2022 23:16:10 -0700 (PDT) Received: by mail-pj1-x1036.google.com with SMTP id t10-20020a17090a4e4a00b0020af4bcae10so1887900pjl.3 for ; Thu, 20 Oct 2022 23:16:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance-com.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=/sA7QGSj6y75rxa2eYsPXnOjdBFHP2KYfkI6B1PEkNY=; b=OJyo1zRz85apeGrCFU7BrmskmNKBczykdQdx109JVIjlDJ8cMbC7Bw1kFSkDyg/Rtv Bc2MG4sRen5OGVF00eL/nP6X4zbA1Dhhgt1yRp3UI3XRBt6hH3T51ujOT94zcBYJojkC NQh7oCVgSzNYCm+4Aen0lY1nXP8pUzXEg8ogZOepaP0IFbznBZI2f6dCylF5bE9fSn3k StX80XhSnPJG2m0BbIhcWXYBBPZhh3xqib54iJDPpX/7zF6NZB5OAYUr8uROYUoYtvV0 Gngsm8qemFFCN1+Euhdq4GLjWEOYaLx3T4JhL9MplwRfChb/0Ta7G6YzWMQJ+Rk5/oxD IELw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=/sA7QGSj6y75rxa2eYsPXnOjdBFHP2KYfkI6B1PEkNY=; b=PxWiyLLiiOU0A5+xCs8/D6ZKxEC8/KZqUKgnDeR68YUuhSc2kJuOpJk41AvWwgidjH E/FJtMWhPprLKkdOmzHDnbraFzLhLWQe099FS9NTA6CCfhUFvZXH5OU9lkPCJ6f206ND vVscsGSKJi8cyr9PSU6KCzLLX7o/+I9yq79zKzKorvsjzVOgH0xZ4r0WZ1IkEFqx1/GR lSLBiuhvthQSSglmOkzEih7DH5fTBydzaxFU2BVO9VbFyBM1CSu8yuRjGqSocDjwLNqB T/fcswWmxr+Iz+89OkHkS/tlIcSqvKwSWGTTpCGYcWl4fFHOYD8M+vSt921zVu+lf4ju FT/Q== X-Gm-Message-State: ACrzQf2XnGtygSOqwzdYVpYBiwrhG1Z3VyJ4MeiXNf0AlrU1HU/QBBO+ qBX69ahDSJLhgFcU9xuPxLVPyQ== X-Received: by 2002:a17:90b:1e4d:b0:212:c6f4:2cff with SMTP id pi13-20020a17090b1e4d00b00212c6f42cffmr4406899pjb.240.1666332970138; Thu, 20 Oct 2022 23:16:10 -0700 (PDT) Received: from C02G87K0MD6R.bytedance.net ([139.177.225.244]) by smtp.gmail.com with ESMTPSA id o11-20020a17090a4b4b00b0020d45a155d9sm327532pjl.35.2022.10.20.23.16.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 Oct 2022 23:16:09 -0700 (PDT) From: Hao Jia To: mingo@redhat.com, peterz@infradead.org, mingo@kernel.org, juri.lelli@redhat.com, vincent.guittot@linaro.org, dietmar.eggemann@arm.com, rostedt@goodmis.org, bsegall@google.com, mgorman@suse.de, bristot@redhat.com, vschneid@redhat.com, mgorman@techsingularity.net Cc: linux-kernel@vger.kernel.org, Hao Jia Subject: [PATCH 0/2] Optimize the process of scanning CPU for some functions Date: Fri, 21 Oct 2022 14:15:56 +0800 Message-Id: <20221021061558.34767-1-jiahao.os@bytedance.com> X-Mailer: git-send-email 2.37.0 (Apple Git-136) MIME-Version: 1.0 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747277800671556107?= X-GMAIL-MSGID: =?utf-8?q?1747277800671556107?= These two patches optimize the process of scanning the CPU by adjusting the search order or breaking the loop. Hao Jia (2): sched/numa: Stop an exhastive search if an idle core is found sched/core: Optimize the order of scanning CPU kernel/sched/core.c | 2 +- kernel/sched/fair.c | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-)