1. 20 May, 2024 2 commits
    • Mike Snitzer's avatar
      dm: always manage discard support in terms of max_hw_discard_sectors · 825d8bbd
      Mike Snitzer authored
      Commit 4f563a64 ("block: add a max_user_discard_sectors queue
      limit") changed block core to set max_discard_sectors to:
       min(lim->max_hw_discard_sectors, lim->max_user_discard_sectors)
      
      Since commit 1c0e7202 ("dm: use queue_limits_set") it was reported
      dm-thinp was failing in a few fstests (generic/347 and generic/405)
      with the first WARN_ON_ONCE in dm_cell_key_has_valid_range() being
      reported, e.g.:
      WARNING: CPU: 1 PID: 30 at drivers/md/dm-bio-prison-v1.c:128 dm_cell_key_has_valid_range+0x3d/0x50
      
      blk_set_stacking_limits() sets max_user_discard_sectors to UINT_MAX,
      so given how block core now sets max_discard_sectors (detailed above)
      it follows that blk_stack_limits() stacks up the underlying device's
      max_hw_discard_sectors and max_discard_sectors is set to match it. If
      max_hw_discard_sectors exceeds dm's BIO_PRISON_MAX_RANGE, then
      dm_cell_key_has_valid_range() will trigger the warning with:
      WARN_ON_ONCE(key->block_end - key->block_begin > BIO_PRISON_MAX_RANGE)
      
      Aside from this warning, the discard will fail.  Fix this and other DM
      issues by governing discard support in terms of max_hw_discard_sectors
      instead of max_discard_sectors.
      Reported-by: default avatarTheodore Ts'o <tytso@mit.edu>
      Fixes: 1c0e7202 ("dm: use queue_limits_set")
      Signed-off-by: default avatarMike Snitzer <snitzer@kernel.org>
      825d8bbd
    • Mikulas Patocka's avatar
      dm-integrity: set discard_granularity to logical block size · 69381cf8
      Mikulas Patocka authored
      dm-integrity could set discard_granularity lower than the logical block
      size. This could result in failures when sending discard requests to
      dm-integrity.
      
      This fix is needed for kernels prior to 6.10.
      Signed-off-by: default avatarMikulas Patocka <mpatocka@redhat.com>
      Reported-by: default avatarEric Wheeler <linux-integrity@lists.ewheeler.net>
      Cc: stable@vger.kernel.org # <= 6.9
      Signed-off-by: default avatarMike Snitzer <snitzer@kernel.org>
      69381cf8
  2. 09 May, 2024 5 commits
    • Benjamin Marzinski's avatar
      dm-delay: remove timer_lock · 8b21ac87
      Benjamin Marzinski authored
      Instead of manually checking the timer details in queue_timeout(), call
      timer_reduce() to start the timer or reduce the expiration time. This
      avoids needing a lock.
      Signed-off-by: default avatarBenjamin Marzinski <bmarzins@redhat.com>
      Signed-off-by: default avatarMike Snitzer <snitzer@kernel.org>
      8b21ac87
    • Benjamin Marzinski's avatar
      dm-delay: change locking to avoid contention · c542ee14
      Benjamin Marzinski authored
      The delayed_bios list is protected by one mutex shared by all dm-delay
      devices. This mutex must be held whenever a bio is added or expired bios
      are removed from the list.  Since a large number of expired bios could
      be on the list, flush_delayed_bios() can schedule while holding the
      mutex. This means a flush_delayed_bios() call on any dm-delay device can
      slow down delay_map() calls on any other dm-delay device.
      
      To keep dm-delay devices from slowing each other down and keep
      processing delay bios from slowing adding delayed bios, the global mutex
      has been removed, and each dm-delay device now has two locks.
      delayed_bios_lock is a spinlock that must be held whenever the
      delayed_bios list is accessed. process_bios_lock is a mutex that must be
      held whenever a process has temporarily pulled bios off the delayed_bios
      list to check which ones should be processed. It must be held until all
      the bios that won't be processed are returned to the list. This is what
      flush_delayed_bios() now does. The mutex is necessary to guarantee that
      delay_presuspend() sees the entire list of delayed bios when it calls
      flush_delayed_bios().
      Signed-off-by: default avatarBenjamin Marzinski <bmarzins@redhat.com>
      Signed-off-by: default avatarMike Snitzer <snitzer@kernel.org>
      c542ee14
    • Benjamin Marzinski's avatar
      dm-delay: fix max_delay calculations · 64eb88d6
      Benjamin Marzinski authored
      delay_ctr() pointlessly compared max_delay in cases where multiple delay
      classes were initialized identically. Also, when write delays were
      configured different than read delays, delay_ctr() never compared their
      value against max_delay. Fix these issues.
      
      Fixes: 70bbeb29 ("dm delay: for short delays, use kthread instead of timers and wq")
      Signed-off-by: default avatarBenjamin Marzinski <bmarzins@redhat.com>
      Signed-off-by: default avatarMike Snitzer <snitzer@kernel.org>
      64eb88d6
    • Joel Colledge's avatar
      dm-delay: fix hung task introduced by kthread mode · d14646f2
      Joel Colledge authored
      If the worker thread is not woken due to a bio, then it is not woken at
      all. This causes the hung task check to trigger. This occurs, for
      instance, when no bios are submitted. Also when a delay of 0 is
      configured, delay_bio() returns without waking the worker.
      
      Prevent the hung task check from triggering by creating the thread with
      kthread_run() instead of using kthread_create() directly.
      
      Fixes: 70bbeb29 ("dm delay: for short delays, use kthread instead of timers and wq")
      Signed-off-by: default avatarJoel Colledge <joel.colledge@linbit.com>
      Reviewed-by: default avatarBenjamin Marzinski <bmarzins@redhat.com>
      Signed-off-by: default avatarMike Snitzer <snitzer@kernel.org>
      d14646f2
    • Benjamin Marzinski's avatar
      dm-delay: fix workqueue delay_timer race · 8d24790e
      Benjamin Marzinski authored
      delay_timer could be pending when delay_dtr() is called. It needs to be
      shut down before kdelayd_wq is destroyed, so it won't try queueing more
      work to kdelayd_wq while that's getting destroyed.
      
      Also the del_timer_sync() call in delay_presuspend() doesn't protect
      against the timer getting immediately rearmed by the queued call to
      flush_delayed_bios(), but there's no real harm if that does happen.
      timer_delete() is less work, and is basically just as likely to stop a
      pointless call to flush_delayed_bios().
      
      Fixes: 26b9f228 ("dm: delay target")
      Signed-off-by: default avatarBenjamin Marzinski <bmarzins@redhat.com>
      Signed-off-by: default avatarMike Snitzer <snitzer@kernel.org>
      8d24790e
  3. 23 Apr, 2024 3 commits
  4. 16 Apr, 2024 3 commits
    • yangerkun's avatar
      dm-crypt: export sysfs of all workqueues · 2285e149
      yangerkun authored
      Once there is a heavy IO load, so many encrypt/decrypt work will occupy
      all of the cpu, which may lead to the poor performance for other service.
      So the improved visibility and controls over dm-crypt workqueues, as
      was offered with commit a2b8b2d9 ("dm crypt: export sysfs of
      kcryptd workqueue"), seems necessary. By exporting dm-crypt's
      workqueues in sysfs, the entry like cpumask/max_active and so on can
      help us to limit the CPU usage for encrypt/decrypt work.
      
      However, commit a2b8b2d9 did not consider that DM table reload
      will call .ctr before .dtr, so the reload for dm-crypt failed because
      the same sysfs name was present. This was the original need for commit
      48b0777c ("Revert "dm crypt: export sysfs of kcryptd workqueue"").
      
      Reintroduce the use of WQ_SYSFS, and use it for both the IO and crypt
      workqueues, but make the workqueue names include a unique id (via ida)
      to allow both old and new sysfs entries to coexist.
      Signed-off-by: default avataryangerkun <yangerkun@huawei.com>
      Acked-by: default avatarTejun Heo <tj@kernel.org>
      Signed-off-by: default avatarMike Snitzer <snitzer@kernel.org>
      2285e149
    • Mikulas Patocka's avatar
      dm-crypt: add the optional "high_priority" flag · 5268de78
      Mikulas Patocka authored
      When WQ_HIGHPRI was used for the dm-crypt kcryptd workqueue it was
      reported that dm-crypt performs badly when the system is loaded[1].
      Because of reports of audio skipping, dm-crypt stopped using
      WQ_HIGHPRI with commit f612b213 (Revert "dm crypt: use WQ_HIGHPRI
      for the IO and crypt workqueues").
      
      But it has since been determined that WQ_HIGHPRI provides improved
      performance (with reduced latency) for highend systems with much more
      resources than those laptop/desktop users which suffered from the use
      of WQ_HIGHPRI.
      
      As such, add an option "high_priority" that allows the use of
      WQ_HIGHPRI for dm-crypt's workqueues and also sets the write_thread to
      nice level MIN_NICE (-20). This commit makes it optional, so that
      normal users won't be harmed by it.
      
      [1] https://listman.redhat.com/archives/dm-devel/2023-February/053410.htmlSigned-off-by: default avatarMikulas Patocka <mpatocka@redhat.com>
      Signed-off-by: default avatarMike Snitzer <snitzer@kernel.org>
      5268de78
    • Ming Lei's avatar
      dm: restore synchronous close of device mapper block device · 48ef0ba1
      Ming Lei authored
      'dmsetup remove' and 'dmsetup remove_all' require synchronous bdev
      release. Otherwise dm_lock_for_deletion() may return -EBUSY if the open
      count is > 0, because the open count is dropped in dm_blk_close()
      which occurs after fput() completes.
      
      So if dm_blk_close() is delayed because of asynchronous fput(), this
      device mapper device is skipped during remove, which is a regression.
      
      Fix the issue by using __fput_sync().
      
      Also, DM device removal has long supported being made asynchronous by
      setting the DMF_DEFERRED_REMOVE flag on the DM device. So leverage
      using async fput() in close_table_device() if DMF_DEFERRED_REMOVE flag
      is set.
      Reported-by: default avatarZhong Changhui <czhong@redhat.com>
      Fixes: a28d893e ("md: port block device access to file")
      Suggested-by: default avatarChristian Brauner <brauner@kernel.org>
      Signed-off-by: default avatarMing Lei <ming.lei@redhat.com>
      [snitzer: editted commit header, use fput() if DMF_DEFERRED_REMOVE set]
      Signed-off-by: default avatarMike Snitzer <snitzer@kernel.org>
      48ef0ba1
  5. 10 Apr, 2024 1 commit
  6. 31 Mar, 2024 12 commits
  7. 30 Mar, 2024 8 commits
    • Mikulas Patocka's avatar
      objtool: Fix compile failure when using the x32 compiler · 6205125b
      Mikulas Patocka authored
      When compiling the v6.9-rc1 kernel with the x32 compiler, the following
      errors are reported. The reason is that we take an "unsigned long"
      variable and print it using "PRIx64" format string.
      
      	In file included from check.c:16:
      	check.c: In function ‘add_dead_ends’:
      	/usr/src/git/linux-2.6/tools/objtool/include/objtool/warn.h:46:17: error: format ‘%llx’ expects argument of type ‘long long unsigned int’, but argument 5 has type ‘long unsigned int’ [-Werror=format=]
      	   46 |                 "%s: warning: objtool: " format "\n",   \
      	      |                 ^~~~~~~~~~~~~~~~~~~~~~~~
      	check.c:613:33: note: in expansion of macro ‘WARN’
      	  613 |                                 WARN("can't find unreachable insn at %s+0x%" PRIx64,
      	      |                                 ^~~~
      	...
      Signed-off-by: default avatarMikulas Patocka <mpatocka@redhat.com>
      Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
      Cc: Josh Poimboeuf <jpoimboe@redhat.com>
      Cc: linux-kernel@vger.kernel.org
      6205125b
    • Linus Torvalds's avatar
      Merge tag 'xfs-6.9-fixes-1' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux · 712e1425
      Linus Torvalds authored
      Pull xfs fixes from Chandan Babu:
      
       - Allow stripe unit/width value passed via mount option to be written
         over existing values in the super block
      
       - Do not set current->journal_info to avoid its value from being miused
         by another filesystem context
      
      * tag 'xfs-6.9-fixes-1' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux:
        xfs: don't use current->journal_info
        xfs: allow sunit mount option to repair bad primary sb stripe values
      712e1425
    • Linus Torvalds's avatar
      Merge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi · fe764a75
      Linus Torvalds authored
      Pull SCSI fixes and updates from James Bottomley:
       "Fully half this pull is updates to lpfc and qla2xxx which got
        committed just as the merge window opened. A sizeable fraction of the
        driver updates are simple bug fixes (and lock reworks for bug fixes in
        the case of lpfc), so rather than splitting the few actual
        enhancements out, we're just adding the drivers to the -rc1 pull.
      
        The enhancements for lpfc are log message removals, copyright updates
        and three patches redefining types. For qla2xxx it's just removing a
        debug message on module removal and the manufacturer detail update.
      
        The two major fixes are the sg teardown race and a core error leg
        problem with the procfs directory not being removed if we destroy a
        created host that never got to the running state. The rest are minor
        fixes and constifications"
      
      * tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: (41 commits)
        scsi: bnx2fc: Remove spin_lock_bh while releasing resources after upload
        scsi: core: Fix unremoved procfs host directory regression
        scsi: mpi3mr: Avoid memcpy field-spanning write WARNING
        scsi: sd: Fix TCG OPAL unlock on system resume
        scsi: sg: Avoid sg device teardown race
        scsi: lpfc: Copyright updates for 14.4.0.1 patches
        scsi: lpfc: Update lpfc version to 14.4.0.1
        scsi: lpfc: Define types in a union for generic void *context3 ptr
        scsi: lpfc: Define lpfc_dmabuf type for ctx_buf ptr
        scsi: lpfc: Define lpfc_nodelist type for ctx_ndlp ptr
        scsi: lpfc: Use a dedicated lock for ras_fwlog state
        scsi: lpfc: Release hbalock before calling lpfc_worker_wake_up()
        scsi: lpfc: Replace hbalock with ndlp lock in lpfc_nvme_unregister_port()
        scsi: lpfc: Update lpfc_ramp_down_queue_handler() logic
        scsi: lpfc: Remove IRQF_ONESHOT flag from threaded IRQ handling
        scsi: lpfc: Move NPIV's transport unregistration to after resource clean up
        scsi: lpfc: Remove unnecessary log message in queuecommand path
        scsi: qla2xxx: Update version to 10.02.09.200-k
        scsi: qla2xxx: Delay I/O Abort on PCI error
        scsi: qla2xxx: Change debug message during driver unload
        ...
      fe764a75
    • Linus Torvalds's avatar
      Merge tag 'i2c-for-6.9-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux · ac672718
      Linus Torvalds authored
      Pull i2c fix from Wolfram Sang:
       "A fix from Andi for I2C host drivers"
      
      * tag 'i2c-for-6.9-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux:
        i2c: i801: Fix a refactoring that broke a touchpad on Lenovo P1
      ac672718
    • Linus Torvalds's avatar
      Merge tag 'usb-6.9-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb · ff789a26
      Linus Torvalds authored
      Pull USB fixes from Greg KH:
       "Here are a bunch of small USB fixes for reported problems and
        regressions for 6.9-rc2. Included in here are:
      
         - deadlock fixes for long-suffering issues
      
         - USB phy driver revert for reported problem
      
         - typec fixes for reported problems
      
         - duplicate id in dwc3 dropped
      
         - dwc2 driver fixes
      
         - udc driver warning fix
      
         - cdc-wdm race bugfix
      
         - other tiny USB bugfixes
      
        All of these have been in linux-next this past week with no reported
        issues"
      
      * tag 'usb-6.9-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: (26 commits)
        USB: core: Fix deadlock in port "disable" sysfs attribute
        USB: core: Add hub_get() and hub_put() routines
        usb: typec: ucsi: Check capabilities before cable and identity discovery
        usb: typec: ucsi: Clear UCSI_CCI_RESET_COMPLETE before reset
        usb: typec: ucsi_acpi: Refactor and fix DELL quirk
        usb: typec: ucsi: Ack unsupported commands
        usb: typec: ucsi: Check for notifications after init
        usb: typec: ucsi: Clear EVENT_PENDING under PPM lock
        usb: typec: Return size of buffer if pd_set operation succeeds
        usb: udc: remove warning when queue disabled ep
        usb: dwc3: pci: Drop duplicate ID
        usb: dwc3: Properly set system wakeup
        Revert "usb: phy: generic: Get the vbus supply"
        usb: cdc-wdm: close race between read and workqueue
        usb: dwc2: gadget: LPM flow fix
        usb: dwc2: gadget: Fix exiting from clock gating
        usb: dwc2: host: Fix ISOC flow in DDMA mode
        usb: dwc2: host: Fix remote wakeup from hibernation
        usb: dwc2: host: Fix hibernation flow
        USB: core: Fix deadlock in usb_deauthorize_interface()
        ...
      ff789a26
    • Linus Torvalds's avatar
      Merge tag 'staging-6.9-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging · 4e6e4229
      Linus Torvalds authored
      Pull staging driver fixes from Greg KH:
       "Here are two small staging driver fixes for the vc04_services driver
        that resolve reported problems:
      
         - strncpy fix for information leak
      
         - another information leak discovered by the previous strncpy fix
      
        Both of these have been in linux-next all this past week with no
        reported issues"
      
      * tag 'staging-6.9-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging:
        staging: vc04_services: fix information leak in create_component()
        staging: vc04_services: changen strncpy() to strscpy_pad()
      4e6e4229
    • Wolfram Sang's avatar
      Merge tag 'i2c-host-fixes-6.9-rc2' of... · 2953eb02
      Wolfram Sang authored
      Merge tag 'i2c-host-fixes-6.9-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/andi.shyti/linux into i2c/for-current
      
      One fix in the i801 driver where a bug caused touchpad
      malfunctions on some Lenovo P1 models by incorrectly overwriting
      a status variable during successful SMBUS transactions.
      2953eb02
    • Masahiro Yamada's avatar
      x86/build: Use obj-y to descend into arch/x86/virt/ · 3f1a9bc5
      Masahiro Yamada authored
      Commit c33621b4 ("x86/virt/tdx: Wire up basic SEAMCALL functions")
      introduced a new instance of core-y instead of the standardized obj-y
      syntax.
      
      X86 Makefiles descend into subdirectories of arch/x86/virt inconsistently;
      into arch/x86/virt/ via core-y defined in arch/x86/Makefile, but into
      arch/x86/virt/svm/ via obj-y defined in arch/x86/Kbuild.
      
      This is problematic when you build a single object in parallel because
      multiple threads attempt to build the same file.
      
        $ make -j$(nproc) arch/x86/virt/vmx/tdx/seamcall.o
          [ snip ]
          AS      arch/x86/virt/vmx/tdx/seamcall.o
          AS      arch/x86/virt/vmx/tdx/seamcall.o
        fixdep: error opening file: arch/x86/virt/vmx/tdx/.seamcall.o.d: No such file or directory
        make[4]: *** [scripts/Makefile.build:362: arch/x86/virt/vmx/tdx/seamcall.o] Error 2
      
      Use the obj-y syntax, as it works correctly.
      Signed-off-by: default avatarMasahiro Yamada <masahiroy@kernel.org>
      Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
      Link: https://lore.kernel.org/r/20240330060554.18524-1-masahiroy@kernel.org
      3f1a9bc5
  8. 29 Mar, 2024 6 commits
    • Linus Torvalds's avatar
      Merge tag 'drm-fixes-2024-03-30' of https://gitlab.freedesktop.org/drm/kernel · 486291a0
      Linus Torvalds authored
      Pull drm fixes from Dave Airlie:
       "Regular fixes for rc2, quite a few i915/amdgpu as usual, some xe, and
        then mostly scattered around. rc3 might be quieter with the holidays
        but we shall see.
      
        bridge:
         - select DRM_KMS_HELPER
      
        dma-buf:
         - fix NULL-pointer deref
      
        dp:
         - fix div-by-zero in DP MST unplug code
      
        fbdev:
         - select FB_IOMEM_FOPS for SBus
      
        sched:
         - fix NULL-pointer deref
      
        xe:
         - Fix build on mips
         - Fix wrong bound checks
         - Fix use of msec rather than jiffies
         - Remove dead code
      
        amdgpu:
         - SMU 14.0.1 updates
         - DCN 3.5.x updates
         - VPE fix
         - eDP panel flickering fix
         - Suspend fix
         - PSR fix
         - DCN 3.0+ fix
         - VCN 4.0.6 updates
         - debugfs fix
      
        amdkfd:
         - DMA-Buf fix
         - GFX 9.4.2 TLB flush fix
         - CP interrupt fix
      
        i915:
         - Fix for BUG_ON/BUILD_BUG_ON IN I915_memcpy.c
         - Update a MTL workaround
         - Fix locking inversion in hwmon's sysfs
         - Remove a bogus error message around PXP
         - Fix UAF on VMA
         - Reset queue_priority_hint on parking
         - Display Fixes:
         - Remove duplicated audio enable/disable on SDVO and DP
         - Disable AuxCCS for Xe driver
         - Revert init order of MIPI DSI
         - DRRS debugfs fix with an extra refactor patch
         - VRR related fixes
         - Fix a JSL eDP corruption
         - Fix the cursor physical dma address
         - BIOS VBT related fix
      
        nouveau:
         - dmem: handle kcalloc() allocation failures
      
        qxl:
         - remove unused variables
      
        rockchip:
         - vop2: remove support for AR30 and AB30 formats
      
        vmwgfx:
         - debugfs: create ttm_resource_manager entry only if needed"
      
      * tag 'drm-fixes-2024-03-30' of https://gitlab.freedesktop.org/drm/kernel: (55 commits)
        drm/i915/bios: Tolerate devdata==NULL in intel_bios_encoder_supports_dp_dual_mode()
        drm/i915: Pre-populate the cursor physical dma address
        drm/i915/gt: Reset queue_priority_hint on parking
        drm/i915/vma: Fix UAF on destroy against retire race
        drm/i915: Do not print 'pxp init failed with 0' when it succeed
        drm/i915: Do not match JSL in ehl_combo_pll_div_frac_wa_needed()
        drm/i915/hwmon: Fix locking inversion in sysfs getter
        drm/i915/dsb: Fix DSB vblank waits when using VRR
        drm/i915/vrr: Generate VRR "safe window" for DSB
        drm/i915/display/debugfs: Fix duplicate checks in i915_drrs_status
        drm/i915/drrs: Refactor CPU transcoder DRRS check
        drm/i915/mtl: Update workaround 14018575942
        drm/i915/dsi: Go back to the previous INIT_OTP/DISPLAY_ON order, mostly
        drm/i915/display: Disable AuxCCS framebuffers if built for Xe
        drm/i915: Stop doing double audio enable/disable on SDVO and g4x+ DP
        drm/i915: Add includes for BUG_ON/BUILD_BUG_ON in i915_memcpy.c
        drm/qxl: remove unused variable from `qxl_process_single_command()`
        drm/qxl: remove unused `count` variable from `qxl_surface_id_alloc()`
        drm/i915: add bug.h include to i915_memcpy.c
        drm/vmwgfx: Create debugfs ttm_resource_manager entry only if needed
        ...
      486291a0
    • Linus Torvalds's avatar
      Merge tag 'linux_kselftest-fixes-6.9-rc2' of... · 1ab5c8a3
      Linus Torvalds authored
      Merge tag 'linux_kselftest-fixes-6.9-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest
      
      Pull kselftest fixes from Shuah Khan:
       "Fixes to seccomp and ftrace tests and a change to add config file for
        dmabuf-heap test to increase coverage"
      
      * tag 'linux_kselftest-fixes-6.9-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest:
        selftests: dmabuf-heap: add config file for the test
        selftests/seccomp: Try to fit runtime of benchmark into timeout
        selftests/ftrace: Fix event filter target_func selection
      1ab5c8a3
    • Linus Torvalds's avatar
      Merge tag 'linux_kselftest-kunit-fixes-6.9-rc2' of... · a2ad5d9e
      Linus Torvalds authored
      Merge tag 'linux_kselftest-kunit-fixes-6.9-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest
      
      Pull KUnit fixes from Shuah Khan:
       "One urgent fix for --alltests build failure related to renaming of
        CONFIG_DAMON_DBGFS to DAMON_DBGFS_DEPRECATED to the missing config
        option"
      
      * tag 'linux_kselftest-kunit-fixes-6.9-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest:
        kunit: configs: Enable CONFIG_DAMON_DBGFS_DEPRECATED for --alltests
      a2ad5d9e
    • Muhammad Usama Anjum's avatar
      selftests: dmabuf-heap: add config file for the test · 224fe424
      Muhammad Usama Anjum authored
      The config fragment enlists all the config options needed for the test.
      This config is merged into the kernel's config on which this test is
      run.
      
      Fixed whitespace errors during commit:
      Shuah Khan <skhan@linuxfoundation.org>
      Reviewed-by: default avatarT.J. Mercier <tjmercier@google.com>
      Signed-off-by: default avatarMuhammad Usama Anjum <usama.anjum@collabora.com>
      Signed-off-by: default avatarShuah Khan <skhan@linuxfoundation.org>
      224fe424
    • Mark Brown's avatar
      selftests/seccomp: Try to fit runtime of benchmark into timeout · 7155cc45
      Mark Brown authored
      The seccomp benchmark runs five scenarios, one calibration run with no
      seccomp filters enabled then four further runs each adding a filter. The
      calibration run times itself for 15s and then each additional run executes
      for the same number of times.
      
      Currently the seccomp tests, including the benchmark, run with an extended
      120s timeout but this is not sufficient to robustly run the tests on a lot
      of platforms. Sample timings from some recent runs:
      
         Platform          Run 1  Run 2  Run 3  Run 4
         ---------         -----  -----  -----  -----
         PowerEdge R200    16.6s  16.6s  31.6s  37.4s
         BBB (arm)         20.4s  20.4s  54.5s
         Synquacer (arm64) 20.7s  23.7s  40.3s
      
      The x86 runs from the PowerEdge are quite marginal and routinely fail, for
      the successful run reported here the timed portions of the run are at
      117.2s leaving less than 3s of margin which is frequently breached. The
      added overhead of adding filters on the other platforms is such that there
      is no prospect of their runs fitting into the 120s timeout, especially
      on 32 bit arm where there is no BPF JIT.
      
      While we could lower the time we calibrate for I'm also already seeing the
      currently completing runs reporting issues with the per filter overheads
      not matching expectations:
      
      Let's instead raise the timeout to 180s which is only a 50% increase on the
      current timeout which is itself not *too* large given that there's only two
      tests in this suite.
      Signed-off-by: default avatarMark Brown <broonie@kernel.org>
      Signed-off-by: default avatarShuah Khan <skhan@linuxfoundation.org>
      7155cc45
    • Mark Rutland's avatar
      selftests/ftrace: Fix event filter target_func selection · 8ecab2e6
      Mark Rutland authored
      The event filter function test has been failing in our internal test
      farm:
      
      | # not ok 33 event filter function - test event filtering on functions
      
      Running the test in verbose mode indicates that this is because the test
      erroneously determines that kmem_cache_free() is the most common caller
      of kmem_cache_free():
      
        # # + cut -d: -f3 trace
        # # + sed s/call_site=([^+]*)+0x.*/1/
        # # + sort
        # # + uniq -c
        # # + sort
        # # + tail -n 1
        # # + sed s/^[ 0-9]*//
        # # + target_func=kmem_cache_free
      
      ... and as kmem_cache_free() doesn't call itself, setting this as the
      filter function for kmem_cache_free() results in no hits, and
      consequently the test fails:
      
        # # + grep kmem_cache_free trace
        # # + grep kmem_cache_free
        # # + wc -l
        # # + hitcnt=0
        # # + grep kmem_cache_free trace
        # # + grep -v kmem_cache_free
        # # + wc -l
        # # + misscnt=0
        # # + [ 0 -eq 0 ]
        # # + exit_fail
      
      This seems to be because the system in question has tasks with ':' in
      their name (which a number of kernel worker threads have). These show up
      in the trace, e.g.
      
        test:.sh-1299    [004] .....  2886.040608: kmem_cache_free: call_site=putname+0xa4/0xc8 ptr=000000000f4d22f4 name=names_cache
      
      ... and so when we try to extact the call_site with:
      
        cut -d: -f3 trace | sed 's/call_site=\([^+]*\)+0x.*/\1/'
      
      ... the 'cut' command will extrace the column containing
      'kmem_cache_free' rather than the column containing 'call_site=...', and
      the 'sed' command will leave this unchanged. Consequently, the test will
      decide to use 'kmem_cache_free' as the filter function, resulting in the
      failure seen above.
      
      Fix this by matching the 'call_site=<func>' part specifically to extract
      the function name.
      Signed-off-by: default avatarMark Rutland <mark.rutland@arm.com>
      Reported-by: default avatarAishwarya TCV <aishwarya.tcv@arm.com>
      Cc: Masami Hiramatsu <mhiramat@kernel.org>
      Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
      Cc: Shuah Khan <shuah@kernel.org>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: linux-kernel@vger.kernel.org
      Cc: linux-kselftest@vger.kernel.org
      Cc: linux-trace-kernel@vger.kernel.org
      Acked-by: default avatarMasami Hiramatsu (Google) <mhiramat@kernel.org>
      Signed-off-by: default avatarShuah Khan <skhan@linuxfoundation.org>
      8ecab2e6