Commit Graph

12 Commits

Author SHA1 Message Date
Jeff Moyer 6ad268f5e1 io_uring: expand main struct io_kiocb flags to 64-bits
JIRA: https://issues.redhat.com/browse/RHEL-27755

commit 4bcb982cce74e18155fba0d97394ca9634e0d8f0
Author: Jens Axboe <axboe@kernel.dk>
Date:   Sun Jan 28 20:05:47 2024 -0700

    io_uring: expand main struct io_kiocb flags to 64-bits
    
    We're out of space here, and none of the flags are easily reclaimable.
    Bump it to 64-bits and re-arrange the struct a bit to avoid gaps.
    
    Add a specific bitwise type for the request flags, io_request_flags_t.
    This will help catch violations of casting this value to a smaller type
    on 32-bit archs, like unsigned int.
    
    This creates a hole in the io_kiocb, so move nr_tw up and rsrc_node down
    to retain needing only cacheline 0 and 1 for non-polled opcodes.
    
    No functional changes intended in this patch.
    
    Signed-off-by: Jens Axboe <axboe@kernel.dk>

Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
2024-07-02 14:33:37 -04:00
Jeff Moyer a8b58ec6be io_uring: add helpers to decode the fixed file file_ptr
JIRA: https://issues.redhat.com/browse/RHEL-12076

commit 4bfb0c9af832a182a54e549123a634e0070c8d4f
Author: Christoph Hellwig <hch@lst.de>
Date:   Tue Jun 20 13:32:35 2023 +0200

    io_uring: add helpers to decode the fixed file file_ptr
    
    Remove all the open coded magic on slot->file_ptr by introducing two
    helpers that return the file pointer and the flags instead.
    
    Signed-off-by: Christoph Hellwig <hch@lst.de>
    Link: https://lore.kernel.org/r/20230620113235.920399-9-hch@lst.de
    Signed-off-by: Jens Axboe <axboe@kernel.dk>

Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
2023-11-02 15:31:55 -04:00
Jeff Moyer 9af1c7e10d io_uring: return REQ_F_ flags from io_file_get_flags
JIRA: https://issues.redhat.com/browse/RHEL-12076

commit 8487f083c6ff6e02b2ec14f22ef2b0079a1b6425
Author: Christoph Hellwig <hch@lst.de>
Date:   Tue Jun 20 13:32:32 2023 +0200

    io_uring: return REQ_F_ flags from io_file_get_flags
    
    Two of the three callers want them, so return the more usual format,
    and shift into the FFS_ form only for the fixed file table.
    
    Signed-off-by: Christoph Hellwig <hch@lst.de>
    Link: https://lore.kernel.org/r/20230620113235.920399-6-hch@lst.de
    Signed-off-by: Jens Axboe <axboe@kernel.dk>

Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
2023-11-02 15:31:55 -04:00
Jeff Moyer 21ec4974a2 io_uring: kill hot path fixed file bitmap debug checks
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2068237

commit 4d5059512d283dab7372d282c2fbd43c7f5a2456
Author: Pavel Begunkov <asml.silence@gmail.com>
Date:   Sun Oct 16 21:30:49 2022 +0100

    io_uring: kill hot path fixed file bitmap debug checks
    
    We test file_table.bitmap in io_file_get_fixed() to check invariants,
    don't do it, it's expensive and was showing up in profiles. No reports of
    this triggering has come in. Move the check to the file clear instead,
    which will still catch any wrong usage.
    
    Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
    Link: https://lore.kernel.org/r/cf77f2ded68d2e5b2bc7355784d969837d48e023.1665891182.git.asml.silence@gmail.com
    Signed-off-by: Jens Axboe <axboe@kernel.dk>

Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
2023-05-05 15:24:10 -04:00
Jeff Moyer 8be49fc979 io_uring: remove FFS_SCM
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2068237

commit 38eddb2c75fb99b9cd78445094ca0e1bda08d102
Author: Pavel Begunkov <asml.silence@gmail.com>
Date:   Sun Oct 16 21:30:48 2022 +0100

    io_uring: remove FFS_SCM
    
    THe lifetime of SCM'ed files is bound to ring_sock, which is destroyed
    strictly after we're done with registered file tables. This means there
    is no need for the FFS_SCM hack, which was not available on 32-bit builds
    anyway.
    
    Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
    Link: https://lore.kernel.org/r/984226a1045adf42dc35d8bd7fb5a8bbfa472ce1.1665891182.git.asml.silence@gmail.com
    Signed-off-by: Jens Axboe <axboe@kernel.dk>

Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
2023-05-05 15:24:10 -04:00
Jeff Moyer 4b74f8a7f1 io_uring: let to set a range for file slot allocation
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2068237

