Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
linux-davinci
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
linux
linux-davinci
Commits
a3f22fd7
Commit
a3f22fd7
authored
Jul 25, 2009
by
Thomas Gleixner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sched: Convert thread_group_cputimer lock to atomic_spinlock
Signed-off-by:
Thomas Gleixner
<
tglx@linutronix.de
>
parent
3847c2d9
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
13 additions
and
13 deletions
+13
-13
include/linux/init_task.h
include/linux/init_task.h
+1
-1
include/linux/sched.h
include/linux/sched.h
+2
-2
kernel/posix-cpu-timers.c
kernel/posix-cpu-timers.c
+4
-4
kernel/sched_stats.h
kernel/sched_stats.h
+6
-6
No files found.
include/linux/init_task.h
View file @
a3f22fd7
...
...
@@ -27,7 +27,7 @@ extern struct fs_struct init_fs;
.cputimer = { \
.cputime = INIT_CPUTIME, \
.running = 0, \
.lock = __SPIN_LOCK_UNLOCKED(sig.cputimer.lock), \
.lock = __
ATOMIC_
SPIN_LOCK_UNLOCKED(sig.cputimer.lock), \
}, \
}
...
...
include/linux/sched.h
View file @
a3f22fd7
...
...
@@ -520,7 +520,7 @@ struct task_cputime {
struct
thread_group_cputimer
{
struct
task_cputime
cputime
;
int
running
;
spinlock_t
lock
;
atomic_
spinlock_t
lock
;
};
/*
...
...
@@ -2321,7 +2321,7 @@ void thread_group_cputimer(struct task_struct *tsk, struct task_cputime *times);
static
inline
void
thread_group_cputime_init
(
struct
signal_struct
*
sig
)
{
sig
->
cputimer
.
cputime
=
INIT_CPUTIME
;
spin_lock_init
(
&
sig
->
cputimer
.
lock
);
atomic_
spin_lock_init
(
&
sig
->
cputimer
.
lock
);
sig
->
cputimer
.
running
=
0
;
}
...
...
kernel/posix-cpu-timers.c
View file @
a3f22fd7
...
...
@@ -279,7 +279,7 @@ void thread_group_cputimer(struct task_struct *tsk, struct task_cputime *times)
struct
task_cputime
sum
;
unsigned
long
flags
;
spin_lock_irqsave
(
&
cputimer
->
lock
,
flags
);
atomic_
spin_lock_irqsave
(
&
cputimer
->
lock
,
flags
);
if
(
!
cputimer
->
running
)
{
cputimer
->
running
=
1
;
/*
...
...
@@ -292,7 +292,7 @@ void thread_group_cputimer(struct task_struct *tsk, struct task_cputime *times)
update_gt_cputime
(
&
cputimer
->
cputime
,
&
sum
);
}
*
times
=
cputimer
->
cputime
;
spin_unlock_irqrestore
(
&
cputimer
->
lock
,
flags
);
atomic_
spin_unlock_irqrestore
(
&
cputimer
->
lock
,
flags
);
}
/*
...
...
@@ -1065,9 +1065,9 @@ static void stop_process_timers(struct task_struct *tsk)
if
(
!
cputimer
->
running
)
return
;
spin_lock_irqsave
(
&
cputimer
->
lock
,
flags
);
atomic_
spin_lock_irqsave
(
&
cputimer
->
lock
,
flags
);
cputimer
->
running
=
0
;
spin_unlock_irqrestore
(
&
cputimer
->
lock
,
flags
);
atomic_
spin_unlock_irqrestore
(
&
cputimer
->
lock
,
flags
);
}
/*
...
...
kernel/sched_stats.h
View file @
a3f22fd7
...
...
@@ -306,10 +306,10 @@ static inline void account_group_user_time(struct task_struct *tsk,
if
(
!
cputimer
->
running
)
return
;
spin_lock
(
&
cputimer
->
lock
);
atomic_
spin_lock
(
&
cputimer
->
lock
);
cputimer
->
cputime
.
utime
=
cputime_add
(
cputimer
->
cputime
.
utime
,
cputime
);
spin_unlock
(
&
cputimer
->
lock
);
atomic_
spin_unlock
(
&
cputimer
->
lock
);
}
/**
...
...
@@ -336,10 +336,10 @@ static inline void account_group_system_time(struct task_struct *tsk,
if
(
!
cputimer
->
running
)
return
;
spin_lock
(
&
cputimer
->
lock
);
atomic_
spin_lock
(
&
cputimer
->
lock
);
cputimer
->
cputime
.
stime
=
cputime_add
(
cputimer
->
cputime
.
stime
,
cputime
);
spin_unlock
(
&
cputimer
->
lock
);
atomic_
spin_unlock
(
&
cputimer
->
lock
);
}
/**
...
...
@@ -369,7 +369,7 @@ static inline void account_group_exec_runtime(struct task_struct *tsk,
if
(
!
cputimer
->
running
)
return
;
spin_lock
(
&
cputimer
->
lock
);
atomic_
spin_lock
(
&
cputimer
->
lock
);
cputimer
->
cputime
.
sum_exec_runtime
+=
ns
;
spin_unlock
(
&
cputimer
->
lock
);
atomic_
spin_unlock
(
&
cputimer
->
lock
);
}
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