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
9590204d
Commit
9590204d
authored
Oct 28, 2005
by
Tony Luck
Browse files
Options
Browse Files
Download
Plain Diff
Pull optimize-ptrace-threads into release branch
parents
8496f2a4
4ac0068f
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
16 deletions
+10
-16
arch/ia64/kernel/ptrace.c
arch/ia64/kernel/ptrace.c
+10
-16
No files found.
arch/ia64/kernel/ptrace.c
View file @
9590204d
...
...
@@ -589,6 +589,7 @@ find_thread_for_addr (struct task_struct *child, unsigned long addr)
{
struct
task_struct
*
g
,
*
p
;
struct
mm_struct
*
mm
;
struct
list_head
*
this
,
*
next
;
int
mm_users
;
if
(
!
(
mm
=
get_task_mm
(
child
)))
...
...
@@ -600,28 +601,21 @@ find_thread_for_addr (struct task_struct *child, unsigned long addr)
goto
out
;
/* not multi-threaded */
/*
* First, traverse the child's thread-list. Good for scalability with
* NPTL-threads.
* Traverse the current process' children list. Every task that
* one attaches to becomes a child. And it is only attached children
* of the debugger that are of interest (ptrace_check_attach checks
* for this).
*/
p
=
child
;
do
{
if
(
thread_matches
(
p
,
addr
))
{
child
=
p
;
goto
out
;
}
if
(
mm_users
--
<=
1
)
goto
out
;
}
while
((
p
=
next_thread
(
p
))
!=
child
);
do_each_thread
(
g
,
p
)
{
if
(
child
->
mm
!=
mm
)
list_for_each_safe
(
this
,
next
,
&
current
->
children
)
{
p
=
list_entry
(
this
,
struct
task_struct
,
sibling
);
if
(
p
->
mm
!=
mm
)
continue
;
if
(
thread_matches
(
p
,
addr
))
{
child
=
p
;
goto
out
;
}
}
while_each_thread
(
g
,
p
);
}
out:
mmput
(
mm
);
return
child
;
...
...
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