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
e25ff11f
Commit
e25ff11f
authored
May 07, 2014
by
Al Viro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
split the slow path in acct_process() off
Signed-off-by:
Al Viro
<
viro@zeniv.linux.org.uk
>
parent
cdd37e23
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
22 deletions
+28
-22
kernel/acct.c
kernel/acct.c
+28
-22
No files found.
kernel/acct.c
View file @
e25ff11f
...
...
@@ -599,34 +599,35 @@ void acct_collect(long exitcode, int group_dead)
spin_unlock_irq
(
&
current
->
sighand
->
siglock
);
}
static
void
acct_process_in_n
s
(
struct
pid_namespace
*
ns
)
static
void
slow_acct_proces
s
(
struct
pid_namespace
*
ns
)
{
struct
file
*
file
=
NULL
;
struct
bsd_acct_struct
*
acct
;
for
(
;
ns
;
ns
=
ns
->
parent
)
{
struct
file
*
file
=
NULL
;
struct
bsd_acct_struct
*
acct
;
acct
=
ns
->
bacct
;
/*
* accelerate the common fastpath:
*/
if
(
!
acct
||
!
acct
->
file
)
return
;
acct
=
ns
->
bacct
;
/*
* accelerate the common fastpath:
*/
if
(
!
acct
||
!
acct
->
file
)
continue
;
spin_lock
(
&
acct_lock
);
file
=
acct
->
file
;
if
(
unlikely
(
!
file
))
{
spin_lock
(
&
acct_lock
);
file
=
acct
->
file
;
if
(
unlikely
(
!
file
))
{
spin_unlock
(
&
acct_lock
);
continue
;
}
get_file
(
file
);
spin_unlock
(
&
acct_lock
);
return
;
}
get_file
(
file
);
spin_unlock
(
&
acct_lock
);
do_acct_process
(
acct
,
ns
,
file
);
fput
(
file
);
do_acct_process
(
acct
,
ns
,
file
);
fput
(
file
);
}
}
/**
* acct_process - now just a wrapper around acct_process_in_ns,
* which in turn is a wrapper around do_acct_process.
* acct_process
*
* handles process accounting for an exiting task
*/
...
...
@@ -639,6 +640,11 @@ void acct_process(void)
* alive and holds its namespace, which in turn holds
* its parent.
*/
for
(
ns
=
task_active_pid_ns
(
current
);
ns
!=
NULL
;
ns
=
ns
->
parent
)
acct_process_in_ns
(
ns
);
for
(
ns
=
task_active_pid_ns
(
current
);
ns
!=
NULL
;
ns
=
ns
->
parent
)
{
struct
bsd_acct_struct
*
acct
=
ns
->
bacct
;
if
(
acct
&&
acct
->
file
)
break
;
}
if
(
unlikely
(
ns
))
slow_acct_process
(
ns
);
}
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