Received: by 2002:a05:6a10:eb17:0:0:0:0 with SMTP id hx23csp2059468pxb; Sun, 5 Sep 2021 07:38:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyvPBPIMIPrDrXVHEgscI2JmGYzPev0YH6sTsm7t/m5uFV4fg7HNTOx/6ptMr+usmQjocah X-Received: by 2002:a05:6402:2909:: with SMTP id ee9mr9037723edb.377.1630852680204; Sun, 05 Sep 2021 07:38:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1630852680; cv=none; d=google.com; s=arc-20160816; b=kE5Fos/4E47m7DbQF7ijBXwO0sYT6ts2BmPMbNcEb4IpUztsLdiuoQwoz3fJ9JDYZc Tk0MJznF/ktmyDqEdCsL+7lB6wvH9gWddJTBk5a4BdgU9nSWMUc1Ti0dQud2c7uHo19+ 6HveULibtsHSagUMmf3hTY6M/pUuYnmDe6BAXw5+Sq4zXst6W8WrRYbtk9ZyX5Y6RbJm dAo6Sd1nnu/nGHftx0YLSo4JUYuSunYTh4y73a1LWGV4rwsyXSb5CFXVxVX5wq9zGHzP wMs30jGNm9Arxe5evCwu14OFMBYzu8I3qbDjWuD5UaUPmScf4kMORW8ztOWy6tF8Farz KUSg== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=5QrSQxP5jUcv60OLK9iTQu26ROLgapGunPMgJUevpeY=; b=S7UlTCaHGocoQpbtWXpEyONJZBpfNGub18dXhZ8W8wfp7NhOd97YPiMRGvKfGWvZ2V Gp+EknR2TPhgpCTWksGyEmfKMN8OBzi5rQUtAIdu+qzANXy06VF7o7b5K5iV6hJRZjnS jSJARCO/d0tO3VBM3kT5wIavYAf4VZc4KPJa/Wp0qF+OI2iauGI/TDeMwICS6dMDrx4I f6ZAfn5FHdPN58+dOvLQ6brhmu4Ll3ddnr+y6pAFh3OTw2xzcLPLgD9phpKq9GEB0CJv sO5YiOMAXN38KK+r0I/bC0Xq/ZmrwwQpbO+CmqeNpfNDHaCN85uBhxLGh2lE0GaEb10V CLHQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=RrNPksAA; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m4si5129433eja.677.2021.09.05.07.37.36; Sun, 05 Sep 2021 07:38:00 -0700 (PDT) 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=@gmail.com header.s=20210112 header.b=RrNPksAA; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234975AbhIEOhO (ORCPT + 99 others); Sun, 5 Sep 2021 10:37:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51730 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233908AbhIEOhN (ORCPT ); Sun, 5 Sep 2021 10:37:13 -0400 Received: from mail-pg1-x52a.google.com (mail-pg1-x52a.google.com [IPv6:2607:f8b0:4864:20::52a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C9AEFC061575; Sun, 5 Sep 2021 07:36:10 -0700 (PDT) Received: by mail-pg1-x52a.google.com with SMTP id 8so4051063pga.7; Sun, 05 Sep 2021 07:36:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=5QrSQxP5jUcv60OLK9iTQu26ROLgapGunPMgJUevpeY=; b=RrNPksAAUhfNIqIivBW05dCf+n+41aCGjIcRDnJyBzShjMh3rUXyYe8x8rkrJU+3nh dn+MMI1/VvOnI/T6SXoLO5xsdFqnOiSMMZu9BciKd+PEwEgY8VUYYMqYyotRN0+MUvqA DgyPYdlPIJ1DQPWAkxrUyG/gl6avfnX9e9xOFmzIvDN7g2vJijnLpdwIKo0ad4rTDWoC PoMQo1Yp87ZpcJERxAwp+9vgq1ttUxJ6Sr03qlrRVc/Le1NPOfh2MilS+wGq4Qzekx1Z 1ys1GwJ39xKzftx/xO4sFfYyq5ZTGciqUcI9HyAjwJaPG0KYBaJc++ZsPRNeSRMstkex VoqQ== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=5QrSQxP5jUcv60OLK9iTQu26ROLgapGunPMgJUevpeY=; b=U/73xwc7t5rgB/GwEBFqY/lVvGlWvM50L3mvf8wtJUJEwsWaGFNAoSKmazZtT7BRMc Ez+WE1n1Nc8PWVL7rdpzS0IBsHlgiv6+y6ID1wHboaE8a33y1l9tmfLzQKtbzTF8ayJB 3mRkM4jElpgUuGthXQGZi/7aMFkIjM9micPJzamBR6nJzdcNtKQKxrI9FyHzlbDqTCEq o+bFwCPzY03K9iT/Ldm4+3uBBB9dwZgcwI+I9ITySgBXK6SR6Vn+d0G6wzZ+2MKHxGEQ LcyjSIMB9N5y4soWqGgYqICeN3ZZqEc0yCr25I6DwTHSLw/5VtY0viy0mxrGrom7aD5A RWmg== X-Gm-Message-State: AOAM530ruZFFPS6HQHxRzNRtkZKPdqhuHIsOoNBuqVXfpw0HiGgUPUX6 qFVSxGVXSMImu9czZl0OKf4= X-Received: by 2002:a65:63d0:: with SMTP id n16mr7909918pgv.432.1630852570317; Sun, 05 Sep 2021 07:36:10 -0700 (PDT) Received: from localhost.localdomain ([141.164.38.246]) by smtp.gmail.com with ESMTPSA id n185sm5186883pfn.171.2021.09.05.07.36.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 05 Sep 2021 07:36:09 -0700 (PDT) From: Yafang Shao To: peterz@infradead.org, mingo@redhat.com, mgorman@suse.de, juri.lelli@redhat.com, vincent.guittot@linaro.org, dietmar.eggemann@arm.com, rostedt@goodmis.org, bsegall@google.com, bristot@redhat.com Cc: linux-kernel@vger.kernel.org, linux-rt-users@vger.kernel.org, achaiken@aurora.tech, Yafang Shao Subject: [PATCH v4 1/8] sched, fair: use __schedstat_set() in set_next_entity() Date: Sun, 5 Sep 2021 14:35:40 +0000 Message-Id: <20210905143547.4668-2-laoar.shao@gmail.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210905143547.4668-1-laoar.shao@gmail.com> References: <20210905143547.4668-1-laoar.shao@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org schedstat_enabled() has been already checked, so we can use __schedstat_set() directly. Signed-off-by: Yafang Shao Acked-by: Mel Gorman Cc: Alison Chaiken --- kernel/sched/fair.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 25f056d87587..1b92eec48745 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -4502,7 +4502,7 @@ set_next_entity(struct cfs_rq *cfs_rq, struct sched_entity *se) */ if (schedstat_enabled() && rq_of(cfs_rq)->cfs.load.weight >= 2*se->load.weight) { - schedstat_set(se->statistics.slice_max, + __schedstat_set(se->statistics.slice_max, max((u64)schedstat_val(se->statistics.slice_max), se->sum_exec_runtime - se->prev_sum_exec_runtime)); } -- 2.18.2