[lkml]   [1999]   [Jan]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
    SubjectRe: MM deadlock [was: Re: arca-vm-8...]

    On Sat, 9 Jan 1999 13:50:14 -0800 (PST), Linus Torvalds
    <> said:

    > On Sat, 9 Jan 1999, Linus Torvalds wrote:
    >> The cleanest solution I can think of is actually to allow semaphores to be
    >> recursive. I can do that with minimal overhead (just one extra instruction
    >> in the non-contention case), so it's not too bad, and I've wanted to do it
    >> for certain other things, but it's still a nasty piece of code to mess
    >> around with.

    Ack. I've been having a closer look, and making the superblock lock
    recursive doesn't work: the ext2fs allocation code is definitely not
    reentrant. In particular, the bitmap buffers can get evicted out from
    under our feet if we reenter the block allocation code, leading to nasty
    filesystem and/or memory corruption. The allocation code can also get
    confused if the bitmap contents change between checking the group
    descriptor for a block group and reading in the bitmap itself, leading
    to potential ENOSPC errors turning up wrongly.

    Preventing recursive VM access to the filesystem while we have the
    superblock lock seems the only easy way out short of making the
    allocation/truncate code fully reentrant.

    On the other hand, it does look as if the inode deadlock is dealt with
    OK if we just make that semaphore recursive; I can't see anywhere that
    dies if we make that change. This does somewhat imply that we may need
    to make a distinction between reentrant and non-reentrant semaphores if
    we go down this route.


    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to
    Please read the FAQ at

     \ /
      Last update: 2005-03-22 13:49    [W:0.023 / U:8.248 seconds]
    ©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site