Linux-kernel mailing list archive 1999-41,: Re: locking question: do_mmap(), do_munmap()

# Re: locking question: do_mmap(), do_munmap()

Alexander Viro (viro@math.psu.edu)
Mon, 11 Oct 1999 17:40:52 -0400 (EDT)

- Messages sorted by: [ date ][ thread ][ subject ][ author ]
- Next message: Jeff Garzik: "Re: load avg += 1"
- Previous message: Shawn Leas: "RE: My $0.02 on devd and devfs"

On Mon, 11 Oct 1999, Stephen C. Tweedie wrote:

> Hi,
>
> On Mon, 11 Oct 1999 12:05:23 -0400 (EDT), Alexander Viro
> <viro@math.psu.edu> said:
>
> > On Mon, 11 Oct 1999, Stephen C. Tweedie wrote:
> >> No, spinlocks would be ideal. The vma swapout codes _have_ to be
> >> prepared for the vma to be destroyed as soon as we sleep. In fact, the
> >> entire mm may disappear if the process happens to exit. Once we know
> >> which page to write where, the swapout operation becomes a per-page
> >> operation, not per-vma.
>
> > Aha, so you propose to drop it in ->swapout(), right? (after get_file() in
> > filemap_write_page()... Ouch. Probably we'ld better lambda-expand the call
> > in filemap_swapout() - the thing is called from other places too)...
>
> Right now it is the big kernel lock which is used for this, and the
> scheduler drops it anyway for us. If anyone wants to replace that lock
> with another spinlock, then yes, the swapout method would have to drop
> it before doing anything which could block. And that is ugly: having
> spinlocks unbalanced over function calls is a maintenance nightmare.

Agreed, but the big lock does not (and IMHO should not) cover the vma list
modifications.

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

- Next message: Jeff Garzik: "Re: load avg += 1"
- Previous message: Shawn Leas: "RE: My $0.02 on devd and devfs"