aboutsummaryrefslogtreecommitdiffstats
path: root/arch/s390
diff options
context:
space:
mode:
authorJens Axboe <jens.axboe@oracle.com>2008-12-09 02:11:22 -0500
committerJens Axboe <jens.axboe@oracle.com>2008-12-29 02:29:50 -0500
commitabf137dd7712132ee56d5b3143c2ff61a72a5faa (patch)
tree8334f03c598343bb93340f081fcde5ba659b440b /arch/s390
parent392ddc32982a5c661dd90dd49a3cb37f1c68b782 (diff)
aio: make the lookup_ioctx() lockless
The mm->ioctx_list is currently protected by a reader-writer lock, so we always grab that lock on the read side for doing ioctx lookups. As the workload is extremely reader biased, turn this into an rcu hlist so we can make lookup_ioctx() lockless. Get rid of the rwlock and use a spinlock for providing update side exclusion. There's usually only 1 entry on this list, so it doesn't make sense to look into fancier data structures. Reviewed-by: Jeff Moyer <jmoyer@redhat.com> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Diffstat (limited to 'arch/s390')
-rw-r--r--arch/s390/mm/pgtable.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/s390/mm/pgtable.c b/arch/s390/mm/pgtable.c
index ef3635b52fc0..0767827540b1 100644
--- a/arch/s390/mm/pgtable.c
+++ b/arch/s390/mm/pgtable.c
@@ -263,7 +263,7 @@ int s390_enable_sie(void)
263 /* lets check if we are allowed to replace the mm */ 263 /* lets check if we are allowed to replace the mm */
264 task_lock(tsk); 264 task_lock(tsk);
265 if (!tsk->mm || atomic_read(&tsk->mm->mm_users) > 1 || 265 if (!tsk->mm || atomic_read(&tsk->mm->mm_users) > 1 ||
266 tsk->mm != tsk->active_mm || tsk->mm->ioctx_list) { 266 tsk->mm != tsk->active_mm || !hlist_empty(&tsk->mm->ioctx_list)) {
267 task_unlock(tsk); 267 task_unlock(tsk);
268 return -EINVAL; 268 return -EINVAL;
269 } 269 }
@@ -279,7 +279,7 @@ int s390_enable_sie(void)
279 /* Now lets check again if something happened */ 279 /* Now lets check again if something happened */
280 task_lock(tsk); 280 task_lock(tsk);
281 if (!tsk->mm || atomic_read(&tsk->mm->mm_users) > 1 || 281 if (!tsk->mm || atomic_read(&tsk->mm->mm_users) > 1 ||
282 tsk->mm != tsk->active_mm || tsk->mm->ioctx_list) { 282 tsk->mm != tsk->active_mm || !hlist_empty(&tsk->mm->ioctx_list)) {
283 mmput(mm); 283 mmput(mm);
284 task_unlock(tsk); 284 task_unlock(tsk);
285 return -EINVAL; 285 return -EINVAL;