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
2684e73a
Commit
2684e73a
authored
Sep 22, 2014
by
Martin Schwidefsky
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
s390/rwlock: remove interrupt-enabling rwlock variant.
Signed-off-by:
Martin Schwidefsky
<
schwidefsky@de.ibm.com
>
parent
6a5c1482
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
66 deletions
+4
-66
arch/s390/include/asm/spinlock.h
arch/s390/include/asm/spinlock.h
+4
-16
arch/s390/lib/spinlock.c
arch/s390/lib/spinlock.c
+0
-50
No files found.
arch/s390/include/asm/spinlock.h
View file @
2684e73a
...
...
@@ -131,12 +131,13 @@ static inline void arch_spin_unlock_wait(arch_spinlock_t *lock)
#define arch_write_can_lock(x) ((x)->lock == 0)
extern
void
_raw_read_lock_wait
(
arch_rwlock_t
*
lp
);
extern
void
_raw_read_lock_wait_flags
(
arch_rwlock_t
*
lp
,
unsigned
long
flags
);
extern
int
_raw_read_trylock_retry
(
arch_rwlock_t
*
lp
);
extern
void
_raw_write_lock_wait
(
arch_rwlock_t
*
lp
);
extern
void
_raw_write_lock_wait_flags
(
arch_rwlock_t
*
lp
,
unsigned
long
flags
);
extern
int
_raw_read_trylock_retry
(
arch_rwlock_t
*
lp
);
extern
int
_raw_write_trylock_retry
(
arch_rwlock_t
*
lp
);
#define arch_read_lock_flags(lock, flags) arch_read_lock(lock)
#define arch_write_lock_flags(lock, flags) arch_write_lock(lock)
static
inline
int
arch_read_trylock_once
(
arch_rwlock_t
*
rw
)
{
unsigned
int
old
=
ACCESS_ONCE
(
rw
->
lock
);
...
...
@@ -157,12 +158,6 @@ static inline void arch_read_lock(arch_rwlock_t *rw)
_raw_read_lock_wait
(
rw
);
}
static
inline
void
arch_read_lock_flags
(
arch_rwlock_t
*
rw
,
unsigned
long
flags
)
{
if
(
!
arch_read_trylock_once
(
rw
))
_raw_read_lock_wait_flags
(
rw
,
flags
);
}
static
inline
void
arch_read_unlock
(
arch_rwlock_t
*
rw
)
{
unsigned
int
old
;
...
...
@@ -179,13 +174,6 @@ static inline void arch_write_lock(arch_rwlock_t *rw)
rw
->
owner
=
SPINLOCK_LOCKVAL
;
}
static
inline
void
arch_write_lock_flags
(
arch_rwlock_t
*
rw
,
unsigned
long
flags
)
{
if
(
!
arch_write_trylock_once
(
rw
))
_raw_write_lock_wait_flags
(
rw
,
flags
);
rw
->
owner
=
SPINLOCK_LOCKVAL
;
}
static
inline
void
arch_write_unlock
(
arch_rwlock_t
*
rw
)
{
typecheck
(
unsigned
int
,
rw
->
lock
);
...
...
arch/s390/lib/spinlock.c
View file @
2684e73a
...
...
@@ -131,31 +131,6 @@ void _raw_read_lock_wait(arch_rwlock_t *rw)
}
EXPORT_SYMBOL
(
_raw_read_lock_wait
);
void
_raw_read_lock_wait_flags
(
arch_rwlock_t
*
rw
,
unsigned
long
flags
)
{
unsigned
int
owner
,
old
;
int
count
=
spin_retry
;
local_irq_restore
(
flags
);
owner
=
0
;
while
(
1
)
{
if
(
count
--
<=
0
)
{
if
(
owner
&&
!
smp_vcpu_scheduled
(
~
owner
))
smp_yield_cpu
(
~
owner
);
count
=
spin_retry
;
}
old
=
ACCESS_ONCE
(
rw
->
lock
);
owner
=
ACCESS_ONCE
(
rw
->
owner
);
if
((
int
)
old
<
0
)
continue
;
local_irq_disable
();
if
(
_raw_compare_and_swap
(
&
rw
->
lock
,
old
,
old
+
1
))
return
;
local_irq_restore
(
flags
);
}
}
EXPORT_SYMBOL
(
_raw_read_lock_wait_flags
);
int
_raw_read_trylock_retry
(
arch_rwlock_t
*
rw
)
{
unsigned
int
old
;
...
...
@@ -194,31 +169,6 @@ void _raw_write_lock_wait(arch_rwlock_t *rw)
}
EXPORT_SYMBOL
(
_raw_write_lock_wait
);
void
_raw_write_lock_wait_flags
(
arch_rwlock_t
*
rw
,
unsigned
long
flags
)
{
unsigned
int
owner
,
old
;
int
count
=
spin_retry
;
local_irq_restore
(
flags
);
owner
=
0
;
while
(
1
)
{
if
(
count
--
<=
0
)
{
if
(
owner
&&
!
smp_vcpu_scheduled
(
~
owner
))
smp_yield_cpu
(
~
owner
);
count
=
spin_retry
;
}
old
=
ACCESS_ONCE
(
rw
->
lock
);
owner
=
ACCESS_ONCE
(
rw
->
owner
);
if
(
old
)
continue
;
local_irq_disable
();
if
(
_raw_compare_and_swap
(
&
rw
->
lock
,
0
,
0x80000000
))
return
;
local_irq_restore
(
flags
);
}
}
EXPORT_SYMBOL
(
_raw_write_lock_wait_flags
);
int
_raw_write_trylock_retry
(
arch_rwlock_t
*
rw
)
{
unsigned
int
old
;
...
...
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