Re: [PATCH] Lightweight userspace semaphores...

Eric W. Biederman (ebiederm@xmission.com)
28 Feb 2002 21:44:40 -0700


Hubertus Franke <frankeh@watson.ibm.com> writes:

> Rusty, since I supplied one of those packages available under
> lse.sourceforge.net
>
> let me make some comments.
>
> (a) why do you need to pin. I simply use the user level address (vaddr)
> and hash with the <mm,vaddr> to obtain the internal object.
> This also gives me full protection through the general vmm mechanisms.

Do:
if (page->mapping)
hash(page->mapping, page->offset, vaddr & ~PAGE_MASK)
else
hash(mm, vaddr)
This handles the semaphores in shared memory case. So the semaphores
will work across processes as well.

> (c) creation can be done on demand, that's what I do. If you never have
> to synchronize through the kernel than you don't create the objects.
> There should be an option to force explicite creation if desired.

Which makes the uncontended (common) case fast.

> (d) The kernel should simply provide waiting and wakeup functionality and
> the bean counting should be done in user space. There is no need to
> pin or crossmap.

Agreed.

Eric
-
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/