1. 30 Aug, 2024 1 commit
  2. 29 Aug, 2024 5 commits
    • Jens Axboe's avatar
      io_uring/kbuf: add support for incremental buffer consumption · ae98dbf4
      Jens Axboe authored
      By default, any recv/read operation that uses provided buffers will
      consume at least 1 buffer fully (and maybe more, in case of bundles).
      This adds support for incremental consumption, meaning that an
      application may add large buffers, and each read/recv will just consume
      the part of the buffer that it needs.
      
      For example, let's say an application registers 1MB buffers in a
      provided buffer ring, for streaming receives. If it gets a short recv,
      then the full 1MB buffer will be consumed and passed back to the
      application. With incremental consumption, only the part that was
      actually used is consumed, and the buffer remains the current one.
      
      This means that both the application and the kernel needs to keep track
      of what the current receive point is. Each recv will still pass back a
      buffer ID and the size consumed, the only difference is that before the
      next receive would always be the next buffer in the ring. Now the same
      buffer ID may return multiple receives, each at an offset into that
      buffer from where the previous receive left off. Example:
      
      Application registers a provided buffer ring, and adds two 32K buffers
      to the ring.
      
      Buffer1 address: 0x1000000 (buffer ID 0)
      Buffer2 address: 0x2000000 (buffer ID 1)
      
      A recv completion is received with the following values:
      
      cqe->res	0x1000	(4k bytes received)
      cqe->flags	0x11	(CQE_F_BUFFER|CQE_F_BUF_MORE set, buffer ID 0)
      
      and the application now knows that 4096b of data is available at
      0x1000000, the start of that buffer, and that more data from this buffer
      will be coming. Now the next receive comes in:
      
      cqe->res	0x2010	(8k bytes received)
      cqe->flags	0x11	(CQE_F_BUFFER|CQE_F_BUF_MORE set, buffer ID 0)
      
      which tells the application that 8k is available where the last
      completion left off, at 0x1001000. Next completion is:
      
      cqe->res	0x5000	(20k bytes received)
      cqe->flags	0x1	(CQE_F_BUFFER set, buffer ID 0)
      
      and the application now knows that 20k of data is available at
      0x1003000, which is where the previous receive ended. CQE_F_BUF_MORE
      isn't set, as no more data is available in this buffer ID. The next
      completion is then:
      
      cqe->res	0x1000	(4k bytes received)
      cqe->flags	0x10001	(CQE_F_BUFFER|CQE_F_BUF_MORE set, buffer ID 1)
      
      which tells the application that buffer ID 1 is now the current one,
      hence there's 4k of valid data at 0x2000000. 0x2001000 will be the next
      receive point for this buffer ID.
      
      When a buffer will be reused by future CQE completions,
      IORING_CQE_BUF_MORE will be set in cqe->flags. This tells the application
      that the kernel isn't done with the buffer yet, and that it should expect
      more completions for this buffer ID. Will only be set by provided buffer
      rings setup with IOU_PBUF_RING INC, as that's the only type of buffer
      that will see multiple consecutive completions for the same buffer ID.
      For any other provided buffer type, any completion that passes back
      a buffer to the application is final.
      
      Once a buffer has been fully consumed, the buffer ring head is
      incremented and the next receive will indicate the next buffer ID in the
      CQE cflags.
      
      On the send side, the application can manage how much data is sent from
      an existing buffer by setting sqe->len to the desired send length.
      
      An application can request incremental consumption by setting
      IOU_PBUF_RING_INC in the provided buffer ring registration. Outside of
      that, any provided buffer ring setup and buffer additions is done like
      before, no changes there. The only change is in how an application may
      see multiple completions for the same buffer ID, hence needing to know
      where the next receive will happen.
      
      Note that like existing provided buffer rings, this should not be used
      with IOSQE_ASYNC, as both really require the ring to remain locked over
      the duration of the buffer selection and the operation completion. It
      will consume a buffer otherwise regardless of the size of the IO done.
      Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
      ae98dbf4
    • Jens Axboe's avatar
      io_uring/kbuf: pass in 'len' argument for buffer commit · 6733e678
      Jens Axboe authored
      In preparation for needing the consumed length, pass in the length being
      completed. Unused right now, but will be used when it is possible to
      partially consume a buffer.
      Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
      6733e678
    • Jens Axboe's avatar
      Revert "io_uring: Require zeroed sqe->len on provided-buffers send" · 641a6816
      Jens Axboe authored
      This reverts commit 79996b45.
      
      Revert the change that restricts a send provided buffer to be zero, so
      it will always consume the whole buffer. This is strictly needed for
      partial consumption, as the send may very well be a subset of the
      current buffer. In fact, that's the intended use case.
      
      For non-incremental provided buffer rings, an application should set
      sqe->len carefully to avoid the potential issue described in the
      reverted commit. It is recommended that '0' still be set for len for
      that case, if the application is set on maintaining more than 1 send
      inflight for the same socket. This is somewhat of a nonsensical thing
      to do.
      Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
      641a6816
    • Jens Axboe's avatar
      io_uring/kbuf: move io_ring_head_to_buf() to kbuf.h · 2c8fa70b
      Jens Axboe authored
      In preparation for using this helper in kbuf.h as well, move it there and
      turn it into a macro.
      Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
      2c8fa70b
    • Jens Axboe's avatar
      io_uring/kbuf: add io_kbuf_commit() helper · ecd5c9b2
      Jens Axboe authored
      Committing the selected ring buffer is currently done in three different
      spots, combine it into a helper and just call that.
      Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
      ecd5c9b2
  3. 25 Aug, 2024 22 commits
  4. 24 Aug, 2024 10 commits
    • Kent Overstreet's avatar
      bcachefs: Fix rebalance_work accounting · 49aa7830
      Kent Overstreet authored
      rebalance_work was keying off of the presence of rebelance_opts in the
      extent - but that was incorrect, we keep those around after rebalance
      for indirect extents since the inode's options are not directly
      available
      
      Fixes: 20ac515a ("bcachefs: bch_acct_rebalance_work")
      Signed-off-by: default avatarKent Overstreet <kent.overstreet@linux.dev>
      49aa7830
    • Kent Overstreet's avatar
      bcachefs: Fix failure to flush moves before sleeping in copygc · d3204616
      Kent Overstreet authored
      This fixes an apparent deadlock - rebalance would get stuck trying to
      take nocow locks because they weren't being released by copygc.
      Signed-off-by: default avatarKent Overstreet <kent.overstreet@linux.dev>
      d3204616
    • Linus Torvalds's avatar
      Merge tag 'cgroup-for-6.11-rc4-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup · d2bafcf2
      Linus Torvalds authored
      Pull cgroup fixes from Tejun Heo:
       "Three patches addressing cpuset corner cases"
      
      * tag 'cgroup-for-6.11-rc4-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup:
        cgroup/cpuset: Eliminate unncessary sched domains rebuilds in hotplug
        cgroup/cpuset: Clear effective_xcpus on cpus_allowed clearing only if cpus.exclusive not set
        cgroup/cpuset: fix panic caused by partcmd_update
      d2bafcf2
    • Linus Torvalds's avatar
      Merge tag 'wq-for-6.11-rc4-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/wq · cb2c84b3
      Linus Torvalds authored
      Pull workqueue fixes from Tejun Heo:
       "Nothing too interesting. One patch to remove spurious warning and
        others to address static checker warnings"
      
      * tag 'wq-for-6.11-rc4-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/wq:
        workqueue: Correct declaration of cpu_pwq in struct workqueue_struct
        workqueue: Fix spruious data race in __flush_work()
        workqueue: Remove incorrect "WARN_ON_ONCE(!list_empty(&worker->entry));" from dying worker
        workqueue: Fix UBSAN 'subtraction overflow' error in shift_and_mask()
        workqueue: doc: Fix function name, remove markers
      cb2c84b3
    • Linus Torvalds's avatar
      Merge tag 'mips-fixes_6.11_1' of git://git.kernel.org/pub/scm/linux/kernel/git/mips/linux · 5bd6cf00
      Linus Torvalds authored
      Pull MIPS fixes from Thomas Bogendoerfer:
      
       - Set correct timer mode on Loongson64
      
       - Only request r4k clockevent interrupt on one CPU
      
      * tag 'mips-fixes_6.11_1' of git://git.kernel.org/pub/scm/linux/kernel/git/mips/linux:
        MIPS: cevt-r4k: Don't call get_c0_compare_int if timer irq is installed
        MIPS: Loongson64: Set timer mode in cpu-probe
      5bd6cf00
    • Linus Torvalds's avatar
      Merge tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux · a8a8dcbd
      Linus Torvalds authored
      Pull arm64 kvm fixes from Catalin Marinas:
      
       - Don't drop references on LPIs that weren't visited by the vgic-debug
         iterator
      
       - Cure lock ordering issue when unregistering vgic redistributors
      
       - Fix for misaligned stage-2 mappings when VMs are backed by hugetlb
         pages
      
       - Treat SGI registers as UNDEFINED if a VM hasn't been configured for
         GICv3
      
      * tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux:
        KVM: arm64: Make ICC_*SGI*_EL1 undef in the absence of a vGICv3
        KVM: arm64: Ensure canonical IPA is hugepage-aligned when handling fault
        KVM: arm64: vgic: Don't hold config_lock while unregistering redistributors
        KVM: arm64: vgic-debug: Don't put unmarked LPIs
      a8a8dcbd
    • Linus Torvalds's avatar
      Merge tag 'nfs-for-6.11-2' of git://git.linux-nfs.org/projects/anna/linux-nfs · 60f0560f
      Linus Torvalds authored
      Pull NFS client fixes from Anna Schumaker:
      
       - Fix rpcrdma refcounting in xa_alloc
      
       - Fix rpcrdma usage of XA_FLAGS_ALLOC
      
       - Fix requesting FATTR4_WORD2_OPEN_ARGUMENTS
      
       - Fix attribute bitmap decoder to handle a 3rd word
      
       - Add reschedule points when returning delegations to avoid soft lockups
      
       - Fix clearing layout segments in layoutreturn
      
       - Avoid unnecessary rescanning of the per-server delegation list
      
      * tag 'nfs-for-6.11-2' of git://git.linux-nfs.org/projects/anna/linux-nfs:
        NFS: Avoid unnecessary rescanning of the per-server delegation list
        NFSv4: Fix clearing of layout segments in layoutreturn
        NFSv4: Add missing rescheduling points in nfs_client_return_marked_delegations
        nfs: fix bitmap decoder to handle a 3rd word
        nfs: fix the fetch of FATTR4_OPEN_ARGUMENTS
        rpcrdma: Trace connection registration and unregistration
        rpcrdma: Use XA_FLAGS_ALLOC instead of XA_FLAGS_ALLOC1
        rpcrdma: Device kref is over-incremented on error from xa_alloc
      60f0560f
    • Linus Torvalds's avatar
      Merge tag 'v6.11-rc4-client-fixes' of git://git.samba.org/sfrench/cifs-2.6 · 66ace9a8
      Linus Torvalds authored
      Pull smb client fixes from Steve French:
      
       - fix refcount leak (can cause rmmod fail)
      
       - fix byte range locking problem with cached reads
      
       - fix for mount failure if reparse point unrecognized
      
       - minor typo
      
      * tag 'v6.11-rc4-client-fixes' of git://git.samba.org/sfrench/cifs-2.6:
        smb/client: fix typo: GlobalMid_Sem -> GlobalMid_Lock
        smb: client: ignore unhandled reparse tags
        smb3: fix problem unloading module due to leaked refcount on shutdown
        smb3: fix broken cached reads when posix locks
      66ace9a8
    • Linus Torvalds's avatar
      Merge tag 'input-for-v6.11-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input · 7eb61cc6
      Linus Torvalds authored
      Pull input fixes from Dmitry Torokhov:
      
       - a tweak to uinput interface to reject requests with abnormally large
         number of slots. 100 slots/contacts should be enough for real devices
      
       - support for FocalTech FT8201 added to the edt-ft5x06 driver
      
       - tweaks to i8042 to handle more devices that have issue with its
         emulation
      
       - Synaptics touchpad switched to native SMbus/RMI mode on HP Elitebook
         840 G2
      
       - other minor fixes
      
      * tag 'input-for-v6.11-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input:
        Input: himax_hx83112b - fix incorrect size when reading product ID
        Input: i8042 - use new forcenorestore quirk to replace old buggy quirk combination
        Input: i8042 - add forcenorestore quirk to leave controller untouched even on s3
        Input: i8042 - add Fujitsu Lifebook E756 to i8042 quirk table
        Input: uinput - reject requests with unreasonable number of slots
        Input: edt-ft5x06 - add support for FocalTech FT8201
        dt-bindings: input: touchscreen: edt-ft5x06: Document FT8201 support
        Input: adc-joystick - fix optional value handling
        Input: synaptics - enable SMBus for HP Elitebook 840 G2
        Input: ads7846 - ratelimit the spi_sync error message
      7eb61cc6
    • Linus Torvalds's avatar
      Merge tag 'drm-fixes-2024-08-24' of https://gitlab.freedesktop.org/drm/kernel · 79a899e3
      Linus Torvalds authored
      Pull drm fixes from Dave Airlie:
       "Weekly fixes. xe and msm are the major groups, with
        amdgpu/i915/nouveau having smaller bits. xe has a bunch of hw
        workaround fixes that were found to be missing, so that is why there
        are a bunch of scattered fixes, and one larger one. But overall size
        doesn't look too out of the ordinary.
      
        msm:
         - virtual plane fixes:
            - drop yuv on hw where not supported
            - csc vs yuv format fix
            - rotation fix
         - fix fb cleanup on close
         - reset phy before link training
         - fix visual corruption at 4K
         - fix NULL ptr crash on hotplug
         - simplify debug macros
         - sc7180 fix
         - adreno firmware name error path fix
      
        amdgpu:
         - GFX10 firmware loading fix
         - SDMA 5.2 fix
         - Debugfs parameter validation fix
         - eGPU hotplug fix
      
        i915:
         - fix HDCP timeouts
      
        nouveau:
         - fix SG_DEBUG crash
      
        xe:
         - Fix OA format masks which were breaking build with gcc-5
         - Fix opregion leak (Lucas)
         - Fix OA sysfs entry (Ashutosh)
         - Fix VM dma-resv lock (Brost)
         - Fix tile fini sequence (Brost)
         - Prevent UAF around preempt fence (Auld)
         - Fix DGFX display suspend/resume (Maarten)
         - Many Xe/Xe2 critical workarounds (Auld, Ngai-Mint, Bommu, Tejas, Daniele)
         - Fix devm/drmm issues (Daniele)
         - Fix missing workqueue destroy in xe_gt_pagefault (Stuart)
         - Drop HW fence pointer to HW fence ctx (Brost)
         - Free job before xe_exec_queue_put (Brost)"
      
      * tag 'drm-fixes-2024-08-24' of https://gitlab.freedesktop.org/drm/kernel: (35 commits)
        drm/xe: Free job before xe_exec_queue_put
        drm/xe: Drop HW fence pointer to HW fence ctx
        drm/xe: Fix missing workqueue destroy in xe_gt_pagefault
        drm/amdgpu: fix eGPU hotplug regression
        drm/amdgpu: Validate TA binary size
        drm/amdgpu/sdma5.2: limit wptr workaround to sdma 5.2.1
        drm/amdgpu: fixing rlc firmware loading failure issue
        drm/xe/uc: Use devm to register cleanup that includes exec_queues
        drm/xe: use devm instead of drmm for managed bo
        drm/xe/xe2hpg: Add Wa_14021821874
        drm/xe: fix WA 14018094691
        drm/xe/xe2: Add Wa_15015404425
        drm/xe/xe2: Make subsequent L2 flush sequential
        drm/xe/xe2lpg: Extend workaround 14021402888
        drm/xe/xe2lpm: Extend Wa_16021639441
        drm/xe/bmg: implement Wa_16023588340
        drm/xe/oa/uapi: Make bit masks unsigned
        drm/xe/display: Make display suspend/resume work on discrete
        drm/xe: prevent UAF around preempt fence
        drm/xe: Fix tile fini sequence
        ...
      79a899e3
  5. 23 Aug, 2024 2 commits