login
Login
/
Register
Search
Search this site:
Forums
News
Blogs
Features
Site
Home
»
Mailing list archives
»
linux-kernel
»
2010
»
April
»
15
Re: [RFC][PATCH 02/11] sched: SCHED_DEADLINE policy implementation.
view
thread
Previous message: [
thread
] [
date
] [
author
]
Next message: [thread] [
date
] [
author
]
[view in full thread]
From: Peter Zijlstra
Subject:
Re: [RFC][PATCH 02/11] sched: SCHED_DEADLINE policy implementation.
Date: Thursday, April 15, 2010 - 12:34 am
On Tue, 2010-04-13 at 14:55 -0400, Steven Rostedt wrote:
quoted text
> On Tue, 2010-04-13 at 20:22 +0200, Peter Zijlstra wrote: > > On Sun, 2010-02-28 at 20:17 +0100, Raistlin wrote: > > > +/* > > > + * Here we check if --at time t-- a task (which is probably being > > > + * [re]activated or, in general, enqueued) can use its remaining runtime > > > + * and its current deadline _without_ exceeding the bandwidth it is > > > + * assigned (function returns true if it can). > > > + * > > > + * For this to hold, we must check if: > > > + * runtime / (deadline - t) < dl_runtime / dl_deadline . > > > + */ > > > +static bool dl_check_bandwidth(struct sched_dl_entity *dl_se, u64 t) > > > +{ > > > + u64 left, right; > > > + > > > + /* > > > + * left and right are the two sides of the equation above, > > > + * after a bit of shuffling to use multiplications instead > > > + * of divisions. > > > + */ > > > + left = dl_se->dl_deadline * dl_se->runtime; > > > + right = (dl_se->deadline - t) * dl_se->dl_runtime; > > > + > > > + return dl_time_before(left, right); > > > +} > > > > So what happens when we overflow u64? > > Is the resolution in nanosecs starting from zero? If so, then we don't > need to worry about overflow for 583 years? And that is only if the > difference in time is greater than 292 years since dl_time_before() does > a: > > (s64)(a - b) < 0 > > The (s64)(a - b) returns the difference even on overflow as long as the > difference is not greater than 2^63
Its a multiplication of two u64, that's a lot easier to overflow. --
unsubscribe notice
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to
majordomo@vger.kernel.org
More majordomo info at
http://vger.kernel.org/majordomo-info.html
Please read the FAQ at
http://www.tux.org/lkml/
Previous message: [
thread
] [
date
] [
author
]
Next message: [thread] [
date
] [
author
]
Messages in current thread:
[RFC][PATCH 0/11] sched: SCHED_DEADLINE v2
, Raistlin
, (Sun Feb 28, 12:06 pm)
[RFC][PATCH 01/11] sched: add sched_class->task_dead.
, Raistlin
, (Sun Feb 28, 12:15 pm)
[RFC][PATCH 02/11] sched: SCHED_DEADLINE policy implementa ...
, Raistlin
, (Sun Feb 28, 12:17 pm)
[RFC][PATCH 03/11] sched: add extended scheduling interface.
, Raistlin
, (Sun Feb 28, 12:18 pm)
[RFC][PATCH 04/11] sched: add resource limits for -deadlin ...
, Raistlin
, (Sun Feb 28, 12:19 pm)
[RFC][PATCH 05/11] sched: add a syscall to wait for the ne ...
, Raistlin
, (Sun Feb 28, 12:20 pm)
[RFC][PATCH 06/11] sched: add the sched-debug bits for sch ...
, Raistlin
, (Sun Feb 28, 12:22 pm)
[RFC][PATCH 07/11] sched: add latency tracing for -deadlin ...
, Raistlin
, (Sun Feb 28, 12:23 pm)
[RFC][PATCH 08/11] sched: send SIGXCPU at -deadline task o ...
, Raistlin
, (Sun Feb 28, 12:24 pm)
[RFC][PATCH 09/11] sched: first draft of deadline inheritance.
, Raistlin
, (Sun Feb 28, 12:26 pm)
[RFC][PATCH 10/11] sched: add bandwidth management for sch ...
, Raistlin
, (Sun Feb 28, 12:27 pm)
[RFC][PATCH 11/11] sched: add sched_dl documentation.
, Raistlin
, (Sun Feb 28, 12:28 pm)
Re: [RFC][PATCH 02/11] sched: SCHED_DEADLINE policy implem ...
, Peter Zijlstra
, (Tue Apr 13, 11:22 am)
Re: [RFC][PATCH 02/11] sched: SCHED_DEADLINE policy implem ...
, Peter Zijlstra
, (Tue Apr 13, 11:22 am)
Re: [RFC][PATCH 02/11] sched: SCHED_DEADLINE policy implem ...
, Peter Zijlstra
, (Tue Apr 13, 11:22 am)
Re: [RFC][PATCH 02/11] sched: SCHED_DEADLINE policy implem ...
, Peter Zijlstra
, (Tue Apr 13, 11:22 am)
Re: [RFC][PATCH 02/11] sched: SCHED_DEADLINE policy implem ...
, Peter Zijlstra
, (Tue Apr 13, 11:22 am)
Re: [RFC][PATCH 08/11] sched: send SIGXCPU at -deadline ta ...
, Peter Zijlstra
, (Tue Apr 13, 11:22 am)
Re: [RFC][PATCH 02/11] sched: SCHED_DEADLINE policy implem ...
, Steven Rostedt
, (Tue Apr 13, 11:55 am)
Re: [RFC][PATCH 08/11] sched: send SIGXCPU at -deadline ta ...
, Oleg Nesterov
, (Tue Apr 13, 12:32 pm)
Re: [RFC][PATCH 09/11] sched: first draft of deadline inhe ...
, Peter Zijlstra
, (Wed Apr 14, 1:25 am)
Re: [RFC][PATCH 09/11] sched: first draft of deadline inhe ...
, Peter Zijlstra
, (Wed Apr 14, 2:45 am)
Re: [RFC][PATCH 10/11] sched: add bandwidth management for ...
, Peter Zijlstra
, (Wed Apr 14, 3:09 am)
Re: [RFC][PATCH 0/11] sched: SCHED_DEADLINE v2
, Peter Zijlstra
, (Wed Apr 14, 3:17 am)
Re: [RFC][PATCH 02/11] sched: SCHED_DEADLINE policy implem ...
, Peter Zijlstra
, (Thu Apr 15, 12:34 am)
Navigation
Create content
Mailing list archives
Recent posts
Popular discussions
linux-kernel
:
Alan Cox
Re: Please add ZFS support (from GPL sources)
Trenton D. Adams
Re: Flash IO slow 1.5 MB/s
Rafael J. Wysocki
[Bug #11287] Regression in 2.6.27-rc2 in acpi_processor_init()
Bart Van Assche
Re: Is gcc thread-unsafe?
Ingo Molnar
Re: [PATCH] x86: silence section mismatch warning - uv_cpu_init
dragonflybsd-commit
:
Simon 'corecode' Schubert
Re: cvs commit: src/bin/hostname hostname.1 src/bin/domainname domainname....
Sepherosa Ziehau
cvs commit: src/sys/dev/netif/ral rt2560.c
Sepherosa Ziehau
cvs commit: src/sys/dev/netif/ural if_ural.c if_uralreg.h
Chris Pressey
Re: cvs commit: src/lib/libutil _secure_path.c auth.c fparseln.c humanize_number.c...
Joerg Sonnenberger
Re: cvs commit: src/sys/kern vfs_syscalls.c
git
:
Mark Junker
git on MacOSX and files with decomposed utf-8 file names
Junio C Hamano
Re: git-svnimport
Mark Burton
Re: Sporadic BSOD with msys git?
Junio C Hamano
Re: [PATCH] Detached HEAD (experimental)
Johannes Schindelin
Re: [PATCH] Fix approxidate("never") to always return 0
linux-ath5k-devel
:
Bruno Randolf
[ath5k-devel] [PATCH] ath5k: treat RXORN as non-fatal
Jiri Moravec
[ath5k-devel] can't add ath5k into bridge on kernel >=2.6.33
Lukáš Turek
Re: [ath5k-devel] Atheros HW/cfg80211 ignore nonUS regdom with "EEPROM regdomain: ...
Bob Copeland
Re: [ath5k-devel] [PATCH] ath5k: fix detection of jumbo frames
Bob Copeland
Re: [ath5k-devel] Transfers stall with ath5k on compat-wireless drivers
openbsd-source-changes
:
Marc Espie
CVS: cvs.openbsd.org: src
David Gwynne
CVS: cvs.openbsd.org: src
Theo de Raadt
CVS: cvs.openbsd.org: www
Igor Sobrado
CVS: cvs.openbsd.org: src
Brad Smith
CVS: cvs.openbsd.org: src
Colocation donated by:
Syndicate