From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753307AbdEJNuu (ORCPT ); Wed, 10 May 2017 09:50:50 -0400 Received: from mail.kernel.org ([198.145.29.136]:59124 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752778AbdEJNut (ORCPT ); Wed, 10 May 2017 09:50:49 -0400 Date: Wed, 10 May 2017 09:50:44 -0400 From: Steven Rostedt To: Peter Zijlstra Cc: Ingo Molnar , LKML , Juri Lelli , Luca Abeni , Daniel Bristot de Oliveira Subject: [RFC][PATCH] sched/deadline: Remove if statement before clearing throttle and yielded Message-ID: <20170510095044.6a04b2dc@gandalf.local.home> X-Mailer: Claws Mail 3.14.0 (GTK+ 2.24.31; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [ This is an RFC as I didn't run any benchmarks. It just seemed a bit weird to me that we would add such a check instead of just clearing these variables out regardless. ] The function replenish_dl_entity() clears dl_throttled and dl_yielded, but checks first if they are set before doing so. As these variables are in the same cache locale of other variables being modified, there's no advantage in checking if they are set before clearing them. But having the compare takes slots away from the branch prediction. Signed-off-by: Steven Rostedt (VMware) --- diff --git a/kernel/sched/deadline.c b/kernel/sched/deadline.c index a2ce590..9748d33 100644 --- a/kernel/sched/deadline.c +++ b/kernel/sched/deadline.c @@ -423,10 +423,8 @@ static void replenish_dl_entity(struct sched_dl_entity *dl_se, dl_se->runtime = pi_se->dl_runtime; } - if (dl_se->dl_yielded) - dl_se->dl_yielded = 0; - if (dl_se->dl_throttled) - dl_se->dl_throttled = 0; + dl_se->dl_yielded = 0; + dl_se->dl_throttled = 0; } /*