commit 6e73dffbb93cb8797cd4e42e98d837edf0f1a967
Author: Pavel Begunkov <asml.silence@gmail.com>
Date:   Sat Jun 25 11:55:38 2022 +0100

    io_uring: let to set a range for file slot allocation
    
    From recently io_uring provides an option to allocate a file index for
    operation registering fixed files. However, it's utterly unusable with
    mixed approaches when for a part of files the userspace knows better
    where to place it, as it may race and users don't have any sane way to
    pick a slot and hoping it will not be taken.
    
    Let the userspace to register a range of fixed file slots in which the
    auto-allocation happens. The use case is splittting the fixed table in
    two parts, where on of them is used for auto-allocation and another for
    slot-specified operations.
    
    Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
    Link: https://lore.kernel.org/r/66ab0394e436f38437cf7c44676e1920d09687ad.1656154403.git.asml.silence@gmail.com
    Signed-off-by: Jens Axboe <axboe@kernel.dk>

Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
2023-04-29 07:08:02 -04:00
Jeff Moyer 3f0281207a io_uring: split out fixed file installation and removal
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2068237

commit f110ed8498afa6ff8e9a8c08fb26880e02117616
Author: Jens Axboe <axboe@kernel.dk>
Date:   Mon Jun 13 04:42:56 2022 -0600

    io_uring: split out fixed file installation and removal
    
    Put it with the filetable code, which is where it belongs. While doing
    so, have the helpers take a ctx rather than an io_kiocb. It doesn't make
    sense to use a request, as it's not an operation on the request itself.
    It applies to the ring itself.
    
    Signed-off-by: Jens Axboe <axboe@kernel.dk>

Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
2023-04-29 07:06:02 -04:00
Jeff Moyer ad94ff1749 io_uring: dedup io_run_task_work
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2068237

commit 024f15e033a52660a045947ee56c7e842180fa81
Author: Pavel Begunkov <asml.silence@gmail.com>
Date:   Tue Jun 21 10:09:02 2022 +0100

    io_uring: dedup io_run_task_work
    
    We have an identical copy of io_run_task_work() for io-wq called
    io_flush_signals(), deduplicate them.
    
    Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
    Link: https://lore.kernel.org/r/a157a4df5fa217b8bd03c73494f2fd0e24e44fbc.1655802465.git.asml.silence@gmail.com
    Signed-off-by: Jens Axboe <axboe@kernel.dk>

Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
2023-04-29 06:40:02 -04:00
Jeff Moyer 61793331ab io_uring: make io_uring_types.h public
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2068237

commit ab1c84d855cf2c284fa0f4b17fc04063659c54a1
Author: Pavel Begunkov <asml.silence@gmail.com>
Date:   Thu Jun 16 13:57:19 2022 +0100

    io_uring: make io_uring_types.h public
    
    Move io_uring types to linux/include, need them public so tracing can
    see the definitions and we can clean trace/events/io_uring.h
    
    Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
    Link: https://lore.kernel.org/r/a15f12e8cb7289b2de0deaddcc7518d98a132d17.1655384063.git.asml.silence@gmail.com
    Signed-off-by: Jens Axboe <axboe@kernel.dk>

Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
2023-04-29 06:20:02 -04:00
Jeff Moyer 796fa3b9c5 io_uring: move remaining file table manipulation to filetable.c
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2068237

commit c98817e6cd4471a6f6283813dd6efea162f5ac5f
Author: Jens Axboe <axboe@kernel.dk>
Date:   Thu May 26 09:44:31 2022 -0600

    io_uring: move remaining file table manipulation to filetable.c
    
    Signed-off-by: Jens Axboe <axboe@kernel.dk>

Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
2023-04-29 05:40:02 -04:00
Jeff Moyer affb40be46 io_uring: move fdinfo helpers to its own file
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2068237

commit a4ad4f748ea96202451f88b6385d7283d0f2e513
Author: Jens Axboe <axboe@kernel.dk>
Date:   Wed May 25 10:40:19 2022 -0600

    io_uring: move fdinfo helpers to its own file
    
    This also means moving a bit more of the fixed file handling to the
    filetable side, which makes sense separately too.
    
    Signed-off-by: Jens Axboe <axboe@kernel.dk>

Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
2023-04-29 05:32:02 -04:00
Jeff Moyer b082d23ed2 io_uring: separate out file table handling code
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2068237

commit 453b329be5eacfc48dd43035af82bc7f28ecfedf
Author: Jens Axboe <axboe@kernel.dk>
Date:   Tue May 24 21:43:10 2022 -0600

    io_uring: separate out file table handling code
    
    Signed-off-by: Jens Axboe <axboe@kernel.dk>

Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
2023-04-29 05:20:02 -04:00