Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp119265iof; Wed, 8 Jun 2022 16:56:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxgfWK6FmwYlysTX4QIPZDRe+gKQaV3gKT+PSan7J2659ovbFf5mDUNQmGdpR+XQc2r5KJz X-Received: by 2002:a17:90b:1b10:b0:1e8:2966:3232 with SMTP id nu16-20020a17090b1b1000b001e829663232mr485448pjb.103.1654732573603; Wed, 08 Jun 2022 16:56:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654732573; cv=none; d=google.com; s=arc-20160816; b=JnHTikqoWOBNzOAcThKJxXMxqjoDgWX4/GlhswF6cqLeYqz/drnKI+rtuLelUVAVDT 58SWsFpmlxEkKKTEWmTdMOxK+N1e6l5Mo+Vdwn0Nvmrsh4ucDmcHf/lp9+tkK/+urelZ ++X/HJXjNiQoKrDSYvFQrqJxe06SY3By6fatIOKzwR9FsAwX4rGNSUbzVsCsHHkj56dF BD3L/pePu/1MvZw6tOMpoWYzTiK3XvYkx5A6eRaR8kvgEUSMMa99ormFxNitu9W6+0YX dMrrzmWMa0/pTbepsdXHPhUcCP+2bN6ZxcaXdUQPUfnjTIsCkGT7/EDbsmn5OH3U0bfx bL2g== 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=9ViOD6kumZOnsqXWlOeemMd9kPXmcK9oYRWH8gw5E+8=; b=lIoHNfm8KOI5aMsacxZu4xe0QbH7xJ9yS7aHG6/L9XMvpTQR62ElTSzqb3n1IfQRRe Y5WIp1OdHBQZSYlC3Ig2oN0ClD42zPbuiaI9zAV1LsNo06tvf6TKZstDmswEGWfADvML 4HEGrXB0p76JTkmVs76EQmouYdevZ0yEm/RsWQXYxdt8Akob2irT/8CnFG00jqjgl+d0 3M8tSdfcwJ3OG8j/Mztq/1ss6HBQQdY+Uq6bSOeHmLWWEHr71p9soIdP6w31edibOB63 2MkLUeqvbChI13OguOYLAnJpHWvXNsvDn9bz3syNITSmsCz0fmumRVgEQ8B57zcSFe9s 0oHg== ARC-Authentication-Results: i=1; mx.google.com; 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=alibaba.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 3-20020a630003000000b003fd4f3a4161si17777964pga.534.2022.06.08.16.55.59; Wed, 08 Jun 2022 16:56:13 -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; 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=alibaba.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232946AbiFHXe2 (ORCPT + 99 others); Wed, 8 Jun 2022 19:34:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41676 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229673AbiFHXeZ (ORCPT ); Wed, 8 Jun 2022 19:34:25 -0400 Received: from out30-56.freemail.mail.aliyun.com (out30-56.freemail.mail.aliyun.com [115.124.30.56]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E28DA100B0E for ; Wed, 8 Jun 2022 16:34:22 -0700 (PDT) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R771e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e04400;MF=dtcccc@linux.alibaba.com;NM=1;PH=DS;RN=11;SR=0;TI=SMTPD_---0VFoWqdi_1654731252; Received: from localhost.localdomain(mailfrom:dtcccc@linux.alibaba.com fp:SMTPD_---0VFoWqdi_1654731252) by smtp.aliyun-inc.com; Thu, 09 Jun 2022 07:34:19 +0800 From: Tianchen Ding To: Ingo Molnar , Peter Zijlstra , Juri Lelli , Vincent Guittot , Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , Daniel Bristot de Oliveira , Valentin Schneider Cc: linux-kernel@vger.kernel.org Subject: [PATCH RESEND v4 0/2] sched: Queue task on wakelist in the same llc if the wakee cpu is idle Date: Thu, 9 Jun 2022 07:34:10 +0800 Message-Id: <20220608233412.327341-1-dtcccc@linux.alibaba.com> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.9 required=5.0 tests=BAYES_00, ENV_AND_HDR_SPF_MATCH,HK_RANDOM_ENVFROM,HK_RANDOM_FROM, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,UNPARSEABLE_RELAY,USER_IN_DEF_SPF_WL autolearn=no 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 Wakelist can help avoid cache bouncing and offload the overhead of waker cpu. So far, using wakelist within the same llc only happens on WF_ON_CPU, and this limitation could be removed to further improve wakeup performance. The result of Unixbench Pipe-based Context Switching can be improved up to ~10%. The 1st patch introduces a more "correct" way to check whether the wakee cpu is soon-to-be-idle. The 2nd patch allows using wakelist in any case when the wakee cpu is idle or soon-to-be-idle. v4: Add benchmark results about the 1st patch. Modify some comments. v3: https://lore.kernel.org/all/20220602040645.275555-1-dtcccc@linux.alibaba.com/ Add a patch to fix the check of nr_running. After that, we can remove WF_ON_CPU to achieve the same purpose. Thank Valentin and Mel. v2: https://lore.kernel.org/all/20220527090544.527411-1-dtcccc@linux.alibaba.com/ Modify commit log to describe key point in detail. Add more benchmark results on more archs. v1: https://lore.kernel.org/all/20220513062427.2375743-1-dtcccc@linux.alibaba.com/ Tianchen Ding (2): sched: Fix the check of nr_running at queue wakelist sched: Remove the limitation of WF_ON_CPU on wakelist if wakee cpu is idle kernel/sched/core.c | 30 ++++++++++++++++++------------ kernel/sched/sched.h | 1 - 2 files changed, 18 insertions(+), 13 deletions(-) -- 2.27.0