Re: [patch-2.3.99-pre7-1] file_systems_lock refinement

From: Alexander Viro (viro@math.psu.edu)
Date: Wed May 03 2000 - 02:24:33 EST


On Mon, 1 May 2000, Tigran Aivazian wrote:

> Hi Linus,
>
> A long time ago I wanted to protect file_systems via rw spinlock but
> didn't know what to do in mount_root() which could block. Now I see the
> elegant solution someone (Al Viro?) invented by means of the
> try_inc_mod_count(). But he used plain spinlocks instead of rw spinlocks
> so I would like to bring back to life my version - see patch below.

Umm... I thought about that, but ended up using the plain spinlocks since
I didn't (and don't) believe that in real life you'll have sufficiently
long list and sufficiently many simultaneous readers to make the
difference visible. We are not talking about the number of mounted
filesystems here - it's the number of filesystem _types_ that matters.
rwlocks do not hurt, but I doubt that you'll ever notice the difference.

If anything, fs/nls/nls_base.c may be more worth it - same problem, same
solution, same chance to use rwlocks and potentially longer list to deal
with.

> The ordinary spinlocks are too coarse for this purpose - there is no need
> for mutual exclusion between, say, a process calling sysfs(2) and a
> process reading /proc/filesystems or two processes reading from
> /proc/filesystems..

Works for me, but I don't think that it's critical - IMO you are fighting
the contention that doesn't exist.

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



This archive was generated by hypermail 2b29 : Sun May 07 2000 - 21:00:11 EST