Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F149556973
D15246.id42020.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D15246.id42020.diff
View Options
Index: sys/kern/kern_cpu.c
===================================================================
--- sys/kern/kern_cpu.c
+++ sys/kern/kern_cpu.c
@@ -245,6 +245,7 @@
struct cf_saved_freq *saved_freq, *curr_freq;
struct pcpu *pc;
int error, i;
+ u_char pri;
sc = device_get_softc(dev);
error = 0;
@@ -333,6 +334,8 @@
/* Bind to the target CPU before switching. */
pc = cpu_get_pcpu(set->dev);
thread_lock(curthread);
+ pri = curthread->td_priority;
+ sched_lend_prio(curthread, PI_NET - 1);
sched_bind(curthread, pc->pc_cpuid);
thread_unlock(curthread);
CF_DEBUG("setting abs freq %d on %s (cpu %d)\n", set->freq,
@@ -340,6 +343,7 @@
error = CPUFREQ_DRV_SET(set->dev, set);
thread_lock(curthread);
sched_unbind(curthread);
+ sched_unlend_prio(curthread, pri);
thread_unlock(curthread);
if (error) {
goto out;
@@ -357,6 +361,8 @@
/* Bind to the target CPU before switching. */
pc = cpu_get_pcpu(set->dev);
thread_lock(curthread);
+ pri = curthread->td_priority;
+ sched_lend_prio(curthread, PI_NET - 1);
sched_bind(curthread, pc->pc_cpuid);
thread_unlock(curthread);
CF_DEBUG("setting rel freq %d on %s (cpu %d)\n", set->freq,
@@ -364,6 +370,7 @@
error = CPUFREQ_DRV_SET(set->dev, set);
thread_lock(curthread);
sched_unbind(curthread);
+ sched_unlend_prio(curthread, pri);
thread_unlock(curthread);
if (error) {
/* XXX Back out any successful setting? */
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Mar 26, 6:07 AM (7 h, 51 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
30367240
Default Alt Text
D15246.id42020.diff (1 KB)
Attached To
Mode
D15246: Boost thread priority while changing CPU frequency
Attached
Detach File
Event Timeline
Log In to Comment