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
nexedi
linux
Commits
4b035e53
Commit
4b035e53
authored
Mar 14, 2002
by
Linus Torvalds
Committed by
Kai Germaschewski
Mar 14, 2002
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cleanup: use list macros for task list
parent
3154d91d
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
17 additions
and
16 deletions
+17
-16
arch/i386/kernel/smpboot.c
arch/i386/kernel/smpboot.c
+1
-1
include/linux/init_task.h
include/linux/init_task.h
+1
-2
include/linux/sched.h
include/linux/sched.h
+13
-11
kernel/exit.c
kernel/exit.c
+2
-2
No files found.
arch/i386/kernel/smpboot.c
View file @
4b035e53
...
...
@@ -828,7 +828,7 @@ static void __init do_boot_cpu (int apicid)
* We remove it from the pidhash and the runqueue
* once we got the process:
*/
idle
=
init_task
.
prev_task
;
idle
=
prev_task
(
&
init_task
)
;
if
(
!
idle
)
panic
(
"No idle process for CPU %d"
,
cpu
);
...
...
include/linux/init_task.h
View file @
4b035e53
...
...
@@ -53,8 +53,7 @@
active_mm: &init_mm, \
run_list: LIST_HEAD_INIT(tsk.run_list), \
time_slice: HZ, \
next_task: &tsk, \
prev_task: &tsk, \
tasks: LIST_HEAD_INIT(tsk.tasks), \
real_parent: &tsk, \
parent: &tsk, \
children: LIST_HEAD_INIT(tsk.children), \
...
...
include/linux/sched.h
View file @
4b035e53
...
...
@@ -250,7 +250,7 @@ struct task_struct {
unsigned
long
cpus_allowed
;
unsigned
int
time_slice
;
struct
task_struct
*
next_task
,
*
prev_task
;
struct
list_head
tasks
;
struct
mm_struct
*
mm
,
*
active_mm
;
struct
list_head
local_pages
;
...
...
@@ -718,18 +718,17 @@ do { \
__ret; \
})
#define remove_parent(p) list_del_init(&(p)->sibling)
#define add_parent(p, parent) list_add_tail(&(p)->sibling,&(parent)->children)
#define REMOVE_LINKS(p) do { \
(p)->next_task->prev_task = (p)->prev_task; \
(p)->prev_task->next_task = (p)->next_task; \
list_del_init(&(p)->sibling); \
list_del_init(&(p)->tasks); \
remove_parent(p); \
} while (0)
#define SET_LINKS(p) do { \
(p)->next_task = &init_task; \
(p)->prev_task = init_task.prev_task; \
init_task.prev_task->next_task = (p); \
init_task.prev_task = (p); \
list_add_tail(&(p)->sibling,&(p)->parent->children); \
#define SET_LINKS(p) do { \
list_add_tail(&(p)->tasks,&init_task.tasks); \
add_parent(p, (p)->parent); \
} while (0)
static
inline
struct
task_struct
*
eldest_child
(
struct
task_struct
*
p
)
...
...
@@ -756,8 +755,11 @@ static inline struct task_struct *younger_sibling(struct task_struct *p)
return
list_entry
(
p
->
sibling
.
next
,
struct
task_struct
,
sibling
);
}
#define next_task(p) list_entry((p)->tasks.next, struct task_struct, tasks)
#define prev_task(p) list_entry((p)->tasks.prev, struct task_struct, tasks)
#define for_each_task(p) \
for (p = &init_task ; (p =
p->next_task
) != &init_task ; )
for (p = &init_task ; (p =
next_task(p)
) != &init_task ; )
#define for_each_thread(task) \
for (task = next_thread(current) ; task != current ; task = next_thread(task))
...
...
kernel/exit.c
View file @
4b035e53
...
...
@@ -612,9 +612,9 @@ asmlinkage long sys_wait4(pid_t pid,unsigned int * stat_addr, int options, struc
retval
=
p
->
pid
;
if
(
p
->
real_parent
!=
p
->
parent
)
{
write_lock_irq
(
&
tasklist_lock
);
REMOVE_LINKS
(
p
);
remove_parent
(
p
);
p
->
parent
=
p
->
real_parent
;
SET_LINKS
(
p
);
add_parent
(
p
,
p
->
parent
);
do_notify_parent
(
p
,
SIGCHLD
);
write_unlock_irq
(
&
tasklist_lock
);
}
else
...
...
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