04 Apr, 2014

1 commit

  • The following patches are reverted in this patch because these patches
    caused performance regression in the remote unlink() calls.

    ea455f8ab683 - ocfs2: Push out dropping of dentry lock to ocfs2_wq
    f7b1aa69be13 - ocfs2: Fix deadlock on umount
    5fd131893793 - ocfs2: Don't oops in ocfs2_kill_sb on a failed mount

    Previous patches in this series removed the possible deadlocks from
    downconvert thread so the above patches shouldn't be needed anymore.

    The regression is caused because these patches delay the iput() in case
    of dentry unlocks. This also delays the unlocking of the open lockres.
    The open lockresource is required to test if the inode can be wiped from
    disk or not. When the deleting node does not get the open lock, it
    marks it as orphan (even though it is not in use by another
    node/process) and causes a journal checkpoint. This delays operations
    following the inode eviction. This also moves the inode to the orphaned
    inode which further causes more I/O and a lot of unneccessary orphans.

    The following script can be used to generate the load causing issues:

    declare -a create
    declare -a remove
    declare -a iterations=(1 2 4 8 16 32 64 128 256 512 1024 2048 4096 8192 16384)
    unique="`mktemp -u XXXXX`"
    script="/tmp/idontknow-${unique}.sh"
    cat < "${script}"
    for n in {1..8}; do mkdir -p test/dir\${n}
    eval touch test/dir\${n}/foo{1.."\$1"}
    done
    EOF
    chmod 700 "${script}"

    function fcreate ()
    {
    exec 2>&1 /usr/bin/time --format=%E "${script}" "$1"
    }

    function fremove ()
    {
    exec 2>&1 /usr/bin/time --format=%E ssh node2 "cd `pwd`; rm -Rf test*"
    }

    function fcp ()
    {
    exec 2>&1 /usr/bin/time --format=%E ssh node3 "cd `pwd`; cp -R test test.new"
    }

    echo -------------------------------------------------
    echo "| # files | create #s | copy #s | remove #s |"
    echo -------------------------------------------------
    for ((x=0; x < ${#iterations[*]} ; x++)) do
    create[$x]="`fcreate ${iterations[$x]}`"
    copy[$x]="`fcp ${iterations[$x]}`"
    remove[$x]="`fremove`"
    printf "| %8d | %9s | %9s | %9s |\n" ${iterations[$x]} ${create[$x]} ${copy[$x]} ${remove[$x]}
    done
    rm "${script}"
    echo "------------------------"

    Signed-off-by: Srinivas Eeda
    Signed-off-by: Goldwyn Rodrigues
    Signed-off-by: Jan Kara
    Reviewed-by: Mark Fasheh
    Cc: Joel Becker
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Goldwyn Rodrigues
     

11 Sep, 2010

1 commit

  • Track negative dentries by recording the generation number of the parent
    directory in d_fsdata. The generation number for the parent directory is
    recorded in the inode_info, which increments every time the lock on the
    directory is dropped.

    If the generation number of the parent directory and the negative dentry
    matches, there is no need to perform the revalidate, else a revalidate
    is forced. This improves performance in situations where nodes look for
    the same non-existent file multiple times.

    Thanks Mark for explaining the DLM sequence.

    Signed-off-by: Goldwyn Rodrigues
    Signed-off-by: Joel Becker

    Goldwyn Rodrigues
     

22 Jul, 2009

1 commit

  • In commit ea455f8ab68338ba69f5d3362b342c115bea8e13, we moved the dentry lock
    put process into ocfs2_wq. This causes problems during umount because ocfs2_wq
    can drop references to inodes while they are being invalidated by
    invalidate_inodes() causing all sorts of nasty things (invalidate_inodes()
    ending in an infinite loop, "Busy inodes after umount" messages etc.).

    We fix the problem by stopping ocfs2_wq from doing any further releasing of
    inode references on the superblock being unmounted, wait until it finishes
    the current round of releasing and finally cleaning up all the references in
    dentry_lock_list from ocfs2_put_super().

    The issue was tracked down by Tao Ma .

    Signed-off-by: Jan Kara
    Signed-off-by: Joel Becker

    Jan Kara
     

28 Mar, 2009

1 commit


03 Feb, 2009

1 commit

  • Dropping of last reference to dentry lock is a complicated operation involving
    dropping of reference to inode. This can get complicated and quota code in
    particular needs to obtain some quota locks which leads to potential deadlock.
    Thus we defer dropping of inode reference to ocfs2_wq.

    Signed-off-by: Jan Kara
    Signed-off-by: Mark Fasheh

    Jan Kara
     

25 Sep, 2006

3 commits

  • We can't use LKM_LOCAL for new dentry locks because an unlink and subsequent
    re-create of a name/inode pair may result in the lock still being mastered
    somewhere in the cluster.

    Signed-off-by: Mark Fasheh

    Mark Fasheh
     
  • Replace the dentry vote mechanism with a cluster lock which covers a set
    of dentries. This allows us to force d_delete() only on nodes which actually
    care about an unlink.

    Every node that does a ->lookup() gets a read only lock on the dentry, until
    an unlink during which the unlinking node, will request an exclusive lock,
    forcing the other nodes who care about that dentry to d_delete() it. The
    effect is that we retain a very lightweight ->d_revalidate(), and at the
    same time get to make large improvements to the average case performance of
    the ocfs2 unlink and rename operations.

    This patch adds the higher level API and the dentry manipulation code.

    Signed-off-by: Mark Fasheh

    Mark Fasheh
     
  • Replace the dentry vote mechanism with a cluster lock which covers a set
    of dentries. This allows us to force d_delete() only on nodes which actually
    care about an unlink.

    Every node that does a ->lookup() gets a read only lock on the dentry, until
    an unlink during which the unlinking node, will request an exclusive lock,
    forcing the other nodes who care about that dentry to d_delete() it. The
    effect is that we retain a very lightweight ->d_revalidate(), and at the
    same time get to make large improvements to the average case performance of
    the ocfs2 unlink and rename operations.

    This patch adds the cluster lock type which OCFS2 can attach to
    dentries. A small number of fs/ocfs2/dcache.c functions are stubbed
    out so that this change can compile.

    Signed-off-by: Mark Fasheh

    Mark Fasheh
     

04 Jan, 2006

1 commit