All of lore.kernel.org
 help / color / mirror / Atom feed
From: Con Kolivas <kernel@kolivas.org>
To: Peter Williams <pwil3058@bigpond.net.au>
Cc: Andrew Morton <akpm@osdl.org>, Linus Torvalds <torvalds@osdl.org>,
	Ingo Molnar <mingo@elte.hu>,
	npiggin@suse.de, "Siddha, Suresh B" <suresh.b.siddha@intel.com>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] sched: Consolidated and improved smpnice patch
Date: Mon, 20 Feb 2006 21:02:11 +1100	[thread overview]
Message-ID: <200602202102.14003.kernel@kolivas.org> (raw)
In-Reply-To: <43F94D71.1040109@bigpond.net.au>

[-- Attachment #1: Type: text/plain, Size: 1593 bytes --]

On Monday 20 February 2006 16:02, Peter Williams wrote:
[snip description]

Hi peter, I've had a good look and have just a couple of comments:

---
 #endif
        int prio, static_prio;
+#ifdef CONFIG_SMP
+       int load_weight;        /* for load balancing purposes */
+#endif
---

Can this be moved up to be part of the other ifdef CONFIG_SMP? Not highly 
significant since it's in a .h file but looks a tiny bit nicer.

---
+/*
+ * Priority weight for load balancing ranges from 1/20 (nice==19) to 459/20 
(RT
+ * priority of 100).
+ */
+#define NICE_TO_LOAD_PRIO(nice) \
+       ((nice >= 0) ? (20 - (nice)) : (20 + (nice) * (nice)))
+#define LOAD_WEIGHT(lp) \
+       (((lp) * SCHED_LOAD_SCALE) / NICE_TO_LOAD_PRIO(0))
+#define NICE_TO_LOAD_WEIGHT(nice)      LOAD_WEIGHT(NICE_TO_LOAD_PRIO(nice))
+#define PRIO_TO_LOAD_WEIGHT(prio)      
NICE_TO_LOAD_WEIGHT(PRIO_TO_NICE(prio))
+#define RTPRIO_TO_LOAD_WEIGHT(rp) \
+       LOAD_WEIGHT(NICE_TO_LOAD_PRIO(-20) + (rp))
---

The weighting seems not related to anything in particular apart from saying 
that -nice values are more heavily weighted. Since you only do this when 
setting the priority of tasks can you link it to the scale of (SCHED_NORMAL) 
tasks' timeslice instead even though that will take a fraction more 
calculation? RTPRIO_TO_LOAD_WEIGHT is fine since there isn't any obvious cpu 
proportion relationship to rt_prio level.

Otherwise, good work, thanks!

> Signed-off-by: Peter Williams <pwil3058@bigpond.com.au>
Signed-off-by: Con Kolivas <kernel@kolivas.org>

Cheers,
Con

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

  reply	other threads:[~2006-02-20 10:03 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-02-20  5:02 [PATCH] sched: Consolidated and improved smpnice patch Peter Williams
2006-02-20 10:02 ` Con Kolivas [this message]
2006-02-20 22:35   ` Peter Williams
2006-02-20 22:41     ` Con Kolivas
2006-02-21  6:21       ` Peter Williams
2006-02-21  9:09         ` Con Kolivas
2006-02-22  0:30           ` Peter Williams

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=200602202102.14003.kernel@kolivas.org \
    --to=kernel@kolivas.org \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=npiggin@suse.de \
    --cc=pwil3058@bigpond.net.au \
    --cc=suresh.b.siddha@intel.com \
    --cc=torvalds@osdl.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.