Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp383898iof; Mon, 6 Jun 2022 05:28:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzIhPJ895pEqLq33nDJrU6ulf0rIkl086u9eTcOfu7yDqv/hIj+nIP12Ej11s8DQcuS9sFh X-Received: by 2002:a17:90b:3b46:b0:1e2:f8a2:cd03 with SMTP id ot6-20020a17090b3b4600b001e2f8a2cd03mr26557517pjb.229.1654518511142; Mon, 06 Jun 2022 05:28:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654518511; cv=none; d=google.com; s=arc-20160816; b=j2N8fJ+TMpXChYmHjzkgwbvly4NQCpA0vngH4MKRte97VlKmbl/ijQW532/BQvRCtT Sh2OYxxu5j7ltoluz32tL4ohvhArPbraLV/GpFuhLuDIYMsreNx52f46hQZU2SEiuHTe dUen5PxuXwIWEpHaPlFZgt4S6H4czxCcuNSe/X3ntvmQy/uExvVmDgfhc2e92q0gCIj/ gPscjQRIMfkCPZgdmeXavOTJMInHBNix/k//MPLx8Cs80Fdw1QKKxAwyOXMLyukeJXki 6aoOBldG71VJxw+xo+mahMggDMz5EtHBYPIfxHQUa6wnBMAwUT2DHO4AYIo6Lf2gOJTt Ar9g== 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=TYpS9cCZe4FR4oc/36kZaTPU77Nit6eHdNRaR5Virrc=; b=S84UNxiYB/KMhzJ03tyf/eWuXBZgpZC4oY5xcZsn1C9wJMJRTVIMslfIFdBGMYdFo1 kG7t2oe2unZoaAcpqXOpSGvMW4pgkPW5OlCRmb9p5up760V8By1qshsrXExARSs0R60h tSRJWJN1DkiMJdjvvESbnH5hLLw8GpYGD7B3zi74RTz3hJfE1Wp+s4dlucXvDZfj1XPo +hls7llQwX62BKZIChV6uTgn4uFUeoB06dHxKyuWXDNnmI9uLONBmXCkz+TblyAIBZn0 cimvuiSZZsBAxRnmfnzZZOwQvV/w4TAKH5dgMsUAk0IS0tgFoyQgi32tjXMU3ZdSwrDr BM1A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=ZWoYsq1L; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1: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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id s20-20020a056a0008d400b0050d51c28264si22422279pfu.68.2022.06.06.05.28.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Jun 2022 05:28:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=ZWoYsq1L; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1: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: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 7F49729A636; Mon, 6 Jun 2022 05:24:58 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236829AbiFFMYp (ORCPT + 99 others); Mon, 6 Jun 2022 08:24:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47176 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236838AbiFFMYi (ORCPT ); Mon, 6 Jun 2022 08:24:38 -0400 Received: from mail-pf1-x431.google.com (mail-pf1-x431.google.com [IPv6:2607:f8b0:4864:20::431]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A21E124E1E9 for ; Mon, 6 Jun 2022 05:24:37 -0700 (PDT) Received: by mail-pf1-x431.google.com with SMTP id j6so12546793pfe.13 for ; Mon, 06 Jun 2022 05:24:37 -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:mime-version :content-transfer-encoding; bh=TYpS9cCZe4FR4oc/36kZaTPU77Nit6eHdNRaR5Virrc=; b=ZWoYsq1LxjMhfuXkA5IQYKmqfkRcwu6cgLcvwGKJbjmblTsvdiXpTqz9PKNCvNaGwn O1aMO1vDjKM7yjozytN4W5opvvBkQSWfPNaGTabDBKXWCJloEiumZ/2n8eum0vJcsl3P Yf0WAUOyyPf6kd6BIhGVHqJh43chJbGFEkiulDComCUDhVxpzzyOBv3eq2FGLYc4ryEY 0SH/AgbTHcM/nmSm70uNpBhJfrAMXHodUlOCkoC/TvnCNt0NHqYzQSwvjdVOuQWDGmwB qdKxMebiVTF/4qAL9TC/s7eXKlqJVfhuioAU8zECi/qQVoOm8UGQEqeYmAzZ2ZLTTzQC iO3g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=TYpS9cCZe4FR4oc/36kZaTPU77Nit6eHdNRaR5Virrc=; b=OfDAdTQgfuAMCGkcPZbmMvh5vYK+peA5u3qc6pyQrTtJqrzL3yFXr8Ee04oKTWZ5/S HzbpFFlo+Ca3lnLqhBWdfUpZmT0oazypjg+kwmwCJDvbxsCcOsLczAp6TqReUnouEu/O RogpjlMjZLWLHXwTyEyErL8i/rJ2UkDKV++NDwTST8wLz3DH8I5N+4angHM4HX8eDf5J vt5j5v8CjozHPJwvedrVaVw6WKo/2PbliDTjcHxLaI8qrCdSZXHzcJE1enPqinWKPyji 6Skf+0nJY+4o56cfpa1qGD/6OEzD8QWkTj2oIBWBi6HiTFY7NO8/0eYIrm6ayzCBUl9W TlaQ== X-Gm-Message-State: AOAM531gW2PpZAdAYEGvq6H04xgTHt8PJ50ABpt40L5GABT/jqWI9r7m yS7OaoMk0//jqGyAadpHd2rv/2xZz6+XMQ== X-Received: by 2002:a17:902:c941:b0:164:14cb:ce5f with SMTP id i1-20020a170902c94100b0016414cbce5fmr23554092pla.127.1654518266749; Mon, 06 Jun 2022 05:24:26 -0700 (PDT) Received: from archlinux.localdomain ([140.121.198.213]) by smtp.gmail.com with ESMTPSA id v10-20020aa7850a000000b0051868418b06sm8449860pfn.35.2022.06.06.05.24.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Jun 2022 05:24:26 -0700 (PDT) From: Huichun Feng To: Ingo Molnar , Peter Zijlstra , Juri Lelli , Vincent Guittot Cc: Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , Daniel Bristot de Oliveira , Valentin Schneider , linux-kernel@vger.kernel.org (open list:SCHEDULER), jserv@ccns.ncku.edu.tw, Chin-En Lin Subject: [PATCH] sched/fair: avoid redundant hrtimer check Date: Mon, 6 Jun 2022 20:26:12 +0800 Message-Id: <20220606122612.2580930-1-foxhoundsk.tw@gmail.com> X-Mailer: git-send-email 2.36.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE 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 The check is required iff HRTICK is enabled and DOUBLE_TICK is disabled, avoid the redundant check by adding corresponding sched_feat() . Signed-off-by: Huichun Feng --- 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 77b2048a9..80cc1a924 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -4668,7 +4668,7 @@ entity_tick(struct cfs_rq *cfs_rq, struct sched_entity *curr, int queued) /* * don't let the period tick interfere with the hrtick preemption */ - if (!sched_feat(DOUBLE_TICK) && + if (sched_feat(HRTICK) && !sched_feat(DOUBLE_TICK) && hrtimer_active(&rq_of(cfs_rq)->hrtick_timer)) return; #endif -- 2.36.1