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
0fc7741c
Commit
0fc7741c
authored
Jul 25, 2009
by
Thomas Gleixner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
proportions: Convert to atomic_spinlck
Signed-off-by:
Thomas Gleixner
<
tglx@linutronix.de
>
parent
87047afa
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
9 deletions
+9
-9
include/linux/proportions.h
include/linux/proportions.h
+3
-3
lib/proportions.c
lib/proportions.c
+6
-6
No files found.
include/linux/proportions.h
View file @
0fc7741c
...
...
@@ -58,7 +58,7 @@ struct prop_local_percpu {
*/
int
shift
;
unsigned
long
period
;
spinlock_t
lock
;
/* protect the snapshot state */
atomic_
spinlock_t
lock
;
/* protect the snapshot state */
};
int
prop_local_init_percpu
(
struct
prop_local_percpu
*
pl
);
...
...
@@ -106,11 +106,11 @@ struct prop_local_single {
*/
unsigned
long
period
;
int
shift
;
spinlock_t
lock
;
/* protect the snapshot state */
atomic_
spinlock_t
lock
;
/* protect the snapshot state */
};
#define INIT_PROP_LOCAL_SINGLE(name) \
{ .lock = __SPIN_LOCK_UNLOCKED(name.lock), \
{ .lock = __
ATOMIC_
SPIN_LOCK_UNLOCKED(name.lock), \
}
int
prop_local_init_single
(
struct
prop_local_single
*
pl
);
...
...
lib/proportions.c
View file @
0fc7741c
...
...
@@ -190,7 +190,7 @@ prop_adjust_shift(int *pl_shift, unsigned long *pl_period, int new_shift)
int
prop_local_init_percpu
(
struct
prop_local_percpu
*
pl
)
{
spin_lock_init
(
&
pl
->
lock
);
atomic_
spin_lock_init
(
&
pl
->
lock
);
pl
->
shift
=
0
;
pl
->
period
=
0
;
return
percpu_counter_init
(
&
pl
->
events
,
0
);
...
...
@@ -226,7 +226,7 @@ void prop_norm_percpu(struct prop_global *pg, struct prop_local_percpu *pl)
if
(
pl
->
period
==
global_period
)
return
;
spin_lock_irqsave
(
&
pl
->
lock
,
flags
);
atomic_
spin_lock_irqsave
(
&
pl
->
lock
,
flags
);
prop_adjust_shift
(
&
pl
->
shift
,
&
pl
->
period
,
pg
->
shift
);
/*
...
...
@@ -247,7 +247,7 @@ void prop_norm_percpu(struct prop_global *pg, struct prop_local_percpu *pl)
percpu_counter_set
(
&
pl
->
events
,
0
);
pl
->
period
=
global_period
;
spin_unlock_irqrestore
(
&
pl
->
lock
,
flags
);
atomic_
spin_unlock_irqrestore
(
&
pl
->
lock
,
flags
);
}
/*
...
...
@@ -324,7 +324,7 @@ void prop_fraction_percpu(struct prop_descriptor *pd,
int
prop_local_init_single
(
struct
prop_local_single
*
pl
)
{
spin_lock_init
(
&
pl
->
lock
);
atomic_
spin_lock_init
(
&
pl
->
lock
);
pl
->
shift
=
0
;
pl
->
period
=
0
;
pl
->
events
=
0
;
...
...
@@ -356,7 +356,7 @@ void prop_norm_single(struct prop_global *pg, struct prop_local_single *pl)
if
(
pl
->
period
==
global_period
)
return
;
spin_lock_irqsave
(
&
pl
->
lock
,
flags
);
atomic_
spin_lock_irqsave
(
&
pl
->
lock
,
flags
);
prop_adjust_shift
(
&
pl
->
shift
,
&
pl
->
period
,
pg
->
shift
);
/*
* For each missed period, we half the local counter.
...
...
@@ -367,7 +367,7 @@ void prop_norm_single(struct prop_global *pg, struct prop_local_single *pl)
else
pl
->
events
=
0
;
pl
->
period
=
global_period
;
spin_unlock_irqrestore
(
&
pl
->
lock
,
flags
);
atomic_
spin_unlock_irqrestore
(
&
pl
->
lock
,
flags
);
}
/*
...
...
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