Re: [PATCH] ipc 1/3: Add refcount to ipc_rcu_alloc

From: Andrew Morton
Date: Sat Jul 03 2004 - 15:27:13 EST


Manfred Spraul <manfred@xxxxxxxxxxxxxxxx> wrote:
>
> the lifetime of the ipc objects (sem array, msg queue, shm mapping) is
> controlled by kern_ipc_perms->lock - a spinlock. There is no simple way
> to reacquire this spinlock after it was dropped to
> schedule()/kmalloc/copy_{to,from}_user/whatever.
>
> The attached patch adds a reference count as a preparation to get rid of
> sem_revalidate().

The pointer offsetting tricks are rather unattractive. Is it not possible
to simple aggregate the refcount into the refcounted structure, use
container_of()?

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