mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Afzal Mohammed <afzal.mohd.ma@gmail.com>
To: linux-kernel@vger.kernel.org
Cc: Ingo Molnar <mingo@redhat.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Afzal Mohammed <afzal.mohd.ma@gmail.com>
Subject: [PATCH v2] sched,fair: Remove > u32 weight handling for delta
Date: Mon,  6 Jul 2015 23:49:15 +0530	[thread overview]
Message-ID: <1436206755-2540-1-git-send-email-afzal.mohd.ma@gmail.com> (raw)
In-Reply-To: <20150706133407.GA5861@afzalpc>

scaled down weight 'fact' would not be > u32 rather than unlikely as the
weight being passed in __calc_delta() is either 'se->load.weight' or
NICE_O_LOAD. 'se->load.weight' would be one of the values of
prio_to_weight[] in the case of task, while in the case of task group it
would be capped to MAX_SHARES. All those possible values can fit in u32.
Hence remove the initial > u32 handling on 'fact'.

Signed-off-by: Afzal Mohammed <afzal.mohd.ma@gmail.com>
---

v2: expand change log on why weight can fit in u32, remove incorrect
    comments.

 kernel/sched/fair.c | 7 -------
 1 file changed, 7 deletions(-)

diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 65c8f3ebdc3c..22cf3958bbac 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -218,13 +218,6 @@ static u64 __calc_delta(u64 delta_exec, unsigned long weight, struct load_weight
 
 	__update_inv_weight(lw);
 
-	if (unlikely(fact >> 32)) {
-		while (fact >> 32) {
-			fact >>= 1;
-			shift--;
-		}
-	}
-
 	/* hint to use a 32x32->64 mul */
 	fact = (u64)(u32)fact * lw->inv_weight;
 
-- 
2.1.4


  parent reply	other threads:[~2015-07-06 18:19 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-06  2:44 [PATCH] " Afzal Mohammed
2015-07-06 11:44 ` Peter Zijlstra
2015-07-06 13:34   ` Afzal Mohammed
2015-07-06 14:39     ` Afzal Mohammed
2015-07-06 18:19     ` Afzal Mohammed [this message]
2015-08-12 11:12       ` [PATCH v2] " Afzal Mohammed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1436206755-2540-1-git-send-email-afzal.mohd.ma@gmail.com \
    --to=afzal.mohd.ma@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®