Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp6550128ybx; Mon, 11 Nov 2019 10:47:43 -0800 (PST) X-Google-Smtp-Source: APXvYqz/UVtpMuKYIK9LEK25Cxcc6juamNGj8iZS9txfQ+50oawYEI9k9tHPA182pBRUHoHQYMSj X-Received: by 2002:aa7:d40b:: with SMTP id z11mr27932773edq.142.1573498063603; Mon, 11 Nov 2019 10:47:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573498063; cv=none; d=google.com; s=arc-20160816; b=KjIpqYkoGlYz+rsoKNRk7aaulIkam9cMx9uC5SWipxykYEfNq4oIY1YAPVzDrkIyx7 UIbZHzCLILCVR9tKP+6OmLmcFGYaCAvndH5iEBm3ZAWV6LYtRx4KwvAMvRtRH90TRjHM 6r7cDT2hH2W4n57avasUB9jm1XdoqqzmxuLCxFlyxbsFIQ87QFaIQ5w5Cj15DkTT6BUV l6t0XyRqHU3lZGpVqqS7RxKwuKlX/7o5TohrQ1Dpo8ZgmT59TVpJ642IggRfDvbsocP/ JkKx0G1JM2cLQANaLBaBRtmM7CF9bruaUghUTqhob2OAImqn6xF7djb2oqbyua8SgPJA 8SwA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=HlJtzL0itNyEmtIiG8RVmjdYsc6/zqGOAb/mFcLjx0o=; b=f6uq9rwtaNJK7X7plW6m88jMfZ0KMt8jj2pBCpaDcAFwle2rZpCfE07L5vcPO4I2+L aW6LBNfA/x8VG86QTVMzDc2e9WAXIaUeGvp26FzsVaw+rH/zOmJOrg320D/tRQ8kUaZr DE2yGiAZwsu/oUCLxd8PqFf1nDpgtcXpkqsYVTmksp9UythNfMgrNWl6Dv1Sy2sz7Rwb w90r1YBaCGoxOPXlea2u07YK2E1cTaZp3GeqMcpqz69jq+eLwUCAEWVPvZTEtL0aEtYE L3/2g4oFNRvouZhDDJfGZpJNWy82qptqHn7hEwFh/+B2V6ljJYo2QicFNuzGFVGTAV7q lyVA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=njT7YFY9; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x19si9847569ejv.94.2019.11.11.10.47.19; Mon, 11 Nov 2019 10:47:43 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=njT7YFY9; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727083AbfKKSnq (ORCPT + 99 others); Mon, 11 Nov 2019 13:43:46 -0500 Received: from mail.kernel.org ([198.145.29.99]:35146 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729648AbfKKSnm (ORCPT ); Mon, 11 Nov 2019 13:43:42 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 3A04320659; Mon, 11 Nov 2019 18:43:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1573497821; bh=LeSW+nA1C/mdMbUqhaZ3bV3dUN0zhMt/01LMgdpLGbk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=njT7YFY9ZQms8QwSML0Q/DpHc0NIMvtKWG8BoCK0Yky96M4mRnGXpOcxORfQPUlfT D361XSK8FWFLmtbDQ0lKRBGNAEWppeRWkCIE4bvZ8a+UwD+LTqL2DBpWCeMEBObfyl uikicHIhalHkeoZ83DYqLIUD07SPm+5fy4M3rVsg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Qian Cai , "Peter Zijlstra (Intel)" , Ben Segall , Dave Chiluk , Linus Torvalds , Thomas Gleixner , pauld@redhat.com, Ingo Molnar Subject: [PATCH 4.19 066/125] sched/fair: Fix -Wunused-but-set-variable warnings Date: Mon, 11 Nov 2019 19:28:25 +0100 Message-Id: <20191111181449.035205987@linuxfoundation.org> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191111181438.945353076@linuxfoundation.org> References: <20191111181438.945353076@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Qian Cai commit 763a9ec06c409dcde2a761aac4bb83ff3938e0b3 upstream. 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 Signed-off-by: Greg Kroah-Hartman --- kernel/sched/fair.c | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -4305,21 +4305,16 @@ static inline u64 sched_cfs_bandwidth_sl } /* - * 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) @@ -4924,15 +4919,13 @@ static void init_cfs_rq_runtime(struct c void start_cfs_bandwidth(struct cfs_bandwidth *cfs_b) { - u64 overrun; - lockdep_assert_held(&cfs_b->lock); if (cfs_b->period_active) return; cfs_b->period_active = 1; - overrun = hrtimer_forward_now(&cfs_b->period_timer, cfs_b->period); + hrtimer_forward_now(&cfs_b->period_timer, cfs_b->period); hrtimer_start_expires(&cfs_b->period_timer, HRTIMER_MODE_ABS_PINNED); }