1. 05 Jun, 2022 1 commit
  2. 14 May, 2022 2 commits
    • Al Viro's avatar
      Unify the primitives for file descriptor closing · 6319194e
      Al Viro authored
      Currently we have 3 primitives for removing an opened file from descriptor
      table - pick_file(), __close_fd_get_file() and close_fd_get_file().  Their
      calling conventions are rather odd and there's a code duplication for no
      good reason.  They can be unified -
      
      1) have __range_close() cap max_fd in the very beginning; that way
      we don't need separate way for pick_file() to report being past the end
      of descriptor table.
      
      2) make {__,}close_fd_get_file() return file (or NULL) directly, rather
      than returning it via struct file ** argument.  Don't bother with
      (bogus) return value - nobody wants that -ENOENT.
      
      3) make pick_file() return NULL on unopened descriptor - the only caller
      that used to care about the distinction between descriptor past the end
      of descriptor table and finding NULL in descriptor table doesn't give
      a damn after (1).
      
      4) lift ->files_lock out of pick_file()
      
      That actually simplifies the callers, as well as the primitives themselves.
      Code duplication is also gone...
      Reviewed-by: default avatarChristian Brauner (Microsoft) <brauner@kernel.org>
      Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
      6319194e
    • Gou Hao's avatar
      fs: remove fget_many and fput_many interface · 81132a39
      Gou Hao authored
      These two interface were added in 091141a4 commit,
      but now there is no place to call them.
      
      The only user of fput/fget_many() was removed in commit
      62906e89 ("io_uring: remove file batch-get optimisation").
      
      A user of get_file_rcu_many() were removed in commit
      f0735310 ("init: add an init_dup helper").
      
      And replace atomic_long_sub/add to atomic_long_dec/inc
      can improve performance.
      
      Here are the test results of unixbench:
      
      Cmd: ./Run -c 64 context1
      
      Without patch:
      System Benchmarks Partial Index              BASELINE       RESULT    INDEX
      Pipe-based Context Switching                   4000.0    2798407.0   6996.0
                                                                         ========
      System Benchmarks Index Score (Partial Only)                         6996.0
      
      With patch:
      System Benchmarks Partial Index              BASELINE       RESULT    INDEX
      Pipe-based Context Switching                   4000.0    3486268.8   8715.7
                                                                         ========
      System Benchmarks Index Score (Partial Only)                         8715.7
      Signed-off-by: default avatarGou Hao <gouhao@uniontech.com>
      Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
      81132a39
  3. 12 May, 2022 1 commit
  4. 03 Apr, 2022 8 commits
  5. 02 Apr, 2022 28 commits