lkml.org 
[lkml]   [2003]   [Jun]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subjectshmctl(SHM_LOCK/UNLOCK) deadlock
Hi,

this patch fixes an SMP deadlock that triggered in some production
usage:

--- xxx/mm/shmem.c.~1~ 2003-06-01 19:14:07.000000000 +0200
+++ xxx/mm/shmem.c 2003-06-04 02:17:23.000000000 +0200
@@ -808,9 +808,9 @@ void shmem_lock(struct file * file, int
struct inode * inode = file->f_dentry->d_inode;
struct shmem_inode_info * info = SHMEM_I(inode);

- down(&info->sem);
+ spin_lock(&info->lock);
info->locked = lock;
- up(&info->sem);
+ spin_unlock(&info->lock);
}

int shmem_make_bigpage_mmap(struct file * file, struct vm_area_struct * vma)
you can merge it in 21-final IMHO (even dropping the lock enterely would
been ok, the reader is out of order anyways and that's atomic stuff in C
no matter the architecture)

Andrea
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:36    [W:0.063 / U:0.160 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site