X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=blobdiff_plain;f=ldiskfs%2Fkernel_patches%2Fpatches%2Frhel7.4%2Fext4-pdirop.patch;h=910a495b4dc713f5effc33a3253b5f8044217b19;hp=72788c86564dc0e6deee2c8cdd6ae7057761e404;hb=892f62c7a20d87954744c6c8937960379a870992;hpb=3e9fedfa7ea52a03a1975572ab37cc1ae9344a8a diff --git a/ldiskfs/kernel_patches/patches/rhel7.4/ext4-pdirop.patch b/ldiskfs/kernel_patches/patches/rhel7.4/ext4-pdirop.patch index 72788c8..910a495 100644 --- a/ldiskfs/kernel_patches/patches/rhel7.4/ext4-pdirop.patch +++ b/ldiskfs/kernel_patches/patches/rhel7.4/ext4-pdirop.patch @@ -9,7 +9,7 @@ an entire ldiskfs directory. PDO project will remove this bottleneck by introducing a parallel locking mechanism for entire ldiskfs directories. This work will enable multiple application threads to simultaneously lookup, create and unlink in parallel. - + This patch contains: - pdirops support for ldiskfs - integrate with osd-ldiskfs @@ -210,7 +210,7 @@ Index: linux-3.10.0-229.1.2.fc21.x86_64/fs/ext4/htree_lock.c =================================================================== --- /dev/null +++ linux-3.10.0-229.1.2.fc21.x86_64/fs/ext4/htree_lock.c -@@ -0,0 +1,880 @@ +@@ -0,0 +1,891 @@ +/* + * fs/ext4/htree_lock.c + * @@ -852,12 +852,23 @@ Index: linux-3.10.0-229.1.2.fc21.x86_64/fs/ext4/htree_lock.c + lck->lk_task = current; + list_add_tail(&lck->lk_blocked_list, &lhead->lh_blocked_list); + ++retry: + set_current_state(TASK_UNINTERRUPTIBLE); + htree_spin_unlock(lhead, HTREE_DEP_ROOT); + /* wait to be given the lock */ + if (lck->lk_task != NULL) + schedule(); -+ /* granted, no doubt. wake up will set me RUNNING */ ++ /* granted, no doubt. wake up will set me RUNNING. ++ * Since thread would be waken up accidentally, ++ * so we need check lock whether granted or not again. */ ++ if (!list_empty(&lck->lk_blocked_list)) { ++ htree_spin_lock(lhead, HTREE_DEP_ROOT); ++ if (list_empty(&lck->lk_blocked_list)) { ++ htree_spin_unlock(lhead, HTREE_DEP_ROOT); ++ return 0; ++ } ++ goto retry; ++ } + return 0; /* without lh_lock */ + } + lhead->lh_ngranted[lck->lk_mode]++;