1. 01 7月, 2019 1 次提交
    • Q
      btrfs: extent-tree: Add trace events for space info numbers update · 480b9b4d
      Qu Wenruo 提交于
      Add trace event for update_bytes_pinned() and update_bytes_may_use() to
      detect underflow better.
      
      The output would be something like (only showing data part):
      
        ## Buffered write start, 16K total ##
        2255.954 xfs_io/860 btrfs:update_bytes_may_use:(nil)U: type=DATA old=0 diff=4096
        2257.169 sudo/860 btrfs:update_bytes_may_use:(nil)U: type=DATA old=4096 diff=4096
        2257.346 sudo/860 btrfs:update_bytes_may_use:(nil)U: type=DATA old=8192 diff=4096
        2257.542 sudo/860 btrfs:update_bytes_may_use:(nil)U: type=DATA old=12288 diff=4096
      
        ## Delalloc start ##
        3727.853 kworker/u8:3-e/700 btrfs:update_bytes_may_use:(nil)U: type=DATA old=16384 diff=-16384
      
        ## Space cache update ##
        3733.132 sudo/862 btrfs:update_bytes_may_use:(nil)U: type=DATA old=0 diff=65536
        3733.169 sudo/862 btrfs:update_bytes_may_use:(nil)U: type=DATA old=65536 diff=-65536
        3739.868 sudo/862 btrfs:update_bytes_may_use:(nil)U: type=DATA old=0 diff=65536
        3739.891 sudo/862 btrfs:update_bytes_may_use:(nil)U: type=DATA old=65536 diff=-65536
      
      These two trace events will allow bcc tool to probe btrfs_space_info
      changes and detect underflow with more details (e.g. backtrace for each
      update).
      Signed-off-by: NQu Wenruo <wqu@suse.com>
      Reviewed-by: NDavid Sterba <dsterba@suse.com>
      Signed-off-by: NDavid Sterba <dsterba@suse.com>
      480b9b4d
  2. 05 6月, 2019 2 次提交
  3. 24 5月, 2019 1 次提交
  4. 21 5月, 2019 1 次提交
    • T
      treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 1 · 16216333
      Thomas Gleixner 提交于
      Based on 2 normalized pattern(s):
      
        this program is free software you can redistribute it and or modify
        it under the terms of the gnu general public license as published by
        the free software foundation either version 2 of the license or at
        your option any later version this program is distributed in the
        hope that it will be useful but without any warranty without even
        the implied warranty of merchantability or fitness for a particular
        purpose see the gnu general public license for more details you
        should have received a copy of the gnu general public license along
        with this program if not write to the free software foundation inc
        51 franklin street fifth floor boston ma 02110 1301 usa
      
        this program is free software you can redistribute it and or modify
        it under the terms of the gnu general public license as published by
        the free software foundation either version 2 of the license or at
        your option [no]_[pad]_[ctrl] any later version this program is
        distributed in the hope that it will be useful but without any
        warranty without even the implied warranty of merchantability or
        fitness for a particular purpose see the gnu general public license
        for more details you should have received a copy of the gnu general
        public license along with this program if not write to the free
        software foundation inc 51 franklin street fifth floor boston ma
        02110 1301 usa
      
      extracted by the scancode license scanner the SPDX license identifier
      
        GPL-2.0-or-later
      
      has been chosen to replace the boilerplate/reference in 176 file(s).
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      Reviewed-by: NJilayne Lovejoy <opensource@jilayne.com>
      Reviewed-by: NSteve Winslow <swinslow@gmail.com>
      Reviewed-by: NAllison Randal <allison@lohutok.net>
      Reviewed-by: NKate Stewart <kstewart@linuxfoundation.org>
      Cc: linux-spdx@vger.kernel.org
      Link: https://lkml.kernel.org/r/20190519154040.652910950@linutronix.deSigned-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      16216333
  5. 15 5月, 2019 8 次提交
  6. 09 5月, 2019 1 次提交
  7. 07 5月, 2019 2 次提交
  8. 04 5月, 2019 1 次提交
  9. 02 5月, 2019 1 次提交
  10. 30 4月, 2019 4 次提交
    • Q
      btrfs: trace: Introduce trace events for all btrfs tree locking events · 31aab402
      Qu Wenruo 提交于
      Unlike btrfs_tree_lock() and btrfs_tree_read_lock(), the remaining
      functions in locking.c will not sleep, thus doesn't make much sense to
      record their execution time.
      
      Those events are introduced mainly for user space tool to audit and
      detect lock leakage or dead lock.
      Signed-off-by: NQu Wenruo <wqu@suse.com>
      Reviewed-by: NDavid Sterba <dsterba@suse.com>
      Signed-off-by: NDavid Sterba <dsterba@suse.com>
      31aab402
    • Q
      btrfs: trace: Introduce trace events for sleepable tree lock · 34e73cc9
      Qu Wenruo 提交于
      There are two tree lock events which can sleep:
      - btrfs_tree_read_lock()
      - btrfs_tree_lock()
      
      Sometimes we may need to look into the concurrency picture of the fs.
      For that case, we need the execution time of above two functions and the
      owner of @eb.
      
      Here we introduce a trace events for user space tools like bcc, to get
      the execution time of above two functions, and get detailed owner info
      where eBPF code can't.
      
      All the overhead is hidden behind the trace events, so if events are not
      enabled, there is no overhead.
      
      These trace events also output bytenr and generation, allow them to be
      pared with unlock events to pin down deadlock.
      Signed-off-by: NQu Wenruo <wqu@suse.com>
      Reviewed-by: NDavid Sterba <dsterba@suse.com>
      Signed-off-by: NDavid Sterba <dsterba@suse.com>
      34e73cc9
    • N
      btrfs: Remove EXTENT_WRITEBACK · 4e586ca3
      Nikolay Borisov 提交于
      This flag was introduced in a52d9a80 ("Btrfs: Extent based page
      cache code.") and subsequently it's usage effectively was removed by
      1edbb734 ("Btrfs: reduce CPU usage in the extent_state tree") and
      f2a97a9d ("btrfs: remove all unused functions"). Just remove it,
      no functional changes.
      Signed-off-by: NNikolay Borisov <nborisov@suse.com>
      Reviewed-by: NDavid Sterba <dsterba@suse.com>
      Signed-off-by: NDavid Sterba <dsterba@suse.com>
      4e586ca3
    • Q
      btrfs: tracepoints: Add trace events for extent_io_tree · a1d19847
      Qu Wenruo 提交于
      Although btrfs heavily relies on extent_io_tree, we don't really have
      any good trace events for them.
      
      This patch will add the folowing trace events:
      - trace_btrfs_set_extent_bit()
      - trace_btrfs_clear_extent_bit()
      - trace_btrfs_convert_extent_bit()
      
      Since selftests could create temporary extent_io_tree without fs_info,
      modify TP_fast_assign_fsid() to accept NULL as fs_info.  NULL fs_info
      will lead to all zero fsid.
      
      The output would be:
        btrfs_set_extent_bit: <FDID>: io_tree=INODE_IO ino=1 root=1 start=22036480 len=4096 set_bits=LOCKED
        btrfs_set_extent_bit: <FSID>: io_tree=INODE_IO ino=1 root=1 start=22040576 len=4096 set_bits=LOCKED
        btrfs_set_extent_bit: <FSID>: io_tree=INODE_IO ino=1 root=1 start=22044672 len=4096 set_bits=LOCKED
        btrfs_set_extent_bit: <FSID>: io_tree=INODE_IO ino=1 root=1 start=22048768 len=4096 set_bits=LOCKED
        btrfs_clear_extent_bit: <FSID>: io_tree=INODE_IO ino=1 root=1 start=22036480 len=16384 clear_bits=LOCKED
        ^^^ Extent buffer 22036480 read from disk, the locking progress
      
        btrfs_set_extent_bit: <FSID>: io_tree=TRANS_DIRTY_PAGES ino=1 root=1 start=30425088 len=16384 set_bits=DIRTY
        btrfs_set_extent_bit: <FSID>: io_tree=TRANS_DIRTY_PAGES ino=1 root=1 start=30441472 len=16384 set_bits=DIRTY
        ^^^ 2 new tree blocks allocated in one transaction
      
        btrfs_set_extent_bit: <FSID>: io_tree=FREED_EXTENTS0 ino=0 root=0 start=30523392 len=16384 set_bits=DIRTY
        btrfs_set_extent_bit: <FSID>: io_tree=FREED_EXTENTS0 ino=0 root=0 start=30556160 len=16384 set_bits=DIRTY
        ^^^ 2 old tree blocks get pinned down
      
      There is one point which need attention:
      1) Those trace events can be pretty heavy:
         The following workload would generate over 400 trace events.
      
      	mkfs.btrfs -f $dev
      	start_trace
      	mount $dev $mnt -o enospc_debug
      	sync
      	touch $mnt/file1
      	touch $mnt/file2
      	touch $mnt/file3
      	xfs_io -f -c "pwrite 0 16k" $mnt/file4
      	umount $mnt
      	end_trace
      
         It's not recommended to use them in real world environment.
      Signed-off-by: NQu Wenruo <wqu@suse.com>
      Reviewed-by: NDavid Sterba <dsterba@suse.com>
      [ rename enums ]
      Signed-off-by: NDavid Sterba <dsterba@suse.com>
      a1d19847
  11. 27 4月, 2019 4 次提交
  12. 26 4月, 2019 3 次提交
  13. 25 4月, 2019 6 次提交
    • D
      afs: Provide mount-time configurable byte-range file locking emulation · 6c6c1d63
      David Howells 提交于
      Provide byte-range file locking emulation that can be configured at mount
      time to one of four modes:
      
       (1) flock=local.  Locking is done locally only and no reference is made to
           the server.
      
       (2) flock=openafs.  Byte-range locking is done locally only; whole-file
           locking is done with reference to the server.  Whole-file locks cannot
           be upgraded unless the client holds an exclusive lock.
      
       (3) flock=strict.  Byte-range and whole-file locking both require a
           sufficient whole-file lock on the server.
      
       (4) flock=write.  As strict, but the client always gets an exclusive
           whole-file lock on the server.
      Signed-off-by: NDavid Howells <dhowells@redhat.com>
      6c6c1d63
    • D
      afs: Add more tracepoints · 80548b03
      David Howells 提交于
      Add four more tracepoints:
      
       (1) afs_make_fs_call1 - Split from afs_make_fs_call but takes a filename
           to log also.
      
       (2) afs_make_fs_call2 - Like the above but takes two filenames to log.
      
       (3) afs_lookup - Log the result of doing a successful lookup, including a
           negative result (fid 0:0).
      
       (4) afs_get_tree - Log the set up of a volume for mounting.
      
      It also extends the name buffer on the afs_edit_dir tracepoint to 24 chars
      and puts quotes around the filename in the text representation.
      Signed-off-by: NDavid Howells <dhowells@redhat.com>
      80548b03
    • D
      afs: Implement sillyrename for unlink and rename · 79ddbfa5
      David Howells 提交于
      Implement sillyrename for AFS unlink and rename, using the NFS variant
      implementation as a basis.
      
      Note that the asynchronous file locking extender/releaser has to be
      notified with a state change to stop it complaining if there's a race
      between that and the actual file deletion.
      
      A tracepoint, afs_silly_rename, is also added to note the silly rename and
      the cleanup.  The afs_edit_dir tracepoint is given some extra reason
      indicators and the afs_flock_ev tracepoint is given a silly-delete file
      lock cancellation indicator.
      Signed-off-by: NDavid Howells <dhowells@redhat.com>
      79ddbfa5
    • D
      afs: Add directory reload tracepoint · 99987c56
      David Howells 提交于
      Add a tracepoint (afs_reload_dir) to indicate when a directory is being
      reloaded.
      Signed-off-by: NDavid Howells <dhowells@redhat.com>
      99987c56
    • D
      afs: Handle lock rpc ops failing on a file that got deleted · cdfb26b4
      David Howells 提交于
      Holding a file lock on an AFS file does not prevent it from being deleted
      on the server, so we need to handle an error resulting from that when we
      try setting, extending or releasing a lock.
      
      Fix this by adding a "deleted" lock state and cancelling the lock extension
      process for that file and aborting all waiters for the lock.
      
      Fixes: 0fafdc9f ("afs: Fix file locking")
      Reported-by: NJonathan Billings <jsbillin@umich.edu>
      Signed-off-by: NDavid Howells <dhowells@redhat.com>
      cdfb26b4
    • D
      afs: Add file locking tracepoints · d4696601
      David Howells 提交于
      Add two tracepoints for monitoring AFS file locking.  Firstly, add one that
      follows the operational part:
      
          echo 1 >/sys/kernel/debug/tracing/events/afs/afs_flock_op/enable
      
      And add a second that more follows the event-driven part:
      
          echo 1 >/sys/kernel/debug/tracing/events/afs/afs_flock_ev/enable
      
      Individual file_lock structs seen by afs are tagged with debugging IDs that
      are displayed in the trace log to make it easier to see what's going on,
      especially as setting the first lock always seems to involve copying the
      file_lock twice.
      Signed-off-by: NDavid Howells <dhowells@redhat.com>
      d4696601
  14. 20 4月, 2019 1 次提交
    • R
      cgroup: add tracing points for cgroup v2 freezer · 4c476d8c
      Roman Gushchin 提交于
      Add cgroup:cgroup_freeze and cgroup:cgroup_unfreeze events,
      which are using the existing cgroup tracing infrastructure.
      
      Add the cgroup_event event class, which is similar to the cgroup
      class, but contains an additional integer field to store a new
      value (the level field is dropped).
      
      Also add two tracing events: cgroup_notify_populated and
      cgroup_notify_frozen, which are raised in a generic way using
      the TRACE_CGROUP_PATH() macro.
      
      This allows to trace cgroup state transitions and is generally
      helpful for debugging the cgroup freezer code.
      Signed-off-by: NRoman Gushchin <guro@fb.com>
      Signed-off-by: NTejun Heo <tj@kernel.org>
      4c476d8c
  15. 18 4月, 2019 2 次提交
  16. 17 4月, 2019 2 次提交
    • T
      random: only read from /dev/random after its pool has received 128 bits · eb9d1bf0
      Theodore Ts'o 提交于
      Immediately after boot, we allow reads from /dev/random before its
      entropy pool has been fully initialized.  Fix this so that we don't
      allow this until the blocking pool has received 128 bits.
      
      We do this by repurposing the initialized flag in the entropy pool
      struct, and use the initialized flag in the blocking pool to indicate
      whether it is safe to pull from the blocking pool.
      
      To do this, we needed to rework when we decide to push entropy from the
      input pool to the blocking pool, since the initialized flag for the
      input pool was used for this purpose.  To simplify things, we no
      longer use the initialized flag for that purpose, nor do we use the
      entropy_total field any more.
      Signed-off-by: NTheodore Ts'o <tytso@mit.edu>
      eb9d1bf0
    • C
      f2fs: add tracepoint for f2fs_file_write_iter() · 126ce721
      Chao Yu 提交于
      This patch adds tracepoint for f2fs_file_write_iter().
      Signed-off-by: NChao Yu <yuchao0@huawei.com>
      Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
      126ce721