<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/io_uring/rsrc.h, branch linux-6.10.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-6.10.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-6.10.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2024-04-15T14:10:26Z</updated>
<entry>
<title>io_uring: remove io_req_put_rsrc_locked()</title>
<updated>2024-04-15T14:10:26Z</updated>
<author>
<name>Pavel Begunkov</name>
</author>
<published>2024-04-05T15:50:05Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=c29006a2456bc9c2aea09e4a8958b4d9a7dfcb5a'/>
<id>urn:sha1:c29006a2456bc9c2aea09e4a8958b4d9a7dfcb5a</id>
<content type='text'>
io_req_put_rsrc_locked() is a weird shim function around
io_req_put_rsrc(). All calls to io_req_put_rsrc() require holding
-&gt;uring_lock, so we can just use it directly.

Signed-off-by: Pavel Begunkov &lt;asml.silence@gmail.com&gt;
Link: https://lore.kernel.org/r/a195bc78ac3d2c6fbaea72976e982fe51e50ecdd.1712331455.git.asml.silence@gmail.com
Reviewed-by: Ming Lei &lt;ming.lei@redhat.com&gt;
Signed-off-by: Jens Axboe &lt;axboe@kernel.dk&gt;
</content>
</entry>
<entry>
<title>io_uring/alloc_cache: switch to array based caching</title>
<updated>2024-04-15T14:10:25Z</updated>
<author>
<name>Jens Axboe</name>
</author>
<published>2024-03-20T21:19:44Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=414d0f45c316221acbf066658afdbae5b354a5cc'/>
<id>urn:sha1:414d0f45c316221acbf066658afdbae5b354a5cc</id>
<content type='text'>
Currently lists are being used to manage this, but best practice is
usually to have these in an array instead as that it cheaper to manage.

Outside of that detail, games are also played with KASAN as the list
is inside the cached entry itself.

Finally, all users of this need a struct io_cache_entry embedded in
their struct, which is union'ized with something else in there that
isn't used across the free -&gt; realloc cycle.

Get rid of all of that, and simply have it be an array. This will not
change the memory used, as we're just trading an 8-byte member entry
for the per-elem array size.

This reduces the overhead of the recycled allocations, and it reduces
the amount of code code needed to support recycling to about half of
what it currently is.

Signed-off-by: Jens Axboe &lt;axboe@kernel.dk&gt;
</content>
</entry>
<entry>
<title>io_uring: Don't include af_unix.h.</title>
<updated>2024-02-13T02:02:11Z</updated>
<author>
<name>Kuniyuki Iwashima</name>
</author>
<published>2024-02-12T23:42:36Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=3fb1764c6b57808ddab7fe7c242fa04c2479ef0a'/>
<id>urn:sha1:3fb1764c6b57808ddab7fe7c242fa04c2479ef0a</id>
<content type='text'>
Changes to AF_UNIX trigger rebuild of io_uring, but io_uring does
not use AF_UNIX anymore.

Let's not include af_unix.h and instead include necessary headers.

Signed-off-by: Kuniyuki Iwashima &lt;kuniyu@amazon.com&gt;
Link: https://lore.kernel.org/r/20240212234236.63714-1-kuniyu@amazon.com
Signed-off-by: Jens Axboe &lt;axboe@kernel.dk&gt;
</content>
</entry>
<entry>
<title>io_uring/rsrc: improve code generation for fixed file assignment</title>
<updated>2024-01-11T20:37:31Z</updated>
<author>
<name>Jens Axboe</name>
</author>
<published>2024-01-11T20:34:33Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=3f302388d45855c0b24802e7b414e3fb29f172e3'/>
<id>urn:sha1:3f302388d45855c0b24802e7b414e3fb29f172e3</id>
<content type='text'>
For the normal read/write path, we have already locked the ring
submission side when assigning the file. This causes branch
mispredictions when we then check and try and lock again in
io_req_set_rsrc_node(). As this is a very hot path, this matters.

Add a basic helper that already assumes we already have it locked,
and use that in io_file_get_fixed().

Signed-off-by: Jens Axboe &lt;axboe@kernel.dk&gt;
</content>
</entry>
<entry>
<title>io_uring: drop any code related to SCM_RIGHTS</title>
<updated>2023-12-19T19:36:34Z</updated>
<author>
<name>Jens Axboe</name>
</author>
<published>2023-12-19T19:36:34Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=6e5e6d274956305f1fc0340522b38f5f5be74bdb'/>
<id>urn:sha1:6e5e6d274956305f1fc0340522b38f5f5be74bdb</id>
<content type='text'>
This is dead code after we dropped support for passing io_uring fds
over SCM_RIGHTS, get rid of it.

