Skip to content
  1. Jun 10, 2023
  2. Jun 06, 2023
  3. Jun 04, 2023
    • Tian Lan's avatar
      blk-mq: fix blk_mq_hw_ctx active request accounting · ddad5933
      Tian Lan authored
      
      
      The nr_active counter continues to increase over time which causes the
      blk_mq_get_tag to hang until the thread is rescheduled to a different
      core despite there are still tags available.
      
      kernel-stack
      
        INFO: task inboundIOReacto:3014879 blocked for more than 2 seconds
        Not tainted 6.1.15-amd64 #1 Debian 6.1.15~debian11
        "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
        task:inboundIOReacto state:D stack:0  pid:3014879 ppid:4557 flags:0x00000000
          Call Trace:
          <TASK>
          __schedule+0x351/0xa20
          scheduler+0x5d/0xe0
          io_schedule+0x42/0x70
          blk_mq_get_tag+0x11a/0x2a0
          ? dequeue_task_stop+0x70/0x70
          __blk_mq_alloc_requests+0x191/0x2e0
      
      kprobe output showing RQF_MQ_INFLIGHT bit is not cleared before
      __blk_mq_free_request being called.
      
        320    320  kworker/29:1H __blk_mq_free_request rq_flags 0x220c0 in-flight 1
               b'__blk_mq_free_request+0x1 [kernel]'
               b'bt_iter+0x50 [kernel]'
               b'blk_mq_queue_tag_busy_iter+0x318 [kernel]'
               b'blk_mq_timeout_work+0x7c [kernel]'
               b'process_one_work+0x1c4 [kernel]'
               b'worker_thread+0x4d [kernel]'
               b'kthread+0xe6 [kernel]'
               b'ret_from_fork+0x1f [kernel]'
      
      Signed-off-by: default avatarTian Lan <tian.lan@twosigma.com>
      Fixes: 2e315dc0
      
       ("blk-mq: grab rq->refcount before calling ->fn in blk_mq_tagset_busy_iter")
      Reviewed-by: default avatarMing Lei <ming.lei@redhat.com>
      Link: https://lore.kernel.org/r/20230513221227.497327-1-tilan7663@gmail.com
      Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
      ddad5933
  4. Jun 02, 2023
    • Jens Axboe's avatar
      Merge tag 'nvme-6.4-2023-06-01' of git://git.infradead.org/nvme into block-6.4 · 2e45a495
      Jens Axboe authored
      Pull NVMe fixes from Keith:
      
      "nvme fixes for Linux 6.4
      
       - Fixes for spurious Keep Alive timeouts (Uday)
       - Fix for command type check on passthrough actions (Min)
       - Fix for nvme command name for error logging (Christoph)"
      
      * tag 'nvme-6.4-2023-06-01' of git://git.infradead.org/nvme:
        nvme: fix the name of Zone Append for verbose logging
        nvme: improve handling of long keep alives
        nvme: check IO start time when deciding to defer KA
        nvme: double KA polling frequency to avoid KATO with TBKAS on
        nvme: fix miss command type check
      2e45a495
  5. Jun 01, 2023
  6. May 31, 2023
    • Uday Shankar's avatar
      nvme: improve handling of long keep alives · c7275ce6
      Uday Shankar authored
      
      
      Upon keep alive completion, nvme_keep_alive_work is scheduled with the
      same delay every time. If keep alive commands are completing slowly,
      this may cause a keep alive timeout. The following trace illustrates the
      issue, taking KATO = 8 and TBKAS off for simplicity:
      
      1. t = 0: run nvme_keep_alive_work, send keep alive
      2. t = ε: keep alive reaches controller, controller restarts its keep
                alive timer
      3. t = 4: host receives keep alive completion, schedules
                nvme_keep_alive_work with delay 4
      4. t = 8: run nvme_keep_alive_work, send keep alive
      
      Here, a keep alive having RTT of 4 causes a delay of at least 8 - ε
      between the controller receiving successive keep alives. With ε small,
      the controller is likely to detect a keep alive timeout.
      
      Fix this by calculating the RTT of the keep alive command, and adjusting
      the scheduling delay of the next keep alive work accordingly.
      
      Reported-by: default avatarCosta Sapuntzakis <costa@purestorage.com>
      Reported-by: default avatarRandy Jennings <randyj@purestorage.com>
      Signed-off-by: default avatarUday Shankar <ushankar@purestorage.com>
      Reviewed-by: default avatarHannes Reinecke <hare@suse.de>
      Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
      Signed-off-by: default avatarKeith Busch <kbusch@kernel.org>
      c7275ce6
    • Uday Shankar's avatar
      nvme: check IO start time when deciding to defer KA · 774a9636
      Uday Shankar authored
      
      
      When a command completes, we set a flag which will skip sending a
      keep alive at the next run of nvme_keep_alive_work when TBKAS is on.
      However, if the command was submitted long ago, it's possible that
      the controller may have also restarted its keep alive timer (as a
      result of receiving the command) long ago. The following trace
      demonstrates the issue, assuming TBKAS is on and KATO = 8 for
      simplicity:
      
      1. t = 0: submit I/O commands A, B, C, D, E
      2. t = 0.5: commands A, B, C, D, E reach controller, restart its keep
                  alive timer
      3. t = 1: A completes
      4. t = 2: run nvme_keep_alive_work, see recent completion, do nothing
      5. t = 3: B completes
      6. t = 4: run nvme_keep_alive_work, see recent completion, do nothing
      7. t = 5: C completes
      8. t = 6: run nvme_keep_alive_work, see recent completion, do nothing
      9. t = 7: D completes
      10. t = 8: run nvme_keep_alive_work, see recent completion, do nothing
      11. t = 9: E completes
      
      At this point, 8.5 seconds have passed without restarting the
      controller's keep alive timer, so the controller will detect a keep
      alive timeout.
      
      Fix this by checking the IO start time when deciding to defer sending a
      keep alive command. Only set comp_seen if the command started after the
      most recent run of nvme_keep_alive_work. With this change, the
      completions of B, C, and D will not set comp_seen and the run of
      nvme_keep_alive_work at t = 4 will send a keep alive.
      
      Reported-by: default avatarCosta Sapuntzakis <costa@purestorage.com>
      Reported-by: default avatarRandy Jennings <randyj@purestorage.com>
      Signed-off-by: default avatarUday Shankar <ushankar@purestorage.com>
      Reviewed-by: default avatarHannes Reinecke <hare@suse.de>
      Reviewed-by: default avatarSagi Grimberg <sagi@grimberg.me>
      Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
      Signed-off-by: default avatarKeith Busch <kbusch@kernel.org>
      774a9636
    • Uday Shankar's avatar
      nvme: double KA polling frequency to avoid KATO with TBKAS on · ea4d453b
      Uday Shankar authored
      
      
      With TBKAS on, the completion of one command can defer sending a
      keep alive for up to twice the delay between successive runs of
      nvme_keep_alive_work. The current delay of KATO / 2 thus makes it
      possible for one command to defer sending a keep alive for up to
      KATO, which can result in the controller detecting a KATO. The following
      trace demonstrates the issue, taking KATO = 8 for simplicity:
      
      1. t = 0: run nvme_keep_alive_work, no keep-alive sent
      2. t = ε: I/O completion seen, set comp_seen = true
      3. t = 4: run nvme_keep_alive_work, see comp_seen == true,
                skip sending keep-alive, set comp_seen = false
      4. t = 8: run nvme_keep_alive_work, see comp_seen == false,
                send a keep-alive command.
      
      Here, there is a delay of 8 - ε between receiving a command completion
      and sending the next command. With ε small, the controller is likely to
      detect a keep alive timeout.
      
      Fix this by running nvme_keep_alive_work with a delay of KATO / 4
      whenever TBKAS is on. Going through the above trace now gives us a
      worst-case delay of 4 - ε, which is in line with the recommendation of
      sending a command every KATO / 2 in the NVMe specification.
      
      Reported-by: default avatarCosta Sapuntzakis <costa@purestorage.com>
      Reported-by: default avatarRandy Jennings <randyj@purestorage.com>
      Signed-off-by: default avatarUday Shankar <ushankar@purestorage.com>
      Reviewed-by: default avatarHannes Reinecke <hare@suse.de>
      Reviewed-by: default avatarSagi Grimberg <sagi@grimberg.me>
      Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
      Signed-off-by: default avatarKeith Busch <kbusch@kernel.org>
      ea4d453b
  7. May 30, 2023
  8. May 29, 2023
    • Damien Le Moal's avatar
      block: fix revalidate performance regression · 47fe1c30
      Damien Le Moal authored
      The scsi driver function sd_read_block_characteristics() always calls
      disk_set_zoned() to a disk zoned model correctly, in case the device
      model changed. This is done even for regular disks to set the zoned
      model to BLK_ZONED_NONE and free any zone related resources if the drive
      previously was zoned.
      
      This behavior significantly impact the time it takes to revalidate disks
      on a large system as the call to disk_clear_zone_settings() done from
      disk_set_zoned() for the BLK_ZONED_NONE case results in the device
      request queued to be frozen, even if there are no zone resources to
      free.
      
      Avoid this overhead for non-zoned devices by not calling
      disk_clear_zone_settings() in disk_set_zoned() if the device model
      was already set to BLK_ZONED_NONE, which is always the case for regular
      devices.
      
      Reported by: Brian Bunker <brian@purestorage.com>
      
      Fixes: 508aebb8
      
       ("block: introduce blk_queue_clear_zone_settings()")
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarDamien Le Moal <dlemoal@kernel.org>
      Reviewed-by: default avatarMing Lei <ming.lei@redhat.com>
      Link: https://lore.kernel.org/r/20230529073237.1339862-1-dlemoal@kernel.org
      Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
      47fe1c30
  9. May 27, 2023
    • Jens Axboe's avatar
      Merge tag 'md-fixes-2023-05-24' of... · f270f858
      Jens Axboe authored
      Merge tag 'md-fixes-2023-05-24' of https://git.kernel.org/pub/scm/linux/kernel/git/song/md into block-6.4
      
      Pull MD fix from Song:
      
      "This change fixes a raid5 regression since 5.12 kernels."
      
      * tag 'md-fixes-2023-05-24' of https://git.kernel.org/pub/scm/linux/kernel/git/song/md:
        md/raid5: fix miscalculation of 'end_sector' in raid5_read_one_chunk()
      f270f858
  10. May 26, 2023
    • Jens Axboe's avatar
      Merge tag 'nvme-6.4-2023-05-26' of git://git.infradead.org/nvme into block-6.4 · 9491d01f
      Jens Axboe authored
      Pull NVMe fix from Keith:
      
      "nvme fixes for 6.4
      
       One nvme quirk (Tatsuki)"
      
      * tag 'nvme-6.4-2023-05-26' of git://git.infradead.org/nvme:
        NVMe: Add MAXIO 1602 to bogus nid list.
      9491d01f
    • Tatsuki Sugiura's avatar
      NVMe: Add MAXIO 1602 to bogus nid list. · a3a9d63d
      Tatsuki Sugiura authored
      
      
      HIKSEMI FUTURE M.2 SSD uses the same dummy nguid and eui64.
      I confirmed it with my two devices.
      
      This patch marks the controller as NVME_QUIRK_BOGUS_NID.
      
      ---------------------------------------------------------
      sugi@tempest:~% sudo nvme id-ctrl /dev/nvme0
      NVME Identify Controller:
      vid       : 0x1e4b
      ssvid     : 0x1e4b
      sn        : 30096022612
      mn        : HS-SSD-FUTURE 2048G
      fr        : SN10542
      rab       : 0
      ieee      : 000000
      cmic      : 0
      mdts      : 7
      cntlid    : 0
      ver       : 0x10400
      rtd3r     : 0x7a120
      rtd3e     : 0x1e8480
      oaes      : 0x200
      ctratt    : 0x2
      rrls      : 0
      cntrltype : 1
      fguid     : 00000000-0000-0000-0000-000000000000
      <snip...>
      ---------------------------------------------------------
      
      ---------------------------------------------------------
      sugi@tempest:~% sudo nvme id-ns /dev/nvme0n1
      NVME Identify Namespace 1:
      <snip...>
      nguid   : 00000000000000000000000000000000
      eui64   : 0000000000000002
      lbaf  0 : ms:0   lbads:9  rp:0 (in use)
      ---------------------------------------------------------
      
      Signed-off-by: default avatarTatsuki Sugiura <sugi@nemui.org>
      Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
      Signed-off-by: default avatarKeith Busch <kbusch@kernel.org>
      a3a9d63d
  11. May 25, 2023
  12. May 24, 2023
  13. May 20, 2023
    • Christoph Hellwig's avatar
      block: remove NFL4_UFLG_MASK · e3afec91
      Christoph Hellwig authored
      The NFL4_UFLG_MASK define slipped in in commit 9208d414
      
      
      ("block: add a ->get_unique_id method") and should never have been
      added, as NFSD as the only user of it already has it's copy.
      
      Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
      Link: https://lore.kernel.org/r/20230520090010.527046-1-hch@lst.de
      Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
      e3afec91
    • Loic Poulain's avatar
      block: Deny writable memory mapping if block is read-only · 69baa3a6
      Loic Poulain authored
      User should not be able to write block device if it is read-only at
      block level (e.g force_ro attribute). This is ensured in the regular
      fops write operation (blkdev_write_iter) but not when writing via
      user mapping (mmap), allowing user to actually write a read-only
      block device via a PROT_WRITE mapping.
      
      Example: This can lead to integrity issue of eMMC boot partition
      (e.g mmcblk0boot0) which is read-only by default.
      
      To fix this issue, simply deny shared writable mapping if the block
      is readonly.
      
      Note: Block remains writable if switch to read-only is performed
      after the initial mapping, but this is expected behavior according
      to commit a32e236e
      
       ("Partially revert "block: fail op_is_write()
      requests to read-only partitions"")'.
      
      Signed-off-by: default avatarLoic Poulain <loic.poulain@linaro.org>
      Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
      Link: https://lore.kernel.org/r/20230510074223.991297-1-loic.poulain@linaro.org
      Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
      69baa3a6
    • Stefan Haberland's avatar
      s390/dasd: fix command reject error on ESE devices · c99bff34
      Stefan Haberland authored
      Formatting a thin-provisioned (ESE) device that is part of a PPRC copy
      relation might fail with the following error:
      
      dasd-eckd 0.0.f500: An error occurred in the DASD device driver, reason=09
      [...]
      24 Byte: 0 MSG 4, no MSGb to SYSOP
      
      During format of an ESE disk the Release Allocated Space command is used.
      A bit in the payload of the command is set that is not allowed to be set
      for devices in a copy relation. This bit is set to allow the partial
      release of an extent.
      
      Check for the existence of a copy relation before setting the respective
      bit.
      
      Fixes: 91dc4a19
      
       ("s390/dasd: Add new ioctl to release space")
      Cc: stable@kernel.org # 5.3+
      Signed-off-by: default avatarStefan Haberland <sth@linux.ibm.com>
      Reviewed-by: default avatarJan Hoeppner <hoeppner@linux.ibm.com>
      Link: https://lore.kernel.org/r/20230519102340.3854819-2-sth@linux.ibm.com
      Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
      c99bff34
  14. May 19, 2023
  15. May 18, 2023
    • Ming Lei's avatar
      ublk: fix AB-BA lockdep warning · ac5902f8
      Ming Lei authored
      
      
      When handling UBLK_IO_FETCH_REQ, ctx->uring_lock is grabbed first, then
      ub->mutex is acquired.
      
      When handling UBLK_CMD_STOP_DEV or UBLK_CMD_DEL_DEV, ub->mutex is
      grabbed first, then calling io_uring_cmd_done() for canceling uring
      command, in which ctx->uring_lock may be required.
      
      Real deadlock only happens when all the above commands are issued from
      same uring context, and in reality different uring contexts are often used
      for handing control command and IO command.
      
      Fix the issue by using io_uring_cmd_complete_in_task() to cancel command
      in ublk_cancel_dev(ublk_cancel_queue).
      
      Reported-by: default avatarShinichiro Kawasaki <shinichiro.kawasaki@wdc.com>
      Closes: https://lore.kernel.org/linux-block/becol2g7sawl4rsjq2dztsbc7mqypfqko6wzsyoyazqydoasml@rcxarzwidrhk
      Cc: Ziyang Zhang <ZiyangZhang@linux.alibaba.com>
      Signed-off-by: default avatarMing Lei <ming.lei@redhat.com>
      Tested-by: default avatarShinichiro Kawasaki <shinichiro.kawasaki@wdc.com>
      Link: https://lore.kernel.org/r/20230517133408.210944-1-ming.lei@redhat.com
      Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
      ac5902f8
  16. May 17, 2023
  17. May 13, 2023
  18. May 12, 2023
    • Ming Lei's avatar
      ublk: fix command op code check · e485bd9e
      Ming Lei authored
      In case of CONFIG_BLKDEV_UBLK_LEGACY_OPCODES, type of cmd opcode could
      be 0 or 'u'; and type can only be 'u' if CONFIG_BLKDEV_UBLK_LEGACY_OPCODES
      isn't set.
      
      So fix the wrong check.
      
      Fixes: 2d786e66
      
       ("block: ublk: switch to ioctl command encoding")
      Signed-off-by: default avatarMing Lei <ming.lei@redhat.com>
      Link: https://lore.kernel.org/r/20230505153142.1258336-1-ming.lei@redhat.com
      Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
      e485bd9e
    • Guoqing Jiang's avatar
      block/rnbd: replace REQ_OP_FLUSH with REQ_OP_WRITE · 5e6e0808
      Guoqing Jiang authored
      
      
      Since flush bios are implemented as writes with no data and
      the preflush flag per Christoph's comment [1].
      
      And we need to change it in rnbd accordingly. Otherwise, I
      got splatting when create fs from rnbd client.
      
      [  464.028545] ------------[ cut here ]------------
      [  464.028553] WARNING: CPU: 0 PID: 65 at block/blk-core.c:751 submit_bio_noacct+0x32c/0x5d0
      [ ... ]
      [  464.028668] CPU: 0 PID: 65 Comm: kworker/0:1H Tainted: G           OE      6.4.0-rc1 #9
      [  464.028671] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS rel-1.15.0-0-g2dd4b9b-rebuilt.opensuse.org 04/01/2014
      [  464.028673] Workqueue: ib-comp-wq ib_cq_poll_work [ib_core]
      [  464.028717] RIP: 0010:submit_bio_noacct+0x32c/0x5d0
      [  464.028720] Code: 03 0f 85 51 fe ff ff 48 8b 43 18 8b 88 04 03 00 00 85 c9 0f 85 3f fe ff ff e9 be fd ff ff 0f b6 d0 3c 0d 74 26 83 fa 01 74 21 <0f> 0b b8 0a 00 00 00 e9 56 fd ff ff 4c 89 e7 e8 70 a1 03 00 84 c0
      [  464.028722] RSP: 0018:ffffaf3680b57c68 EFLAGS: 00010202
      [  464.028724] RAX: 0000000000060802 RBX: ffffa09dcc18bf00 RCX: 0000000000000000
      [  464.028726] RDX: 0000000000000002 RSI: 0000000000000000 RDI: ffffa09dde081d00
      [  464.028727] RBP: ffffaf3680b57c98 R08: ffffa09dde081d00 R09: ffffa09e38327200
      [  464.028729] R10: 0000000000000000 R11: 0000000000000000 R12: ffffa09dde081d00
      [  464.028730] R13: ffffa09dcb06e1e8 R14: 0000000000000000 R15: 0000000000200000
      [  464.028733] FS:  0000000000000000(0000) GS:ffffa09e3bc00000(0000) knlGS:0000000000000000
      [  464.028735] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      [  464.028736] CR2: 000055a4e8206c40 CR3: 0000000119f06000 CR4: 00000000003506f0
      [  464.028738] Call Trace:
      [  464.028740]  <TASK>
      [  464.028746]  submit_bio+0x1b/0x80
      [  464.028748]  rnbd_srv_rdma_ev+0x50d/0x10c0 [rnbd_server]
      [  464.028754]  ? percpu_ref_get_many.constprop.0+0x55/0x140 [rtrs_server]
      [  464.028760]  ? __this_cpu_preempt_check+0x13/0x20
      [  464.028769]  process_io_req+0x1dc/0x450 [rtrs_server]
      [  464.028775]  rtrs_srv_inv_rkey_done+0x67/0xb0 [rtrs_server]
      [  464.028780]  __ib_process_cq+0xbc/0x1f0 [ib_core]
      [  464.028793]  ib_cq_poll_work+0x2b/0xa0 [ib_core]
      [  464.028804]  process_one_work+0x2a9/0x580
      
      [1]. https://lore.kernel.org/all/ZFHgefWofVt24tRl@infradead.org/
      
      Signed-off-by: default avatarGuoqing Jiang <guoqing.jiang@linux.dev>
      Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
      Reviewed-by: default avatarChaitanya Kulkarni <kch@nvidia.com>
      Link: https://lore.kernel.org/r/20230512034631.28686-1-guoqing.jiang@linux.dev
      Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
      5e6e0808
    • Ivan Orlov's avatar
      nbd: Fix debugfs_create_dir error checking · 4913cfcf
      Ivan Orlov authored
      
      
      The debugfs_create_dir function returns ERR_PTR in case of error, and the
      only correct way to check if an error occurred is 'IS_ERR' inline function.
      This patch will replace the null-comparison with IS_ERR.
      
      Signed-off-by: default avatarIvan Orlov <ivan.orlov0322@gmail.com>
      Link: https://lore.kernel.org/r/20230512130533.98709-1-ivan.orlov0322@gmail.com
      Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
      4913cfcf
  19. May 08, 2023
    • Linus Torvalds's avatar
      Linux 6.4-rc1 · ac9a7868
      Linus Torvalds authored
      ac9a7868
    • Linus Torvalds's avatar
      Merge tag 'perf-tools-for-v6.4-3-2023-05-06' of... · f085df1b
      Linus Torvalds authored
      Merge tag 'perf-tools-for-v6.4-3-2023-05-06' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux
      
      Pull perf tool updates from Arnaldo Carvalho de Melo:
       "Third version of perf tool updates, with the build problems with with
        using a 'vmlinux.h' generated from the main build fixed, and the bpf
        skeleton build disabled by default.
      
        Build:
      
         - Require libtraceevent to build, one can disable it using
           NO_LIBTRACEEVENT=1.
      
           It is required for tools like 'perf sched', 'perf kvm', 'perf
           trace', etc.
      
           libtraceevent is available in most distros so installing
           'libtraceevent-devel' should be a one-time event to continue
           building perf as usual.
      
           Using NO_LIBTRACEEVENT=1 produces tooling that is functional and
           sufficient for lots of users not interested in those libtraceevent
           dependent features.
      
         - Allow Python support in 'perf script' when libtraceevent isn't
           linked, as not all features requires it, for instance Intel PT does
           not use tracepoints.
      
         - Error if the python interpreter needed for jevents to work isn't
           available and NO_JEVENTS=1 isn't set, preventing a build without
           support for JSON vendor events, which is a rare but possible
           condition. The two check error messages:
      
              $(error ERROR: No python interpreter needed for jevents generation. Install python or build with NO_JEVENTS=1.)
              $(error ERROR: Python interpreter needed for jevents generation too old (older than 3.6). Install a newer python or build with NO_JEVENTS=1.)
      
         - Make libbpf 1.0 the minimum required when building with out of
           tree, distro provided libbpf.
      
         - Use libsdtc++'s and LLVM's libcxx's __cxa_demangle, a portable C++
           demangler, add 'perf test' entry for it.
      
         - Make binutils libraries opt in, as distros disable building with it
           due to licensing, they were used for C++ demangling, for instance.
      
         - Switch libpfm4 to opt-out rather than opt-in, if libpfm-devel (or
           equivalent) isn't installed, we'll just have a build warning:
      
             Makefile.config:1144: libpfm4 not found, disables libpfm4 support. Please install libpfm4-dev
      
         - Add a feature test for scandirat(), that is not implemented so far
           in musl and uclibc, disabling features that need it, such as
           scanning for tracepoints in /sys/kernel/tracing/events.
      
        perf BPF filters:
      
         - New feature where BPF can be used to filter samples, for instance:
      
            $ sudo ./perf record -e cycles --filter 'period > 1000' true
            $ sudo ./perf script
                 perf-exec 2273949 546850.708501:       5029 cycles:  ffffffff826f9e25 finish_wait+0x5 ([kernel.kallsyms])
                 perf-exec 2273949 546850.708508:      32409 cycles:  ffffffff826f9e25 finish_wait+0x5 ([kernel.kallsyms])
                 perf-exec 2273949 546850.708526:     143369 cycles:  ffffffff82b4cdbf xas_start+0x5f ([kernel.kallsyms])
                 perf-exec 2273949 546850.708600:     372650 cycles:  ffffffff8286b8f7 __pagevec_lru_add+0x117 ([kernel.kallsyms])
                 perf-exec 2273949 546850.708791:     482953 cycles:  ffffffff829190de __mod_memcg_lruvec_state+0x4e ([kernel.kallsyms])
                      true 2273949 546850.709036:     501985 cycles:  ffffffff828add7c tlb_gather_mmu+0x4c ([kernel.kallsyms])
                      true 2273949 546850.709292:     503065 cycles:      7f2446d97c03 _dl_map_object_deps+0x973 (/usr/lib/x86_64-linux-gnu/ld-linux-x86-64.so.2)
      
         - In addition to 'period' (PERF_SAMPLE_PERIOD), the other
           PERF_SAMPLE_ can be used for filtering, and also some other sample
           accessible values, from tools/perf/Documentation/perf-record.txt:
      
              Essentially the BPF filter expression is:
      
              <term> <operator> <value> (("," | "||") <term> <operator> <value>)*
      
           The <term> can be one of:
              ip, id, tid, pid, cpu, time, addr, period, txn, weight, phys_addr,
              code_pgsz, data_pgsz, weight1, weight2, weight3, ins_lat, retire_lat,
              p_stage_cyc, mem_op, mem_lvl, mem_snoop, mem_remote, mem_lock,
              mem_dtlb, mem_blk, mem_hops
      
           The <operator> can be one of:
              ==, !=, >, >=, <, <=, &
      
           The <value> can be one of:
              <number> (for any term)
              na, load, store, pfetch, exec (for mem_op)
              l1, l2, l3, l4, cxl, io, any_cache, lfb, ram, pmem (for mem_lvl)
              na, none, hit, miss, hitm, fwd, peer (for mem_snoop)
              remote (for mem_remote)
              na, locked (for mem_locked)
              na, l1_hit, l1_miss, l2_hit, l2_miss, any_hit, any_miss, walk, fault (for mem_dtlb)
              na, by_data, by_addr (for mem_blk)
              hops0, hops1, hops2, hops3 (for mem_hops)
      
        perf lock contention:
      
         - Show lock type with address.
      
         - Track and show mmap_lock, siglock and per-cpu rq_lock with address.
           This is done for mmap_lock by following the current->mm pointer:
      
            $ sudo ./perf lock con -abl -- sleep 10
             contended   total wait     max wait     avg wait            address   symbol
             ...
                 16344    312.30 ms      2.22 ms     19.11 us   ffff8cc702595640
                 17686    310.08 ms      1.49 ms     17.53 us   ffff8cc7025952c0
                     3     84.14 ms     45.79 ms     28.05 ms   ffff8cc78114c478   mmap_lock
                  3557     76.80 ms     68.75 us     21.59 us   ffff8cc77ca3af58
                     1     68.27 ms     68.27 ms     68.27 ms   ffff8cda745dfd70
                     9     54.53 ms      7.96 ms      6.06 ms   ffff8cc7642a48b8   mmap_lock
                 14629     44.01 ms     60.00 us      3.01 us   ffff8cc7625f9ca0
                  3481     42.63 ms    140.71 us     12.24 us   ffffffff937906ac   vmap_area_lock
                 16194     38.73 ms     42.15 us      2.39 us   ffff8cd397cbc560
                    11     38.44 ms     10.39 ms      3.49 ms   ffff8ccd6d12fbb8   mmap_lock
                     1      5.43 ms      5.43 ms      5.43 ms   ffff8cd70018f0d8
                  1674      5.38 ms    422.93 us      3.21 us   ffffffff92e06080   tasklist_lock
                   581      4.51 ms    130.68 us      7.75 us   ffff8cc9b1259058
                     5      3.52 ms      1.27 ms    703.23 us   ffff8cc754510070
                   112      3.47 ms     56.47 us     31.02 us   ffff8ccee38b3120
                   381      3.31 ms     73.44 us      8.69 us   ffffffff93790690   purge_vmap_area_lock
                   255      3.19 ms     36.35 us     12.49 us   ffff8d053ce30c80
      
         - Update default map size to 16384.
      
         - Allocate single letter option -M for --map-nr-entries, as it is
           proving being frequently used.
      
         - Fix struct rq lock access for older kernels with BPF's CO-RE
           (Compile once, run everywhere).
      
         - Fix problems found with MSAn.
      
        perf report/top:
      
         - Add inline information when using --call-graph=fp or lbr, as was
           already done to the --call-graph=dwarf callchain mode.
      
         - Improve the 'srcfile' sort key performance by really using an
           optimization introduced in 6.2 for the 'srcline' sort key that
           avoids calling addr2line for comparision with each sample.
      
        perf sched:
      
         - Make 'perf sched latency/map/replay' to use "sched:sched_waking"
           instead of "sched:sched_waking", consistent with 'perf record'
           since d566a9c2 ("perf sched: Prefer sched_waking event when it
           exists").
      
        perf ftrace:
      
         - Make system wide the default target for latency subcommand, run the
           following command then generate some network traffic and press
           control+C:
      
             # perf ftrace latency -T __kfree_skb
           ^C
               DURATION     |      COUNT | GRAPH                                          |
                0 - 1    us |         27 | #############                                  |
                1 - 2    us |         22 | ###########                                    |
                2 - 4    us |          8 | ####                                           |
                4 - 8    us |          5 | ##                                             |
                8 - 16   us |         24 | ############                                   |
               16 - 32   us |          2 | #                                              |
               32 - 64   us |          1 |                                                |
               64 - 128  us |          0 |                                                |
              128 - 256  us |          0 |                                                |
              256 - 512  us |          0 |                                                |
              512 - 1024 us |          0 |                                                |
                1 - 2    ms |          0 |                                                |
                2 - 4    ms |          0 |                                                |
                4 - 8    ms |          0 |                                                |
                8 - 16   ms |          0 |                                                |
               16 - 32   ms |          0 |                                                |
               32 - 64   ms |          0 |                                                |
               64 - 128  ms |          0 |                                                |
              128 - 256  ms |          0 |                                                |
              256 - 512  ms |          0 |                                                |
              512 - 1024 ms |          0 |                                                |
                1 - ...   s |          0 |                                                |
             #
      
        perf top:
      
         - Add --branch-history (LBR: Last Branch Record) option, just like
           already available for 'perf record'.
      
         - Fix segfault in thread__comm_len() where thread->comm was being
           used outside thread->comm_lock.
      
        perf annotate:
      
         - Allow configuring objdump and addr2line in ~/.perfconfig., so that
           you can use alternative binaries, such as llvm's.
      
        perf kvm:
      
         - Add TUI mode for 'perf kvm stat report'.
      
        Reference counting:
      
         - Add reference count checking infrastructure to check for use after
           free, done to the 'cpumap', 'namespaces', 'maps' and 'map' structs,
           more to come.
      
           To build with it use -DREFCNT_CHECKING=1 in the make command line
           to build tools/perf. Documented at:
      
             https://perf.wiki.kernel.org/index.php/Reference_Count_Checking
      
         - The above caught, for instance, fix, present in this series:
      
              - Fix maps use after put in 'perf test "Share thread maps"':
      
                'maps' is copied from leader, but the leader is put on line 79
                and then 'maps' is used to read the reference count below - so
                a use after put, with the put of maps happening within
                thread__put.
      
           Fixed by reversing the order of puts so that the leader is put
           last.
      
         - Also several fixes were made to places where reference counts were
           not being held.
      
         - Make this one of the tests in 'make -C tools/perf build-test' to
           regularly build test it and to make sure no direct access to the
           reference counted structs are made, doing that via accessors to
           check the validity of the struct pointer.
      
        ARM64:
      
         - Fix 'perf report' segfault when filtering coresight traces by
           sparse lists of CPUs.
      
         - Add support for 'simd' as a sort field for 'perf report', to show
           ARM's NEON SIMD's predicate flags: "partial" and "empty".
      
        arm64 vendor events:
      
         - Add N1 metrics.
      
        Intel vendor events:
      
         - Add graniterapids, grandridge and sierraforrest events.
      
         - Refresh events for: alderlake, aldernaken, broadwell, broadwellde,
           broadwellx, cascadelakx, haswell, haswellx, icelake, icelakex,
           jaketown, meteorlake, knightslanding, sandybridge, sapphirerapids,
           silvermont, skylake, tigerlake and westmereep-dp
      
         - Refresh metrics for alderlake-n, broadwell, broadwellde,
           broadwellx, haswell, haswellx, icelakex, ivybridge, ivytown and
           skylakex.
      
        perf stat:
      
         - Implement --topdown using JSON metrics.
      
         - Add TopdownL1 JSON metric as a default if present, but disable it
           for now for some Intel hybrid architectures, a series of patches
           addressing this is being reviewed and will be submitted for v6.5.
      
         - Use metrics for --smi-cost.
      
         - Update topdown documentation.
      
        Vendor events (JSON) infrastructure:
      
         - Add support for computing and printing metric threshold values. For
           instance, here is one found in thesapphirerapids json file:
      
             {
                 "BriefDescription": "Percentage of cycles spent in System Management Interrupts.",
                 "MetricExpr": "((msr@aperf@ - cycles) / msr@aperf@ if msr@smi@ > 0 else 0)",
                 "MetricGroup": "smi",
                 "MetricName": "smi_cycles",
                 "MetricThreshold": "smi_cycles > 0.1",
                 "ScaleUnit": "100%"
             },
      
         - Test parsing metric thresholds with the fake PMU in 'perf test
           pmu-events'.
      
         - Support for printing metric thresholds in 'perf list'.
      
         - Add --metric-no-threshold option to 'perf stat'.
      
         - Add rand (reverse and) and has_pmem (optane memory) support to
           metrics.
      
         - Sort list of input files to avoid depending on the order from
           readdir() helping in obtaining reproducible builds.
      
        S/390:
      
         - Add common metrics: - CPI (cycles per instruction), prbstate (ratio
           of instructions executed in problem state compared to total number
           of instructions), l1mp (Level one instruction and data cache misses
           per 100 instructions).
      
         - Add cache metrics for z13, z14, z15 and z16.
      
         - Add metric for TLB and cache.
      
        ARM:
      
         - Add raw decoding for SPE (Statistical Profiling Extension) v1.3 MTE
           (Memory Tagging Extension) and MOPS (Memory Operations) load/store.
      
        Intel PT hardware tracing:
      
         - Add event type names UINTR (User interrupt delivered) and UIRET
           (Exiting from user interrupt routine), documented in table 32-50
           "CFE Packet Type and Vector Fields Details" in the Intel Processor
           Trace chapter of The Intel SDM Volume 3 version 078.
      
         - Add support for new branch instructions ERETS and ERETU.
      
         - Fix CYC timestamps after standalone CBR
      
        ARM CoreSight hardware tracing:
      
         - Allow user to override timestamp and contextid settings.
      
         - Fix segfault in dso lookup.
      
         - Fix timeless decode mode detection.
      
         - Add separate decode paths for timeless and per-thread modes.
      
        auxtrace:
      
         - Fix address filter entire kernel size.
      
        Miscellaneous:
      
         - Fix use-after-free and unaligned bugs in the PLT handling routines.
      
         - Use zfree() to reduce chances of use after free.
      
         - Add missing 0x prefix for addresses printed in hexadecimal in 'perf
           probe'.
      
         - Suppress massive unsupported target platform errors in the unwind
           code.
      
         - Fix return incorrect build_id size in elf_read_build_id().
      
         - Fix 'perf scripts intel-pt-events.py' IPC output for Python 2 .
      
         - Add missing new parameter in kfree_skb tracepoint to the python
           scripts using it.
      
         - Add 'perf bench syscall fork' benchmark.
      
         - Add support for printing PERF_MEM_LVLNUM_UNC (Uncached access) in
           'perf mem'.
      
         - Fix wrong size expectation for perf test 'Setup struct
           perf_event_attr' caused by the patch adding
           perf_event_attr::config3.
      
         - Fix some spelling mistakes"
      
      * tag 'perf-tools-for-v6.4-3-2023-05-06' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux: (365 commits)
        Revert "perf build: Make BUILD_BPF_SKEL default, rename to NO_BPF_SKEL"
        Revert "perf build: Warn for BPF skeletons if endian mismatches"
        perf metrics: Fix SEGV with --for-each-cgroup
        perf bpf skels: Stop using vmlinux.h generated from BTF, use subset of used structs + CO-RE
        perf stat: Separate bperf from bpf_profiler
        perf test record+probe_libc_inet_pton: Fix call chain match on x86_64
        perf test record+probe_libc_inet_pton: Fix call chain match on s390
        perf tracepoint: Fix memory leak in is_valid_tracepoint()
        perf cs-etm: Add fix for coresight trace for any range of CPUs
        perf build: Fix unescaped # in perf build-test
        perf unwind: Suppress massive unsupported target platform errors
        perf script: Add new parameter in kfree_skb tracepoint to the python scripts using it
        perf script: Print raw ip instead of binary offset for callchain
        perf symbols: Fix return incorrect build_id size in elf_read_build_id()
        perf list: Modify the warning message about scandirat(3)
        perf list: Fix memory leaks in print_tracepoint_events()
        perf lock contention: Rework offset calculation with BPF CO-RE
        perf lock contention: Fix struct rq lock access
        perf stat: Disable TopdownL1 on hybrid
        perf stat: Avoid SEGV on counter->name
        ...
      f085df1b
    • Linus Torvalds's avatar
      Merge tag 'core-debugobjects-2023-05-06' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 17784de6
      Linus Torvalds authored
      Pull debugobjects fix from Thomas Gleixner:
       "A single fix for debugobjects:
      
        The recent fix to ensure atomicity of lookup and allocation
        inadvertently broke the pool refill mechanism, so that debugobject
        OOMs now in certain situations. The reason is that the functions which
        got updated no longer invoke debug_objecs_init(), which is now the
        only place to care about refilling the tracking object pool.
      
        Restore the original behaviour by adding explicit refill opportunities
        to those places"
      
      * tag 'core-debugobjects-2023-05-06' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        debugobject: Ensure pool refill (again)
      17784de6
    • Linus Torvalds's avatar
      Merge tag 'v6.4-p2' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6 · 6f69c981
      Linus Torvalds authored
      Pull crypto fixes from Herbert Xu:
      
       - A long-standing bug in crypto_engine
      
       - A buggy but harmless check in the sun8i-ss driver
      
       - A regression in the CRYPTO_USER interface
      
      * tag 'v6.4-p2' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6:
        crypto: api - Fix CRYPTO_USER checks for report function
        crypto: engine - fix crypto_queue backlog handling
        crypto: sun8i-ss - Fix a test in sun8i_ss_setup_ivs()
      6f69c981
    • Linus Torvalds's avatar
      Merge tag '6.4-rc-smb3-client-fixes-part2' of git://git.samba.org/sfrench/cifs-2.6 · 63342b1d
      Linus Torvalds authored
      Pull cifs fixes from Steve French:
       "smb3 client fixes, mostly DFS or reconnect related:
      
         - Two DFS connection sharing fixes
      
         - DFS refresh fix
      
         - Reconnect fix
      
         - Two potential use after free fixes
      
         - Also print prefix patch in mount debug msg
      
         - Two small cleanup fixes"
      
      * tag '6.4-rc-smb3-client-fixes-part2' of git://git.samba.org/sfrench/cifs-2.6:
        cifs: Remove unneeded semicolon
        cifs: fix sharing of DFS connections
        cifs: avoid potential races when handling multiple dfs tcons
        cifs: protect access of TCP_Server_Info::{origin,leaf}_fullpath
        cifs: fix potential race when tree connecting ipc
        cifs: fix potential use-after-free bugs in TCP_Server_Info::hostname
        cifs: print smb3_fs_context::source when mounting
        cifs: protect session status check in smb2_reconnect()
        SMB3.1.1: correct definition for app_instance_id create contexts
      63342b1d
    • Linus Torvalds's avatar
      Merge tag 'clk-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/clk/linux · d6b8a8c4
      Linus Torvalds authored
      Pull clk fixes from Stephen Boyd:
       "A couple more patches that would be good to get into -rc1:
      
         - Revert an i.MX patch that's causing video failures because division
           math goes sideways
      
         - Fix a clang + W=1 build isue where FIELD_PREP() is taking a 32-bit
           variable instead of the usual u64 type
      
         - Fix a Kconfig bug in the StarFive JH7110 clk config that selects a
           reset controller when it can't be selected"
      
      * tag 'clk-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/clk/linux:
        clk: starfive: Fix RESET_STARFIVE_JH7110 can't be selected in a specified case
        clk: sp7021: Adjust width of _m in HWM_FIELD_PREP()
        Revert "clk: imx: composite-8m: Add support to determine_rate"
      d6b8a8c4
    • Linus Torvalds's avatar
      Merge tag 'mailbox-v6.4' of git://git.linaro.org/landing-teams/working/fujitsu/integration · 1c1094e4
      Linus Torvalds authored
      Pull mailbox updates from Jassi Brar:
      
       - mailbox api: allow direct registration to a channel and convert omap
         and pcc to use mbox_bind_client
      
       - omap and hi6220 : use of_property_read_bool
      
       - test: fix double-free and use spinlock header
      
       - rockchip and bcm-pdc: drop of_match_ptr
      
       - mpfs: change config symbol
      
       - mediatek gce: support MT6795
      
       - qcom apcs: consolidate of_device_id and support IPQ9574
      
      * tag 'mailbox-v6.4' of git://git.linaro.org/landing-teams/working/fujitsu/integration:
        dt-bindings: mailbox: qcom: add compatible for IPQ9574 SoC
        mailbox: qcom-apcs-ipc: do not grow the of_device_id
        dt-bindings: mailbox: qcom,apcs-kpss-global: use fallbacks for few variants
        dt-bindings: mailbox: mediatek,gce-mailbox: Add support for MT6795
        mailbox: mpfs: convert SOC_MICROCHIP_POLARFIRE to ARCH_MICROCHIP_POLARFIRE
        mailbox: bcm-pdc: drop of_match_ptr for ID table
        mailbox: rockchip: drop of_match_ptr for ID table
        mailbox: mailbox-test: Fix potential double-free in mbox_test_message_write()
        mailbox: mailbox-test: Explicitly include header for spinlock support
        mailbox: Use of_property_read_bool() for boolean properties
        mailbox: pcc: Use mbox_bind_client
        mailbox: omap: Use mbox_bind_client
        mailbox: Allow direct registration to a channel
      1c1094e4
    • Linus Torvalds's avatar
      Merge tag 'for-6.4/io_uring-2023-05-07' of git://git.kernel.dk/linux · 03e5cb7b
      Linus Torvalds authored
      Pull more io_uring updates from Jens Axboe:
       "Nothing major in here, just two different parts:
      
         - A small series from Breno that enables passing the full SQE down
           for ->uring_cmd().
      
           This is a prerequisite for enabling full network socket operations.
           Queued up a bit late because of some stylistic concerns that got
           resolved, would be nice to have this in 6.4-rc1 so the dependent
           work will be easier to handle for 6.5.
      
         - Fix for the huge page coalescing, which was a regression introduced
           in the 6.3 kernel release (Tobias)"
      
      * tag 'for-6.4/io_uring-2023-05-07' of git://git.kernel.dk/linux:
        io_uring: Remove unnecessary BUILD_BUG_ON
        io_uring: Pass whole sqe to commands
        io_uring: Create a helper to return the SQE size
        io_uring/rsrc: check for nonconsecutive pages
      03e5cb7b
  20. May 07, 2023