1. 24 Jun, 2024 5 commits
    • Jens Axboe's avatar
      io_uring/msg_ring: add an alloc cache for io_kiocb entries · 50cf5f38
      Jens Axboe authored
      With slab accounting, allocating and freeing memory has considerable
      overhead. Add a basic alloc cache for the io_kiocb allocations that
      msg_ring needs to do. Unlike other caches, this one is used by the
      sender, grabbing it from the remote ring. When the remote ring gets
      the posted completion, it'll free it locally. Hence it is separately
      locked, using ctx->msg_lock.
      Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
      50cf5f38
    • Jens Axboe's avatar
      io_uring/msg_ring: improve handling of target CQE posting · 0617bb50
      Jens Axboe authored
      Use the exported helper for queueing task_work for message passing,
      rather than rolling our own.
      
      Note that this is only done for strict data messages for now, file
      descriptor passing messages still rely on the kernel task_work. It could
      get converted at some point if it's performance critical.
      
      This improves peak performance of message passing by about 5x in some
      basic testing, with 2 threads just sending messages to each other.
      Before this change, it was capped at around 700K/sec, with the change
      it's at over 4M/sec.
      Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
      0617bb50
    • Jens Axboe's avatar
      io_uring: add io_add_aux_cqe() helper · f33096a3
      Jens Axboe authored
      This helper will post a CQE, and can be called from task_work where we
      now that the ctx is already properly locked and that deferred
      completions will get flushed later on.
      Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
      f33096a3
    • Jens Axboe's avatar
      io_uring: add remote task_work execution helper · c3ac76f9
      Jens Axboe authored
      All our task_work handling is targeted at the state in the io_kiocb
      itself, which is what it is being used for. However, MSG_RING rolls its
      own task_work handling, ignoring how that is usually done.
      
      In preparation for switching MSG_RING to be able to use the normal
      task_work handling, add io_req_task_work_add_remote() which allows the
      caller to pass in the target io_ring_ctx.
      Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
      c3ac76f9
    • Jens Axboe's avatar
      io_uring/msg_ring: tighten requirement for remote posting · d57afd8b
      Jens Axboe authored
      Currently this is gated on whether or not the target ring needs a local
      completion - and if so, whether or not we're running on the right task.
      The use case for same thread cross posting is probably a lot less
      relevant than remote posting. And since we're going to improve this
      situation anyway, just gate it on local posting and ignore what task
      we're currently running on.
      Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
      d57afd8b
  2. 19 Jun, 2024 6 commits
  3. 16 Jun, 2024 22 commits
    • Jens Axboe's avatar
      io_uring/advise: support 64-bit lengths · 3b87184f
      Jens Axboe authored
      The existing fadvise/madvise support only supports 32-bit lengths. Add
      support for 64-bit lengths, enabled by the application setting sqe->off
      rather than sqe->len for the length. If sqe->len is set, then that is
      used as the 32-bit length. If sqe->len is zero, then sqe->off is read
      for full 64-bit support.
      
      Older kernels will return -EINVAL if 64-bit support isn't available.
      
      Fixes: 4840e418 ("io_uring: add IORING_OP_FADVISE")
      Fixes: c1ca757b ("io_uring: add IORING_OP_MADVISE")
      Reported-by: default avatarStefan <source@s.muenzel.net>
      Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
      3b87184f
    • Jens Axboe's avatar
      io_uring/rsrc: remove redundant __set_current_state() post schedule() · 11d19466
      Jens Axboe authored
      We're guaranteed to be in a TASK_RUNNING state post schedule, so we
      never need to set the state after that. While in there, remove the
      other __set_current_state() as well, and just call finish_wait()
      when we now we're going to break anyway. This is easier to grok than
      manual __set_current_state() calls.
      Reported-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
      11d19466
    • Jens Axboe's avatar
      io_uring/io-wq: make io_wq_work flags atomic · 3474d1b9
      Jens Axboe authored
      The work flags can be set/accessed from different tasks, both the
      originator of the request, and the io-wq workers. While modifications
      aren't concurrent, it still makes KMSAN unhappy. There's no real
      downside to just making the flag reading/manipulation use proper
      atomics here.
      Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
      3474d1b9
    • Jens Axboe's avatar
      io_uring: use 'state' consistently · f2a93294
      Jens Axboe authored
      __io_submit_flush_completions() assigns ctx->submit_state to a local
      variable and uses it in all but one spot, switch that forgotten
      statement to using 'state' as well.
      Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
      f2a93294
    • Jens Axboe's avatar
      io_uring/eventfd: move eventfd handling to separate file · 200f3abd
      Jens Axboe authored
      This is pretty nicely abstracted already, but let's move it to a separate
      file rather than have it in the main io_uring file. With that, we can
      also move the io_ev_fd struct and enum out of global scope.
      Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
      200f3abd
    • Jens Axboe's avatar
      io_uring/eventfd: move to more idiomatic RCU free usage · 60b6c075
      Jens Axboe authored
      In some ways, it just "happens to work" currently with using the ops
      field for both the free and signaling bit. But it depends on ordering
      of operations in terms of freeing and signaling. Clean it up and use the
      usual refs == 0 under RCU read side lock to determine if the ev_fd is
      still valid, and use the reference to gate the freeing as well.
      
      Fixes: 21a091b9 ("io_uring: signal registered eventfd to process deferred task work")
      Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
      60b6c075
    • Gabriel Krisman Bertazi's avatar
      io_uring/rsrc: Drop io_copy_iov in favor of iovec API · f4eaf8ed
      Gabriel Krisman Bertazi authored
      Instead of open coding an io_uring function to copy iovs from userspace,
      rely on the existing iovec_from_user function.  While there, avoid
      repeatedly zeroing the iov in the !arg case for io_sqe_buffer_register.
      
      tested with liburing testsuite.
      Signed-off-by: default avatarGabriel Krisman Bertazi <krisman@suse.de>
      Link: https://lore.kernel.org/r/20240523214535.31890-1-krisman@suse.deSigned-off-by: default avatarJens Axboe <axboe@kernel.dk>
      f4eaf8ed
    • Gabriel Krisman Bertazi's avatar
      io_uring: Drop per-ctx dummy_ubuf · 81cc927d
      Gabriel Krisman Bertazi authored
      Commit 19a63c40 ("io_uring/rsrc: keep one global dummy_ubuf")
      replaced it with a global static object but this stayed behind.
      
      Fixes: 19a63c40 ("io_uring/rsrc: keep one global dummy_ubuf")
      Signed-off-by: default avatarGabriel Krisman Bertazi <krisman@suse.de>
      Link: https://lore.kernel.org/r/20240523214517.31803-1-krisman@suse.deSigned-off-by: default avatarJens Axboe <axboe@kernel.dk>
      81cc927d
    • Linus Torvalds's avatar
      Linux 6.10-rc4 · 6ba59ff4
      Linus Torvalds authored
      6ba59ff4
    • Linus Torvalds's avatar
      Merge tag 'parisc-for-6.10-rc4' of... · 6456c425
      Linus Torvalds authored
      Merge tag 'parisc-for-6.10-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux
      
      Pull parisc fix from Helge Deller:
       "On parisc we have suffered since years from random segfaults which
        seem to have been triggered due to cache inconsistencies. Those
        segfaults happened more often on machines with PA8800 and PA8900 CPUs,
        which have much bigger caches than the earlier machines.
      
        Dave Anglin has worked over the last few weeks to fix this bug. His
        patch has been successfully tested by various people on various
        machines and with various kernels (6.6, 6.8 and 6.9), and the debian
        buildd servers haven't shown a single random segfault with this patch.
      
        Since the cache handling has been reworked, the patch is slightly
        bigger than I would like in this stage, but the greatly improved
        stability IMHO justifies the inclusion now"
      
      * tag 'parisc-for-6.10-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux:
        parisc: Try to fix random segmentation faults in package builds
      6456c425
    • Linus Torvalds's avatar
      Merge tag 'i2c-for-6.10-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux · 4301487e
      Linus Torvalds authored
      Pull i2c fixes from Wolfram Sang:
       "Two fixes to correctly report i2c functionality, ensuring that
        I2C_FUNC_SLAVE is reported when a device operates solely as a slave
        interface"
      
      * tag 'i2c-for-6.10-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux:
        i2c: designware: Fix the functionality flags of the slave-only interface
        i2c: at91: Fix the functionality flags of the slave-only interface
      4301487e
    • Linus Torvalds's avatar
      Merge tag 'usb-6.10-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb · b5beaa44
      Linus Torvalds authored
      Pull USB / Thunderbolt fixes from Greg KH:
       "Here are some small USB and Thunderbolt driver fixes for 6.10-rc4.
        Included in here are:
      
         - thunderbolt debugfs bugfix
      
         - USB typec bugfixes
      
         - kcov usb bugfix
      
         - xhci bugfixes
      
         - usb-storage bugfix
      
         - dt-bindings bugfix
      
         - cdc-wdm log message spam bugfix
      
        All of these, except for the last cdc-wdm log level change, have been
        in linux-next for a while with no reported problems. The cdc-wdm
        bugfix has been tested by syzbot and proved to fix the reported cpu
        lockup issues when the log is constantly spammed by a broken device"
      
      * tag 'usb-6.10-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb:
        USB: class: cdc-wdm: Fix CPU lockup caused by excessive log messages
        xhci: Handle TD clearing for multiple streams case
        xhci: Apply broken streams quirk to Etron EJ188 xHCI host
        xhci: Apply reset resume quirk to Etron EJ188 xHCI host
        xhci: Set correct transferred length for cancelled bulk transfers
        usb-storage: alauda: Check whether the media is initialized
        usb: typec: ucsi: Ack also failed Get Error commands
        kcov, usb: disable interrupts in kcov_remote_start_usb_softirq
        dt-bindings: usb: realtek,rts5411: Add missing "additionalProperties" on child nodes
        usb: typec: tcpm: Ignore received Hard Reset in TOGGLING state
        usb: typec: tcpm: fix use-after-free case in tcpm_register_source_caps
        USB: xen-hcd: Traverse host/ when CONFIG_USB_XEN_HCD is selected
        usb: typec: ucsi: glink: increase max ports for x1e80100
        Revert "usb: chipidea: move ci_ulpi_init after the phy initialization"
        thunderbolt: debugfs: Fix margin debugfs node creation condition
      b5beaa44
    • Linus Torvalds's avatar
      Merge tag 'tty-6.10-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty · 6efc63a8
      Linus Torvalds authored
      Pull tty/serial driver fixes from Greg KH:
       "Here are some small tty and serial driver fixes that resolve som
        reported problems. Included in here are:
      
         - n_tty lookahead buffer bugfix
      
         - WARN_ON() removal where it was not needed
      
         - 8250_dw driver bugfixes
      
         - 8250_pxa bugfix
      
         - sc16is7xx Kconfig fixes for reported build issues
      
        All of these have been in linux-next for over a week with no reported
        problems"
      
      * tag 'tty-6.10-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty:
        serial: drop debugging WARN_ON_ONCE() from uart_write()
        serial: sc16is7xx: re-add Kconfig SPI or I2C dependency
        serial: sc16is7xx: rename Kconfig CONFIG_SERIAL_SC16IS7XX_CORE
        serial: port: Don't block system suspend even if bytes are left to xmit
        serial: 8250_pxa: Configure tx_loadsz to match FIFO IRQ level
        serial: 8250_dw: Revert "Move definitions to the shared header"
        serial: 8250_dw: Don't use struct dw8250_data outside of 8250_dw
        tty: n_tty: Fix buffer offsets when lookahead is used
      6efc63a8
    • Linus Torvalds's avatar
      Merge tag 'staging-6.10-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging · d3e6dc4f
      Linus Torvalds authored
      Pull staging driver fix from Greg KH:
       "Here is a single staging driver fix, for the vc04 driver. It resolves
        a reported problem that showed up in the merge window set of changes.
      
        It's been in linux-next for over a week with no reported problems"
      
      * tag 'staging-6.10-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging:
        staging: vchiq_debugfs: Fix NPD in vchiq_dump_state
      d3e6dc4f
    • Linus Torvalds's avatar
      Merge tag 'driver-core-6.10-rc4' of... · e12fa4dd
      Linus Torvalds authored
      Merge tag 'driver-core-6.10-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core
      
      Pull driver core and sysfs fixes from Greg KH:
       "Here are three small changes for 6.10-rc4 that resolve reported
        problems, and finally drop an unused api call. These are:
      
         - removal of devm_device_add_groups(), all the callers of this are
           finally gone after the 6.10-rc1 merge (changes came in through
           different trees), so it's safe to remove.
      
         - much reported sysfs build error fixed up for systems that did not
           have sysfs enabled
      
         - driver core sync issue fix for a many reported issue over the years
           that no one really paid much attention to, until Dirk finally
           tracked down the real issue and made the "obviously correct and
           simple" fix for it.
      
        All of these have been in linux-next for over a week with no reported
        problems"
      
      * tag 'driver-core-6.10-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core:
        drivers: core: synchronize really_probe() and dev_uevent()
        sysfs: Unbreak the build around sysfs_bin_attr_simple_read()
        driver core: remove devm_device_add_groups()
      e12fa4dd
    • Linus Torvalds's avatar
      Merge tag 'char-misc-6.10-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc · 33f855cb
      Linus Torvalds authored
      Pull char/misc driver fixes from Greg KH:
       "Here are a number of small char/misc and iio driver fixes for
        6.10-rc4. Included in here are the following:
      
         - iio driver fixes for a bunch of reported problems.
      
         - mei driver fixes for a number of reported issues.
      
         - amiga parport driver build fix.
      
         - .editorconfig fix that was causing lots of unintended whitespace
           changes to happen to files when they were being edited. Unless we
           want to sweep the whole tree and remove all trailing whitespace at
           once, this is needed for the .editorconfig file to be able to be
           used at all. This change is required because the original
           submitters never touched older files in the tree.
      
         - jfs bugfix for a buffer overflow
      
        The jfs bugfix is in here as I didn't know where else to put it, and
        it's been ignored for a while as the filesystem seems to be abandoned
        and I'm tired of seeing the same issue reported in multiple places.
      
        All of these have been in linux-next with no reported issues"
      
      * tag 'char-misc-6.10-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc: (25 commits)
        .editorconfig: remove trim_trailing_whitespace option
        jfs: xattr: fix buffer overflow for invalid xattr
        misc: microchip: pci1xxxx: Fix a memory leak in the error handling of gp_aux_bus_probe()
        misc: microchip: pci1xxxx: fix double free in the error handling of gp_aux_bus_probe()
        parport: amiga: Mark driver struct with __refdata to prevent section mismatch
        mei: vsc: Fix wrong invocation of ACPI SID method
        mei: vsc: Don't stop/restart mei device during system suspend/resume
        mei: me: release irq in mei_me_pci_resume error path
        mei: demote client disconnect warning on suspend to debug
        iio: inkern: fix channel read regression
        iio: imu: inv_mpu6050: stabilized timestamping in interrupt
        iio: adc: ad7173: Fix sampling frequency setting
        iio: adc: ad7173: Clear append status bit
        iio: imu: inv_icm42600: delete unneeded update watermark call
        iio: imu: inv_icm42600: stabilized timestamp in interrupt
        iio: invensense: fix odr switching to same value
        iio: adc: ad7173: Remove index from temp channel
        iio: adc: ad7173: Add ad7173_device_info names
        iio: adc: ad7173: fix buffers enablement for ad7176-2
        iio: temperature: mlx90635: Fix ERR_PTR dereference in mlx90635_probe()
        ...
      33f855cb
    • Linus Torvalds's avatar
      Merge tag 'ata-6.10-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/libata/linux · e8b0264d
      Linus Torvalds authored
      Pull ata fix from Niklas Cassel:
       "Fix a bug where the SCSI Removable Media Bit (RMB) was incorrectly set
        for hot-plug capable (and eSATA) ports.
      
        The RMB bit means that the media is removable (e.g. floppy or CD-ROM),
        not that the device server is removable. If the RMB bit is set, SCSI
        will set the removable media sysfs attribute.
      
        If the removable media sysfs attribute is set on a device,
        GNOME/udisks will automatically mount the device on boot.
      
        We only want to set the SCSI RMB bit (and thus the removable media
        sysfs attribute) for devices where the ATA removable media device bit
        is set"
      
      * tag 'ata-6.10-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/libata/linux:
        ata: libata-scsi: Set the RMB bit only for removable media devices
      e8b0264d
    • Linus Torvalds's avatar
      Merge tag 'edac_urgent_for_v6.10_rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/ras/ras · e39388e4
      Linus Torvalds authored
      Pull EDAC fixes from Borislav Petkov:
      
       - Fix two issues with MI300 address translation logic
      
      * tag 'edac_urgent_for_v6.10_rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/ras/ras:
        RAS/AMD/ATL: Use system settings for MI300 DRAM to normalized address translation
        RAS/AMD/ATL: Fix MI300 bank hash
      e39388e4
    • Linus Torvalds's avatar
      Merge tag 'firewire-fixes-6.10-rc4' of... · be2fa886
      Linus Torvalds authored
      Merge tag 'firewire-fixes-6.10-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394
      
      Pull firewire fixes from Takashi Sakamoto:
      
       - Update tracepoints events introduced in v6.10-rc1 so that it includes
         the numeric identifier of host card in which the event happens
      
       - replace wiki URL with the current website URL in Kconfig
      
      * tag 'firewire-fixes-6.10-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394:
        firewire: core: record card index in bus_reset_handle tracepoints event
        firewire: core: record card index in tracepoinrts events derived from bus_reset_arrange_template
        firewire: core: record card index in async_phy_inbound tracepoints event
        firewire: core: record card index in async_phy_outbound_complete tracepoints event
        firewire: core: record card index in async_phy_outbound_initiate tracepoints event
        firewire: core: record card index in tracepoinrts events derived from async_inbound_template
        firewire: core: record card index in tracepoinrts events derived from async_outbound_initiate_template
        firewire: core: record card index in tracepoinrts events derived from async_outbound_complete_template
        firewire: fix website URL in Kconfig
      be2fa886
    • Hans de Goede's avatar
      leds: class: Revert: "If no default trigger is given, make hw_control trigger the default trigger" · fcf2a997
      Hans de Goede authored
      Commit 66601a29 ("leds: class: If no default trigger is given, make
      hw_control trigger the default trigger") causes ledtrig-netdev to get
      set as default trigger on various network LEDs.
      
      This causes users to hit a pre-existing AB-BA deadlock issue in
      ledtrig-netdev between the LED-trigger locks and the rtnl mutex,
      resulting in hung tasks in kernels >= 6.9.
      
      Solving the deadlock is non trivial, so for now revert the change to
      set the hw_control trigger as default trigger, so that ledtrig-netdev
      no longer gets activated automatically for various network LEDs.
      
      The netdev trigger is not needed because the network LEDs are usually under
      hw-control and the netdev trigger tries to leave things that way so setting
      it as the active trigger for the LED class device is a no-op.
      
      Fixes: 66601a29 ("leds: class: If no default trigger is given, make hw_control trigger the default trigger")
      Reported-by: default avatarGenes Lists <lists@sapience.com>
      Closes: https://lore.kernel.org/all/9d189ec329cfe68ed68699f314e191a10d4b5eda.camel@sapience.com/Reported-by: default avatarJohannes Wüller <johanneswueller@gmail.com>
      Closes: https://lore.kernel.org/lkml/e441605c-eaf2-4c2d-872b-d8e541f4cf60@gmail.com/
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
      Reviewed-by: default avatarAndrew Lunn <andrew@lunn.ch>
      Acked-by: default avatarLee Jones <lee@kernel.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      fcf2a997
    • Wolfram Sang's avatar
      Merge tag 'i2c-host-fixes-6.10-rc4' of... · 7e9bb0cb
      Wolfram Sang authored
      Merge tag 'i2c-host-fixes-6.10-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/andi.shyti/linux into i2c/for-current
      
      Two fixes from Jean aim to correctly report i2c functionality,
      specifically ensuring that I2C_FUNC_SLAVE is reported when a
      device operates solely as a slave interface.
      7e9bb0cb
    • Yazen Ghannam's avatar
      RAS/AMD/ATL: Use system settings for MI300 DRAM to normalized address translation · ba437905
      Yazen Ghannam authored
      The currently used normalized address format is not applicable to all
      MI300 systems. This leads to incorrect results during address
      translation.
      
      Drop the fixed layout and construct the normalized address from system
      settings.
      
      Fixes: 87a61237 ("RAS/AMD/ATL: Add MI300 DRAM to normalized address translation support")
      Signed-off-by: default avatarYazen Ghannam <yazen.ghannam@amd.com>
      Signed-off-by: default avatarBorislav Petkov (AMD) <bp@alien8.de>
      Cc: <stable@kernel.org>
      Link: https://lore.kernel.org/r/20240607-mi300-dram-xl-fix-v1-2-2f11547a178c@amd.com
      ba437905
  4. 15 Jun, 2024 7 commits