Skip to content
  • Dmitry Monakhov's avatar
    ext4: optimize orphan_list handling for ext4_setattr · 3d287de3
    Dmitry Monakhov authored
    
    
    Surprisingly chown() on ext4 is not SMP scalable operation. 
    Due to unconditional orphan_del(NULL, inode) in ext4_setattr()
    result in significant performance overhead because of global orphan
    mutex, especially in no-journal mode (where orphan_add() is noop).
    It is possible to skip explicit orphan_del if possible.
    Results of fchown() micro-benchmark in no-journal mode
    while (1) {
       iteration++;
       fchown(fd, uid, gid);
       fchown(fd, uid + 1, gid + 1)
    }
    measured: iterations per millisecond
    | nr_tasks | w/o patch | with patch |
    |        1 |       142 |        185 |
    |        4 |       109 |        642 |
    
    Signed-off-by: default avatarDmitry Monakhov <dmonakhov@openvz.org>
    Signed-off-by: default avatar"Theodore Ts'o" <tytso@mit.edu>
    3d287de3