From patchwork Mon Oct 21 09:06:40 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Juerg Haefliger X-Patchwork-Id: 1180400 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=canonical.com Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46xW3Y28YHz9sPV; Mon, 21 Oct 2019 20:06:49 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1iMTeH-0000jP-FA; Mon, 21 Oct 2019 09:06:45 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1iMTeF-0000jJ-Bm for kernel-team@lists.ubuntu.com; Mon, 21 Oct 2019 09:06:43 +0000 Received: from mail-wr1-f70.google.com ([209.85.221.70]) by youngberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1iMTeF-0006ec-6k for kernel-team@lists.ubuntu.com; Mon, 21 Oct 2019 09:06:43 +0000 Received: by mail-wr1-f70.google.com with SMTP id 4so2746739wrf.19 for ; Mon, 21 Oct 2019 02:06:43 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=2LNgkzY2oEKLkSWLC1ESYe3Uy0S4mdbDD5nbHu4Ey2Y=; b=F69/vDmnwIMrpEahHx39EKq5Tvky6f8PrwQDc0ky5iFYHPKWYgiSLl+jqcDIgqueIG GpM6LMXcu21FlJdjeeWRaaDWysXlRjsadW6OnS4lyCpJx50EjPNy8og8WWXsguQ1Xe1T 3i0peB5GrM1qiIUpKdafrxsTjy31Fl+k8udnAcSBYTpaCn93QwD71pxdSx20k5xSbFn0 MB6v4OF0YIozf1JpTJd7/sAWafKjooGpp21qV9Rl3i1YwbeL6ZUCJaWa384+XpuhOOxP kcE1xcAPsfaPaVBhtf4H6cvalZftVHnz3L4i6o/5StA4NseUnvVnvehIFeCFnTsQvP5x 3t2w== X-Gm-Message-State: APjAAAW2hRZIDATMi8id3v/gqTRr84pThAR/2c/odCKpF6GkTnPNj/mR rKmrQ1neUfAnHtQh3QPatKqeHCK8TJ0AR3jiXFSaQt3qNRgpkWlBU8naIb27xnrdJDPmq7jgpU7 aDiK2mT1GOc+NLcwRXwF898cT5J3yP0etPuqBq1uFuw== X-Received: by 2002:a7b:c846:: with SMTP id c6mr711824wml.68.1571648802531; Mon, 21 Oct 2019 02:06:42 -0700 (PDT) X-Google-Smtp-Source: APXvYqzYB/wbKNZ5dfcret/RuAqfVI7Ykyh+awsjEhyuVsdiBbk1mr/HfMNlWHUZM1Of1z7ibTuzYQ== X-Received: by 2002:a7b:c846:: with SMTP id c6mr711809wml.68.1571648802326; Mon, 21 Oct 2019 02:06:42 -0700 (PDT) Received: from gollum.fritz.box ([194.191.228.147]) by smtp.gmail.com with ESMTPSA id w7sm11480361wmd.22.2019.10.21.02.06.41 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Oct 2019 02:06:41 -0700 (PDT) From: Juerg Haefliger X-Google-Original-From: Juerg Haefliger To: kernel-team@lists.ubuntu.com Subject: [SRU][Bionic][PATCH] sched/fair: Fix -Wunused-but-set-variable warnings Date: Mon, 21 Oct 2019 11:06:40 +0200 Message-Id: <5fe102d92a12afcc126dd14253af68cfca4ab087.1571648800.git.juergh@canonical.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191016211538.25290-3-khalid.elmously@canonical.com> References: <20191016211538.25290-3-khalid.elmously@canonical.com> MIME-Version: 1.0 X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" From: Qian Cai BugLink: https://bugs.launchpad.net/bugs/1832151 Commit: de53fd7aedb1 ("sched/fair: Fix low cpu usage with high throttling by removing expiration of cpu-local slices") introduced a few compilation warnings: kernel/sched/fair.c: In function '__refill_cfs_bandwidth_runtime': kernel/sched/fair.c:4365:6: warning: variable 'now' set but not used [-Wunused-but-set-variable] kernel/sched/fair.c: In function 'start_cfs_bandwidth': kernel/sched/fair.c:4992:6: warning: variable 'overrun' set but not used [-Wunused-but-set-variable] Also, __refill_cfs_bandwidth_runtime() does no longer update the expiration time, so fix the comments accordingly. Signed-off-by: Qian Cai Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Ben Segall Reviewed-by: Dave Chiluk Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: pauld@redhat.com Fixes: de53fd7aedb1 ("sched/fair: Fix low cpu usage with high throttling by removing expiration of cpu-local slices") Link: https://lkml.kernel.org/r/1566326455-8038-1-git-send-email-cai@lca.pw Signed-off-by: Ingo Molnar (backported from commit 763a9ec06c409dcde2a761aac4bb83ff3938e0b3) [juergh: Dropped modifications of start_cfs_bandwidth() (not applicable for Bionic 4.15).] Signed-off-by: Juerg Haefliger Acked-by: Kleber Sacilotto de Souza Acked-by: Khalid Elmously --- kernel/sched/fair.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 7c797c8c8071..6c5766f9e924 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -4429,21 +4429,16 @@ static inline u64 sched_cfs_bandwidth_slice(void) } /* - * Replenish runtime according to assigned quota and update expiration time. - * We use sched_clock_cpu directly instead of rq->clock to avoid adding - * additional synchronization around rq->lock. + * Replenish runtime according to assigned quota. We use sched_clock_cpu + * directly instead of rq->clock to avoid adding additional synchronization + * around rq->lock. * * requires cfs_b->lock */ void __refill_cfs_bandwidth_runtime(struct cfs_bandwidth *cfs_b) { - u64 now; - - if (cfs_b->quota == RUNTIME_INF) - return; - - now = sched_clock_cpu(smp_processor_id()); - cfs_b->runtime = cfs_b->quota; + if (cfs_b->quota != RUNTIME_INF) + cfs_b->runtime = cfs_b->quota; } static inline struct cfs_bandwidth *tg_cfs_bandwidth(struct task_group *tg)