Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
6d22c10f
Commit
6d22c10f
authored
Feb 21, 2002
by
Ingo Molnar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cleanups, speedups and fixes. Added support for non-current set_cpus_allowed().
parent
c96f3323
Changes
9
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
220 additions
and
133 deletions
+220
-133
arch/i386/kernel/i8259.c
arch/i386/kernel/i8259.c
+0
-4
arch/i386/kernel/smp.c
arch/i386/kernel/smp.c
+0
-29
fs/pipe.c
fs/pipe.c
+2
-2
include/asm-i386/hw_irq.h
include/asm-i386/hw_irq.h
+2
-3
include/linux/init_task.h
include/linux/init_task.h
+2
-0
include/linux/sched.h
include/linux/sched.h
+10
-7
init/main.c
init/main.c
+6
-1
kernel/ksyms.c
kernel/ksyms.c
+3
-1
kernel/sched.c
kernel/sched.c
+195
-86
No files found.
arch/i386/kernel/i8259.c
View file @
6d22c10f
...
@@ -79,7 +79,6 @@ BUILD_16_IRQS(0xc) BUILD_16_IRQS(0xd)
...
@@ -79,7 +79,6 @@ BUILD_16_IRQS(0xc) BUILD_16_IRQS(0xd)
* through the ICC by us (IPIs)
* through the ICC by us (IPIs)
*/
*/
#ifdef CONFIG_SMP
#ifdef CONFIG_SMP
BUILD_SMP_INTERRUPT
(
task_migration_interrupt
,
TASK_MIGRATION_VECTOR
)
BUILD_SMP_INTERRUPT
(
reschedule_interrupt
,
RESCHEDULE_VECTOR
)
BUILD_SMP_INTERRUPT
(
reschedule_interrupt
,
RESCHEDULE_VECTOR
)
BUILD_SMP_INTERRUPT
(
invalidate_interrupt
,
INVALIDATE_TLB_VECTOR
)
BUILD_SMP_INTERRUPT
(
invalidate_interrupt
,
INVALIDATE_TLB_VECTOR
)
BUILD_SMP_INTERRUPT
(
call_function_interrupt
,
CALL_FUNCTION_VECTOR
)
BUILD_SMP_INTERRUPT
(
call_function_interrupt
,
CALL_FUNCTION_VECTOR
)
...
@@ -474,9 +473,6 @@ void __init init_IRQ(void)
...
@@ -474,9 +473,6 @@ void __init init_IRQ(void)
*/
*/
set_intr_gate
(
RESCHEDULE_VECTOR
,
reschedule_interrupt
);
set_intr_gate
(
RESCHEDULE_VECTOR
,
reschedule_interrupt
);
/* IPI for task migration */
set_intr_gate
(
TASK_MIGRATION_VECTOR
,
task_migration_interrupt
);
/* IPI for invalidation */
/* IPI for invalidation */
set_intr_gate
(
INVALIDATE_TLB_VECTOR
,
invalidate_interrupt
);
set_intr_gate
(
INVALIDATE_TLB_VECTOR
,
invalidate_interrupt
);
...
...
arch/i386/kernel/smp.c
View file @
6d22c10f
...
@@ -485,35 +485,6 @@ void flush_tlb_all(void)
...
@@ -485,35 +485,6 @@ void flush_tlb_all(void)
do_flush_tlb_all_local
();
do_flush_tlb_all_local
();
}
}
static
spinlock_t
migration_lock
=
SPIN_LOCK_UNLOCKED
;
static
task_t
*
new_task
;
/*
* This function sends a 'task migration' IPI to another CPU.
* Must be called from syscall contexts, with interrupts *enabled*.
*/
void
smp_migrate_task
(
int
cpu
,
task_t
*
p
)
{
/*
* The target CPU will unlock the migration spinlock:
*/
_raw_spin_lock
(
&
migration_lock
);
new_task
=
p
;
send_IPI_mask
(
1
<<
cpu
,
TASK_MIGRATION_VECTOR
);
}
/*
* Task migration callback.
*/
asmlinkage
void
smp_task_migration_interrupt
(
void
)
{
task_t
*
p
;
ack_APIC_irq
();
p
=
new_task
;
_raw_spin_unlock
(
&
migration_lock
);
sched_task_migrated
(
p
);
}
/*
/*
* this function sends a 'reschedule' IPI to another CPU.
* this function sends a 'reschedule' IPI to another CPU.
* it goes straight through and wastes no time serializing
* it goes straight through and wastes no time serializing
...
...
fs/pipe.c
View file @
6d22c10f
...
@@ -116,7 +116,7 @@ pipe_read(struct file *filp, char *buf, size_t count, loff_t *ppos)
...
@@ -116,7 +116,7 @@ pipe_read(struct file *filp, char *buf, size_t count, loff_t *ppos)
* writers synchronously that there is more
* writers synchronously that there is more
* room.
* room.
*/
*/
wake_up_interruptible
_sync
(
PIPE_WAIT
(
*
inode
));
wake_up_interruptible
(
PIPE_WAIT
(
*
inode
));
if
(
!
PIPE_EMPTY
(
*
inode
))
if
(
!
PIPE_EMPTY
(
*
inode
))
BUG
();
BUG
();
goto
do_more_read
;
goto
do_more_read
;
...
@@ -214,7 +214,7 @@ pipe_write(struct file *filp, const char *buf, size_t count, loff_t *ppos)
...
@@ -214,7 +214,7 @@ pipe_write(struct file *filp, const char *buf, size_t count, loff_t *ppos)
* is going to give up this CPU, so it doesnt have
* is going to give up this CPU, so it doesnt have
* to do idle reschedules.
* to do idle reschedules.
*/
*/
wake_up_interruptible
_sync
(
PIPE_WAIT
(
*
inode
));
wake_up_interruptible
(
PIPE_WAIT
(
*
inode
));
PIPE_WAITING_WRITERS
(
*
inode
)
++
;
PIPE_WAITING_WRITERS
(
*
inode
)
++
;
pipe_wait
(
inode
);
pipe_wait
(
inode
);
PIPE_WAITING_WRITERS
(
*
inode
)
--
;
PIPE_WAITING_WRITERS
(
*
inode
)
--
;
...
...
include/asm-i386/hw_irq.h
View file @
6d22c10f
...
@@ -35,14 +35,13 @@
...
@@ -35,14 +35,13 @@
* into a single vector (CALL_FUNCTION_VECTOR) to save vector space.
* into a single vector (CALL_FUNCTION_VECTOR) to save vector space.
* TLB, reschedule and local APIC vectors are performance-critical.
* TLB, reschedule and local APIC vectors are performance-critical.
*
*
* Vectors 0xf0-0xf
9
are free (reserved for future Linux use).
* Vectors 0xf0-0xf
a
are free (reserved for future Linux use).
*/
*/
#define SPURIOUS_APIC_VECTOR 0xff
#define SPURIOUS_APIC_VECTOR 0xff
#define ERROR_APIC_VECTOR 0xfe
#define ERROR_APIC_VECTOR 0xfe
#define INVALIDATE_TLB_VECTOR 0xfd
#define INVALIDATE_TLB_VECTOR 0xfd
#define RESCHEDULE_VECTOR 0xfc
#define RESCHEDULE_VECTOR 0xfc
#define TASK_MIGRATION_VECTOR 0xfb
#define CALL_FUNCTION_VECTOR 0xfb
#define CALL_FUNCTION_VECTOR 0xfa
/*
/*
* Local APIC timer IRQ vector is on a different priority level,
* Local APIC timer IRQ vector is on a different priority level,
...
...
include/linux/init_task.h
View file @
6d22c10f
...
@@ -52,6 +52,8 @@
...
@@ -52,6 +52,8 @@
mm: NULL, \
mm: NULL, \
active_mm: &init_mm, \
active_mm: &init_mm, \
run_list: LIST_HEAD_INIT(tsk.run_list), \
run_list: LIST_HEAD_INIT(tsk.run_list), \
migration_list: LIST_HEAD_INIT(tsk.migration_list), \
migration_sem: __MUTEX_INITIALIZER(tsk.migration_sem), \
time_slice: HZ, \
time_slice: HZ, \
next_task: &tsk, \
next_task: &tsk, \
prev_task: &tsk, \
prev_task: &tsk, \
...
...
include/linux/sched.h
View file @
6d22c10f
...
@@ -150,8 +150,7 @@ extern void update_process_times(int user);
...
@@ -150,8 +150,7 @@ extern void update_process_times(int user);
extern
void
update_one_process
(
struct
task_struct
*
p
,
unsigned
long
user
,
extern
void
update_one_process
(
struct
task_struct
*
p
,
unsigned
long
user
,
unsigned
long
system
,
int
cpu
);
unsigned
long
system
,
int
cpu
);
extern
void
scheduler_tick
(
int
user_tick
,
int
system
);
extern
void
scheduler_tick
(
int
user_tick
,
int
system
);
extern
void
sched_task_migrated
(
struct
task_struct
*
p
);
extern
void
migration_init
(
void
);
extern
void
smp_migrate_task
(
int
cpu
,
task_t
*
task
);
extern
unsigned
long
cache_decay_ticks
;
extern
unsigned
long
cache_decay_ticks
;
...
@@ -286,6 +285,10 @@ struct task_struct {
...
@@ -286,6 +285,10 @@ struct task_struct {
wait_queue_head_t
wait_chldexit
;
/* for wait4() */
wait_queue_head_t
wait_chldexit
;
/* for wait4() */
struct
completion
*
vfork_done
;
/* for vfork() */
struct
completion
*
vfork_done
;
/* for vfork() */
list_t
migration_list
;
struct
semaphore
migration_sem
;
unsigned
long
rt_priority
;
unsigned
long
rt_priority
;
unsigned
long
it_real_value
,
it_prof_value
,
it_virt_value
;
unsigned
long
it_real_value
,
it_prof_value
,
it_virt_value
;
unsigned
long
it_real_incr
,
it_prof_incr
,
it_virt_incr
;
unsigned
long
it_real_incr
,
it_prof_incr
,
it_virt_incr
;
...
@@ -382,7 +385,12 @@ do { if (atomic_dec_and_test(&(tsk)->usage)) __put_task_struct(tsk); } while(0)
...
@@ -382,7 +385,12 @@ do { if (atomic_dec_and_test(&(tsk)->usage)) __put_task_struct(tsk); } while(0)
*/
*/
#define _STK_LIM (8*1024*1024)
#define _STK_LIM (8*1024*1024)
#if CONFIG_SMP
extern
void
set_cpus_allowed
(
task_t
*
p
,
unsigned
long
new_mask
);
extern
void
set_cpus_allowed
(
task_t
*
p
,
unsigned
long
new_mask
);
#else
# define set_cpus_allowed(p, new_mask) do { } while (0)
#endif
extern
void
set_user_nice
(
task_t
*
p
,
long
nice
);
extern
void
set_user_nice
(
task_t
*
p
,
long
nice
);
extern
int
task_prio
(
task_t
*
p
);
extern
int
task_prio
(
task_t
*
p
);
extern
int
task_nice
(
task_t
*
p
);
extern
int
task_nice
(
task_t
*
p
);
...
@@ -460,7 +468,6 @@ extern unsigned long prof_len;
...
@@ -460,7 +468,6 @@ extern unsigned long prof_len;
extern
unsigned
long
prof_shift
;
extern
unsigned
long
prof_shift
;
extern
void
FASTCALL
(
__wake_up
(
wait_queue_head_t
*
q
,
unsigned
int
mode
,
int
nr
));
extern
void
FASTCALL
(
__wake_up
(
wait_queue_head_t
*
q
,
unsigned
int
mode
,
int
nr
));
extern
void
FASTCALL
(
__wake_up_sync
(
wait_queue_head_t
*
q
,
unsigned
int
mode
,
int
nr
));
extern
void
FASTCALL
(
sleep_on
(
wait_queue_head_t
*
q
));
extern
void
FASTCALL
(
sleep_on
(
wait_queue_head_t
*
q
));
extern
long
FASTCALL
(
sleep_on_timeout
(
wait_queue_head_t
*
q
,
extern
long
FASTCALL
(
sleep_on_timeout
(
wait_queue_head_t
*
q
,
signed
long
timeout
));
signed
long
timeout
));
...
@@ -474,13 +481,9 @@ extern void FASTCALL(sched_exit(task_t * p));
...
@@ -474,13 +481,9 @@ extern void FASTCALL(sched_exit(task_t * p));
#define wake_up(x) __wake_up((x),TASK_UNINTERRUPTIBLE | TASK_INTERRUPTIBLE, 1)
#define wake_up(x) __wake_up((x),TASK_UNINTERRUPTIBLE | TASK_INTERRUPTIBLE, 1)
#define wake_up_nr(x, nr) __wake_up((x),TASK_UNINTERRUPTIBLE | TASK_INTERRUPTIBLE, nr)
#define wake_up_nr(x, nr) __wake_up((x),TASK_UNINTERRUPTIBLE | TASK_INTERRUPTIBLE, nr)
#define wake_up_all(x) __wake_up((x),TASK_UNINTERRUPTIBLE | TASK_INTERRUPTIBLE, 0)
#define wake_up_all(x) __wake_up((x),TASK_UNINTERRUPTIBLE | TASK_INTERRUPTIBLE, 0)
#define wake_up_sync(x) __wake_up_sync((x),TASK_UNINTERRUPTIBLE | TASK_INTERRUPTIBLE, 1)
#define wake_up_sync_nr(x, nr) __wake_up_sync((x),TASK_UNINTERRUPTIBLE | TASK_INTERRUPTIBLE, nr)
#define wake_up_interruptible(x) __wake_up((x),TASK_INTERRUPTIBLE, 1)
#define wake_up_interruptible(x) __wake_up((x),TASK_INTERRUPTIBLE, 1)
#define wake_up_interruptible_nr(x, nr) __wake_up((x),TASK_INTERRUPTIBLE, nr)
#define wake_up_interruptible_nr(x, nr) __wake_up((x),TASK_INTERRUPTIBLE, nr)
#define wake_up_interruptible_all(x) __wake_up((x),TASK_INTERRUPTIBLE, 0)
#define wake_up_interruptible_all(x) __wake_up((x),TASK_INTERRUPTIBLE, 0)
#define wake_up_interruptible_sync(x) __wake_up_sync((x),TASK_INTERRUPTIBLE, 1)
#define wake_up_interruptible_sync_nr(x) __wake_up_sync((x),TASK_INTERRUPTIBLE, nr)
asmlinkage
long
sys_wait4
(
pid_t
pid
,
unsigned
int
*
stat_addr
,
int
options
,
struct
rusage
*
ru
);
asmlinkage
long
sys_wait4
(
pid_t
pid
,
unsigned
int
*
stat_addr
,
int
options
,
struct
rusage
*
ru
);
extern
int
in_group_p
(
gid_t
);
extern
int
in_group_p
(
gid_t
);
...
...
init/main.c
View file @
6d22c10f
...
@@ -413,7 +413,12 @@ static void __init do_initcalls(void)
...
@@ -413,7 +413,12 @@ static void __init do_initcalls(void)
*/
*/
static
void
__init
do_basic_setup
(
void
)
static
void
__init
do_basic_setup
(
void
)
{
{
/*
* Let the per-CPU migration threads start up:
*/
#if CONFIG_SMP
migration_init
();
#endif
/*
/*
* Tell the world that we're going to be the grim
* Tell the world that we're going to be the grim
* reaper of innocent orphaned children.
* reaper of innocent orphaned children.
...
...
kernel/ksyms.c
View file @
6d22c10f
...
@@ -443,7 +443,6 @@ EXPORT_SYMBOL(iomem_resource);
...
@@ -443,7 +443,6 @@ EXPORT_SYMBOL(iomem_resource);
/* process management */
/* process management */
EXPORT_SYMBOL
(
complete_and_exit
);
EXPORT_SYMBOL
(
complete_and_exit
);
EXPORT_SYMBOL
(
__wake_up
);
EXPORT_SYMBOL
(
__wake_up
);
EXPORT_SYMBOL
(
__wake_up_sync
);
EXPORT_SYMBOL
(
wake_up_process
);
EXPORT_SYMBOL
(
wake_up_process
);
EXPORT_SYMBOL
(
sleep_on
);
EXPORT_SYMBOL
(
sleep_on
);
EXPORT_SYMBOL
(
sleep_on_timeout
);
EXPORT_SYMBOL
(
sleep_on_timeout
);
...
@@ -458,6 +457,9 @@ EXPORT_SYMBOL(sys_sched_yield);
...
@@ -458,6 +457,9 @@ EXPORT_SYMBOL(sys_sched_yield);
EXPORT_SYMBOL
(
set_user_nice
);
EXPORT_SYMBOL
(
set_user_nice
);
EXPORT_SYMBOL
(
task_nice
);
EXPORT_SYMBOL
(
task_nice
);
EXPORT_SYMBOL_GPL
(
idle_cpu
);
EXPORT_SYMBOL_GPL
(
idle_cpu
);
#if CONFIG_SMP
EXPORT_SYMBOL_GPL
(
set_cpus_allowed
);
#endif
EXPORT_SYMBOL
(
jiffies
);
EXPORT_SYMBOL
(
jiffies
);
EXPORT_SYMBOL
(
xtime
);
EXPORT_SYMBOL
(
xtime
);
EXPORT_SYMBOL
(
do_gettimeofday
);
EXPORT_SYMBOL
(
do_gettimeofday
);
...
...
kernel/sched.c
View file @
6d22c10f
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment