Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1006480pxb; Thu, 4 Mar 2021 00:17:06 -0800 (PST) X-Google-Smtp-Source: ABdhPJwGOV2U1/NUnd0CkeoxK80GxabX+apuA8LQYK9+G0nHxRAEj6jR3/vL75xYAlkX+V2eSG+a X-Received: by 2002:a50:fa42:: with SMTP id c2mr3062582edq.159.1614845826664; Thu, 04 Mar 2021 00:17:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614845826; cv=none; d=google.com; s=arc-20160816; b=IHnyXnTA13WElTK6Pxn3XdfxbnajI5xajI7X73471jEoQiz4tVpy0APa8SQ/HRvz9m H07/ecdvMz0GbPCX698ylbLTcnnLUVyh+xRL3cDPSOJF5IDCbmJARJhqiDQ6GJBITFqv LVKsZGy9Yrqd1ge0CcTx2XO5nJnVJseH/bvOgIClAdPu9vheMpRrx6gmQtNtk8z386Il ZwaExTAwn/uXNKD7QIl8vCgpaiHWnzZ8BEKay6FHnq5Fr4dTqn/GHDqelB2JJp4gyNfA 4cGLc5+o8S7wJyQ4cHhuDRqu2oqXPgzd1yA4EJWFOLfgyrXQWUPhWI83Eg0sLDn6YM9v kVjA== 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=yFyGg6KNGzSfRYjZ76byOcmhxoc8vO+7hPNjo35K9rQ=; b=U540qs4d5suTssXGa//Yr9M23hD9yPo7vv14m4d9zHfvB8+upoo5YvIXAyASftAEKo mV0rcz7oGxtm0/wUycZf2GsJBup15Ia1a0uUC+wvcXVbUh3P57E85XUIsstsQXXaUVax 9WGTbVYoEujIuDbUI7vdHfU35j6rUMdI4iazERkp0dBkvLts2OdjojOjt4TZ9xrlP2yN NcD8KvFuKLRvG0LYasEk25NUVxwv9D0t7SuD91JNolaQ84bwHlicJUxFYptmMAk9GRjg D3/RRwGfGez8JPXkAYWpiumHfD1GyeHDzjYe0qN1lHQm3O+/PIsF3yxWJ/QcMp/jOrVj FuFA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bytedance-com.20150623.gappssmtp.com header.s=20150623 header.b=KVd56+eS; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=bytedance.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id lg14si12741846ejb.6.2021.03.04.00.16.44; Thu, 04 Mar 2021 00:17:06 -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; dkim=pass header.i=@bytedance-com.20150623.gappssmtp.com header.s=20150623 header.b=KVd56+eS; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=bytedance.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1442025AbhCCLim (ORCPT + 99 others); Wed, 3 Mar 2021 06:38:42 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42266 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1352583AbhCCD4n (ORCPT ); Tue, 2 Mar 2021 22:56:43 -0500 Received: from mail-pg1-x534.google.com (mail-pg1-x534.google.com [IPv6:2607:f8b0:4864:20::534]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 368F3C061797 for ; Tue, 2 Mar 2021 19:47:08 -0800 (PST) Received: by mail-pg1-x534.google.com with SMTP id a23so5524832pga.8 for ; Tue, 02 Mar 2021 19:47:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=yFyGg6KNGzSfRYjZ76byOcmhxoc8vO+7hPNjo35K9rQ=; b=KVd56+eSRCDSoGMKAfjcnD/9taVnzDzrPgvXdUvZaRvPmqNGKQ7ZpVzc6P8HsGBInY Hmwjk22pg8yHMG915IOi8jslPZEnFZcZq1EOdGq0dmaOQNsbtddD691QKlxC54K6kG/V a2ZZfQL2p5ABe+FLMXtab8y6Omx8n1L4R2UBMimaPhLmM4xtvroe6cdontcR+9yznLqm ffZDnEomZho3TV6ljauyUkg7C7LJw+SZXyd4JTJy3qxRmpz1jHW1efuzN58ML+TXGqbc 74wfb42CudBDNZQECztn97ssrbzHTFqTlHrCWREOEqP2PNvnC2LdECInQ7HnrUH9yssj Dc9Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=yFyGg6KNGzSfRYjZ76byOcmhxoc8vO+7hPNjo35K9rQ=; b=CkYQbvsaGxr36txCWZvpiy1WvspjvXrYUE3NR3Tfc6jvetVgh5XP17qVIxYTNioC7a U3vqb/wzSX7gDQS7lfiRyrvFu3HF4yyxtYM0/d0iv2r7OdDZCW+/lGnSnDj+UAqH903a tBD9hNxM3ZeLKno9uzUnKkPjbSAS/u6W35ePcpa4FrBkTM7w1S9E2Nj+uKeLpNpxEsAi XmYKf7uuxJbGXLzqk+KED3cACdFwM0lsZL/REvbDLkz1cAmmySP3TX9pVa9vtty635kH XFvRMj74xuHHE44Q2UjmCmxrZ728wN4h6VBOpIr4dnPUOnpnW52sapU7saT30ExLIQds 9KrA== X-Gm-Message-State: AOAM533ublrusF3LhagOTw2BTPqMhAYn4UGyGbfGJtgRkA8riix374tm 6fKhoWDUXzYvhdzVsQje/epSHw== X-Received: by 2002:aa7:8e43:0:b029:1ed:447c:f1d4 with SMTP id d3-20020aa78e430000b02901ed447cf1d4mr1361460pfr.16.1614743227772; Tue, 02 Mar 2021 19:47:07 -0800 (PST) Received: from C02CV1DAMD6P.bytedance.net ([139.177.225.246]) by smtp.gmail.com with ESMTPSA id p26sm23029703pfn.127.2021.03.02.19.47.03 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 02 Mar 2021 19:47:07 -0800 (PST) From: Chengming Zhou To: hannes@cmpxchg.org, mingo@redhat.com, peterz@infradead.org, juri.lelli@redhat.com, vincent.guittot@linaro.org, dietmar.eggemann@arm.com, rostedt@goodmis.org Cc: linux-kernel@vger.kernel.org, songmuchun@bytedance.com, zhouchengming@bytedance.com Subject: [PATCH v2 0/4] psi: Add PSI_CPU_FULL state and some code optimization Date: Wed, 3 Mar 2021 11:46:55 +0800 Message-Id: <20210303034659.91735-1-zhouchengming@bytedance.com> X-Mailer: git-send-email 2.24.3 (Apple Git-128) MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patch series is RESEND of the previous patches on psi subsystem. A few weeks passed since the last review, so I put them together and resend for more convenient review and merge. Patch 1 add PSI_CPU_FULL state means all non-idle tasks in a cgroup are delayed on the CPU resource which used by others outside of the cgroup or throttled by the cgroup cpu.max configuration. Patch 2 use ONCPU state and the current in_memstall flag to detect reclaim, remove the hook in timer tick to make code more concise and maintainable. And patch 3 adds unlikely() annotations to move the pressure state branches out of line to eliminate undesirable jumps during wakeup and sleeps. Patch 4 optimize the voluntary sleep switch by remove one call of psi_group_change() for every common cgroup ancestor of the two tasks. Chengming Zhou (3): psi: Add PSI_CPU_FULL state psi: Use ONCPU state tracking machinery to detect reclaim psi: Optimize task switch inside shared cgroups Johannes Weiner (1): psi: pressure states are unlikely include/linux/psi.h | 1 - include/linux/psi_types.h | 3 +- kernel/sched/core.c | 1 - kernel/sched/psi.c | 122 ++++++++++++++++++++++++---------------------- kernel/sched/stats.h | 37 +++++--------- 5 files changed, 78 insertions(+), 86 deletions(-) -- 2.11.0