https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=199140

            Bug ID: 199140
           Summary: unlinking symlinks oddly slow on UFS
           Product: Base System
           Version: 9.3-RELEASE
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: kern
          Assignee: [email protected]
          Reporter: [email protected]

On a UFS2 filesystem with soft updates, deleting a directory of thousands of
symlinks is hundreds of times slower than deleting regular files.

It looks like the writes are synchronous.

  $ mkdir test1 && for f in `seq 5000`; do touch "test1/$f"; done
  $ mkdir test2 && for f in `seq 5000`; do echo test > "test2/$f"; done
  $ mkdir test3 && for f in `seq 5000`; do ln -s test "test3/$f"; done
  $ sync
  $ time rm -r test1
          0.20 real         0.01 user         0.17 sys
  $ time rm -r test2
          0.30 real         0.00 user         0.25 sys
  $ time rm -r test3
         94.73 real         0.02 user         0.72 sys

But if the symlinks are made large enough that their targets cannot be stored
in the inode directly, then unlinking them is fast!

  $ test="$(perl -e 'print "x"x1023')"
  $ mkdir test4 && for f in `seq 5000`; do ln -s "$test" "test4/$f"; done
  $ time rm -r test4
          0.17 real         0.00 user         0.17 sys

-- 
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-bugs
To unsubscribe, send any mail to "[email protected]"

Reply via email to