lkml.org 
[lkml]   [2000]   [Mar]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: PROPOSAL: Fixing the sys5 emulation bugs in shmfs
You added a dead-lock:
* shm_lock() is a spinlock.
* shm_swap() is called from try_to_free_pages(), and that function could
be called with the big kernel lock acquired; shm_swap() calls
shm_lockall().

Alan Cox wrote:
> + shp = shm_lock(shmid);
^^^^^^^^^^^^^^^ spinlock acquired.

> + if(shp==NULL)
> + return -EINVAL;
> + err=-EIDRM;
> + if(shm_checkid(shp,shmid))
> + goto out_unlock;
> + if(shp->nattch==0)
> + shm_remove_name(shmid);
[...]
>
> +static void shm_remove_name(int id)
> +{
> + char *name = shm_getname(id);
> + if (!IS_ERR(name))
> + {
> + struct dentry *saved;
> + lock_kernel();
^^^^^^^^^^^^^^^^^^^^^^^^^^^ and lock_kernel().
> + saved=shm_push_chroot();
> + do_unlink (name);

I documented the spinlock ordering in shm.c, ~ line 190.

--
Manfred

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

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