Signed-off-by: Jens Axboe &lt;axboe@kernel.dk&gt;
</content>
</entry>
<entry>
<title>io_uring/af_unix: disable sending io_uring over sockets</title>
<updated>2023-12-07T17:35:19Z</updated>
<author>
<name>Pavel Begunkov</name>
</author>
<published>2023-12-06T13:26:47Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=705318a99a138c29a512a72c3e0043b3cd7f55f4'/>
<id>urn:sha1:705318a99a138c29a512a72c3e0043b3cd7f55f4</id>
<content type='text'>
File reference cycles have caused lots of problems for io_uring
in the past, and it still doesn't work exactly right and races with
unix_stream_read_generic(). The safest fix would be to completely
disallow sending io_uring files via sockets via SCM_RIGHT, so there
are no possible cycles invloving registered files and thus rendering
SCM accounting on the io_uring side unnecessary.

Cc:  &lt;stable@vger.kernel.org&gt;
Fixes: 0091bfc81741b ("io_uring/af_unix: defer registered files gc to io_uring release")
Reported-and-suggested-by: Jann Horn &lt;jannh@google.com&gt;
Signed-off-by: Pavel Begunkov &lt;asml.silence@gmail.com&gt;
Link: https://lore.kernel.org/r/c716c88321939156909cfa1bd8b0faaf1c804103.1701868795.git.asml.silence@gmail.com
Signed-off-by: Jens Axboe &lt;axboe@kernel.dk&gt;
</content>
</entry>
<entry>
<title>io_uring/rsrc: Annotate struct io_mapped_ubuf with __counted_by</title>
<updated>2023-08-18T01:14:47Z</updated>
<author>
<name>Kees Cook</name>
</author>
<published>2023-08-17T21:21:47Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=04d9244c9420db33149608a566399176d57690f8'/>
<id>urn:sha1:04d9244c9420db33149608a566399176d57690f8</id>
<content type='text'>
Prepare for the coming implementation by GCC and Clang of the __counted_by
attribute. Flexible array members annotated with __counted_by can have
their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS
(for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family
functions).

As found with Coccinelle[1], add __counted_by for struct io_mapped_ubuf.

[1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci

Cc: Jens Axboe &lt;axboe@kernel.dk&gt;
Cc: Pavel Begunkov &lt;asml.silence@gmail.com&gt;
Cc: io-uring@vger.kernel.org
Signed-off-by: Kees Cook &lt;keescook@chromium.org&gt;
Reviewed-by: "Gustavo A. R. Silva" &lt;gustavoars@kernel.org&gt;
Link: https://lore.kernel.org/r/20230817212146.never.853-kees@kernel.org
Signed-off-by: Jens Axboe &lt;axboe@kernel.dk&gt;
</content>
</entry>
<entry>
<title>io_uring/rsrc: Remove unused declaration io_rsrc_put_tw()</title>
<updated>2023-08-09T16:46:46Z</updated>
<author>
<name>Yue Haibing</name>
</author>
<published>2023-08-08T15:10:58Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=d4b30eed51d79361c290dc25a1386f5611f4982a'/>
<id>urn:sha1:d4b30eed51d79361c290dc25a1386f5611f4982a</id>
<content type='text'>
Commit 36b9818a5a84 ("io_uring/rsrc: don't offload node free")
removed the implementation but leave declaration.

Signed-off-by: Yue Haibing &lt;yuehaibing@huawei.com&gt;
Link: https://lore.kernel.org/r/20230808151058.4572-1-yuehaibing@huawei.com
Signed-off-by: Jens Axboe &lt;axboe@kernel.dk&gt;
</content>
</entry>
<entry>
<title>io_uring/rsrc: disassociate nodes and rsrc_data</title>
<updated>2023-04-19T01:38:26Z</updated>
<author>
<name>Pavel Begunkov</name>
</author>
<published>2023-04-18T13:06:41Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=2236b3905b4d4e9cd4d149ab35767858c02bb79b'/>
<id>urn:sha1:2236b3905b4d4e9cd4d149ab35767858c02bb79b</id>
<content type='text'>
Make rsrc nodes independent from rsrd_data, for that we keep ctx and
rsrc type in nodes.

Signed-off-by: Pavel Begunkov &lt;asml.silence@gmail.com&gt;
Link: https://lore.kernel.org/r/4f259abe9cd4eea6a3b4ed83508635218acd3c3f.1681822823.git.asml.silence@gmail.com
Signed-off-by: Jens Axboe &lt;axboe@kernel.dk&gt;
</content>
</entry>
<entry>
<title>io_uring/rsrc: devirtualise rsrc put callbacks</title>
<updated>2023-04-19T01:38:26Z</updated>
<author>
<name>Pavel Begunkov</name>
</author>
<published>2023-04-18T13:06:40Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=fc7f3a8d3a78503c4f3e108155fb9a233dc307a4'/>
<id>urn:sha1:fc7f3a8d3a78503c4f3e108155fb9a233dc307a4</id>
<content type='text'>
We only have two rsrc types, buffers and files, replace virtual
callbacks for putting resources down with a switch..case.

Signed-off-by: Pavel Begunkov &lt;asml.silence@gmail.com&gt;
Link: https://lore.kernel.org/r/02ca727bf8e5f7f820c2f404e95ae88c8f472930.1681822823.git.asml.silence@gmail.com
Signed-off-by: Jens Axboe &lt;axboe@kernel.dk&gt;
</content>
</entry>
</feed>
