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
54852508
Commit
54852508
authored
Jul 25, 2009
by
Thomas Gleixner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
timer_stats: Convert to atomic_spin_lock
Signed-off-by:
Thomas Gleixner
<
tglx@linutronix.de
>
parent
3a6e55cb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
10 deletions
+10
-10
kernel/time/timer_stats.c
kernel/time/timer_stats.c
+10
-10
No files found.
kernel/time/timer_stats.c
View file @
54852508
...
@@ -81,12 +81,12 @@ struct entry {
...
@@ -81,12 +81,12 @@ struct entry {
/*
/*
* Spinlock protecting the tables - not taken during lookup:
* Spinlock protecting the tables - not taken during lookup:
*/
*/
static
DEFINE_SPINLOCK
(
table_lock
);
static
DEFINE_
ATOMIC_
SPINLOCK
(
table_lock
);
/*
/*
* Per-CPU lookup locks for fast hash lookup:
* Per-CPU lookup locks for fast hash lookup:
*/
*/
static
DEFINE_PER_CPU
(
spinlock_t
,
lookup_lock
);
static
DEFINE_PER_CPU
(
atomic_
spinlock_t
,
lookup_lock
);
/*
/*
* Mutex to serialize state changes with show-stats activities:
* Mutex to serialize state changes with show-stats activities:
...
@@ -188,7 +188,7 @@ static struct entry *tstat_lookup(struct entry *entry, char *comm)
...
@@ -188,7 +188,7 @@ static struct entry *tstat_lookup(struct entry *entry, char *comm)
prev
=
NULL
;
prev
=
NULL
;
curr
=
*
head
;
curr
=
*
head
;
spin_lock
(
&
table_lock
);
atomic_
spin_lock
(
&
table_lock
);
/*
/*
* Make sure we have not raced with another CPU:
* Make sure we have not raced with another CPU:
*/
*/
...
@@ -215,7 +215,7 @@ static struct entry *tstat_lookup(struct entry *entry, char *comm)
...
@@ -215,7 +215,7 @@ static struct entry *tstat_lookup(struct entry *entry, char *comm)
*
head
=
curr
;
*
head
=
curr
;
}
}
out_unlock:
out_unlock:
spin_unlock
(
&
table_lock
);
atomic_
spin_unlock
(
&
table_lock
);
return
curr
;
return
curr
;
}
}
...
@@ -238,7 +238,7 @@ void timer_stats_update_stats(void *timer, pid_t pid, void *startf,
...
@@ -238,7 +238,7 @@ void timer_stats_update_stats(void *timer, pid_t pid, void *startf,
/*
/*
* It doesnt matter which lock we take:
* It doesnt matter which lock we take:
*/
*/
spinlock_t
*
lock
;
atomic_
spinlock_t
*
lock
;
struct
entry
*
entry
,
input
;
struct
entry
*
entry
,
input
;
unsigned
long
flags
;
unsigned
long
flags
;
...
@@ -253,7 +253,7 @@ void timer_stats_update_stats(void *timer, pid_t pid, void *startf,
...
@@ -253,7 +253,7 @@ void timer_stats_update_stats(void *timer, pid_t pid, void *startf,
input
.
pid
=
pid
;
input
.
pid
=
pid
;
input
.
timer_flag
=
timer_flag
;
input
.
timer_flag
=
timer_flag
;
spin_lock_irqsave
(
lock
,
flags
);
atomic_
spin_lock_irqsave
(
lock
,
flags
);
if
(
!
timer_stats_active
)
if
(
!
timer_stats_active
)
goto
out_unlock
;
goto
out_unlock
;
...
@@ -264,7 +264,7 @@ void timer_stats_update_stats(void *timer, pid_t pid, void *startf,
...
@@ -264,7 +264,7 @@ void timer_stats_update_stats(void *timer, pid_t pid, void *startf,
atomic_inc
(
&
overflow_count
);
atomic_inc
(
&
overflow_count
);
out_unlock:
out_unlock:
spin_unlock_irqrestore
(
lock
,
flags
);
atomic_
spin_unlock_irqrestore
(
lock
,
flags
);
}
}
static
void
print_name_offset
(
struct
seq_file
*
m
,
unsigned
long
addr
)
static
void
print_name_offset
(
struct
seq_file
*
m
,
unsigned
long
addr
)
...
@@ -348,9 +348,9 @@ static void sync_access(void)
...
@@ -348,9 +348,9 @@ static void sync_access(void)
int
cpu
;
int
cpu
;
for_each_online_cpu
(
cpu
)
{
for_each_online_cpu
(
cpu
)
{
spin_lock_irqsave
(
&
per_cpu
(
lookup_lock
,
cpu
),
flags
);
atomic_
spin_lock_irqsave
(
&
per_cpu
(
lookup_lock
,
cpu
),
flags
);
/* nothing */
/* nothing */
spin_unlock_irqrestore
(
&
per_cpu
(
lookup_lock
,
cpu
),
flags
);
atomic_
spin_unlock_irqrestore
(
&
per_cpu
(
lookup_lock
,
cpu
),
flags
);
}
}
}
}
...
@@ -408,7 +408,7 @@ void __init init_timer_stats(void)
...
@@ -408,7 +408,7 @@ void __init init_timer_stats(void)
int
cpu
;
int
cpu
;
for_each_possible_cpu
(
cpu
)
for_each_possible_cpu
(
cpu
)
spin_lock_init
(
&
per_cpu
(
lookup_lock
,
cpu
));
atomic_
spin_lock_init
(
&
per_cpu
(
lookup_lock
,
cpu
));
}
}
static
int
__init
init_tstats_procfs
(
void
)
static
int
__init
init_tstats_procfs
(
void
)
...
...
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