<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/io_uring/futex.c, branch linux-6.15.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-6.15.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-6.15.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2025-03-05T14:38:55Z</updated>
<entry>
<title>io_uring: introduce io_cache_free() helper</title>
<updated>2025-03-05T14:38:55Z</updated>
<author>
<name>Caleb Sander Mateos</name>
</author>
<published>2025-03-04T19:48:12Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=0d83b8a9f180436a84fbdeb575696b0c3ae0ac0c'/>
<id>urn:sha1:0d83b8a9f180436a84fbdeb575696b0c3ae0ac0c</id>
<content type='text'>
Add a helper function io_cache_free() that returns an allocation to a
io_alloc_cache, falling back on kfree() if the io_alloc_cache is full.
This is the inverse of io_cache_alloc(), which takes an allocation from
an io_alloc_cache and falls back on kmalloc() if the cache is empty.

Convert 4 callers to use the helper.

Signed-off-by: Caleb Sander Mateos &lt;csander@purestorage.com&gt;
Suggested-by: Li Zetao &lt;lizetao1@huawei.com&gt;
Link: https://lore.kernel.org/r/20250304194814.2346705-1-csander@purestorage.com
Signed-off-by: Jens Axboe &lt;axboe@kernel.dk&gt;
</content>
</entry>
<entry>
<title>io_uring: introduce type alias for io_tw_state</title>
<updated>2025-02-17T12:34:50Z</updated>
<author>
<name>Caleb Sander Mateos</name>
</author>
<published>2025-02-17T02:25:04Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=bcf8a0293a019bb0c4aebafdebe9a1e7a923249a'/>
<id>urn:sha1:bcf8a0293a019bb0c4aebafdebe9a1e7a923249a</id>
<content type='text'>
In preparation for changing how io_tw_state is passed, introduce a type
alias io_tw_token_t for struct io_tw_state *. This allows for changing
the representation in one place, without having to update the many
functions that just forward their struct io_tw_state * argument.

Also add a comment to struct io_tw_state to explain its purpose.

Signed-off-by: Caleb Sander Mateos &lt;csander@purestorage.com&gt;
Link: https://lore.kernel.org/r/20250217022511.1150145-1-csander@purestorage.com
Signed-off-by: Jens Axboe &lt;axboe@kernel.dk&gt;
</content>
</entry>
<entry>
<title>io_uring/futex: use generic io_cancel_remove() helper</title>
<updated>2025-02-17T12:34:45Z</updated>
<author>
<name>Jens Axboe</name>
</author>
<published>2025-02-05T20:15:57Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=2eaa2fac4704d59f2fd07e496114c39303e54a18'/>
<id>urn:sha1:2eaa2fac4704d59f2fd07e496114c39303e54a18</id>
<content type='text'>
Don't implement our own loop rolling and checking, just use the generic
helper to find and cancel requests.

Signed-off-by: Jens Axboe &lt;axboe@kernel.dk&gt;
</content>
</entry>
<entry>
<title>io_uring/futex: convert to io_cancel_remove_all()</title>
<updated>2025-02-17T12:34:45Z</updated>
<author>
<name>Jens Axboe</name>
</author>
<published>2025-02-05T19:51:26Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=e855b9138470da9c1d2fe340acf653bd2af03922'/>
<id>urn:sha1:e855b9138470da9c1d2fe340acf653bd2af03922</id>
<content type='text'>
Use the generic helper for cancelations.

Signed-off-by: Jens Axboe &lt;axboe@kernel.dk&gt;
</content>
</entry>
<entry>
<title>Merge tag 'locking-urgent-2025-02-08' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip</title>
<updated>2025-02-08T18:54:11Z</updated>
<author>
<name>Linus Torvalds</name>
</author>
<published>2025-02-08T18:54:11Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=fa76887bb72ae11347730271e6a04c147b7527e6'/>
<id>urn:sha1:fa76887bb72ae11347730271e6a04c147b7527e6</id>
<content type='text'>
Pull locking fix from Ingo Molnar:
 "Fix a dangling pointer bug in the futex code used by the uring code.

  It isn't causing problems at the moment due to uring ABI limitations
  leaving it essentially unused in current usages, but is a good idea to
  fix nevertheless"

* tag 'locking-urgent-2025-02-08' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  futex: Pass in task to futex_queue()
</content>
</entry>
<entry>
<title>futex: Pass in task to futex_queue()</title>
<updated>2025-01-24T08:37:30Z</updated>
<author>
<name>Jens Axboe</name>
</author>
<published>2025-01-15T16:05:15Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=5e0e02f0d7e52cfc8b1adfc778dd02181d8b47b4'/>
<id>urn:sha1:5e0e02f0d7e52cfc8b1adfc778dd02181d8b47b4</id>
<content type='text'>
futex_queue() -&gt; __futex_queue() uses 'current' as the task to store in
the struct futex_q-&gt;task field. This is fine for synchronous usage of
the futex infrastructure, but it's not always correct when used by
io_uring where the task doing the initial futex_queue() might not be
available later on. This doesn't lead to any issues currently, as the
io_uring side doesn't support PI futexes, but it does leave a
potentially dangling pointer which is never a good idea.

Have futex_queue() take a task_struct argument, and have the regular
callers pass in 'current' for that. Meanwhile io_uring can just pass in
NULL, as the task should never be used off that path. In theory
req-&gt;tctx-&gt;task could be used here, but there's no point populating it
with a task field that will never be used anyway.

Reported-by: Jann Horn &lt;jannh@google.com&gt;
Signed-off-by: Jens Axboe &lt;axboe@kernel.dk&gt;
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Link: https://lore.kernel.org/all/22484a23-542c-4003-b721-400688a0d055@kernel.dk


</content>
</entry>
<entry>
<title>io_uring: get rid of alloc cache init_once handling</title>
<updated>2025-01-23T18:32:28Z</updated>
<author>
<name>Jens Axboe</name>
</author>
<published>2025-01-23T03:00:57Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=fa3595523d72d13508befd28cf2ca642cafc69f7'/>
<id>urn:sha1:fa3595523d72d13508befd28cf2ca642cafc69f7</id>
<content type='text'>
init_once is called when an object doesn't come from the cache, and
hence needs initial clearing of certain members. While the whole
struct could get cleared by memset() in that case, a few of the cache
members are large enough that this may cause unnecessary overhead if
the caches used aren't large enough to satisfy the workload. For those
cases, some churn of kmalloc+kfree is to be expected.

Ensure that the 3 users that need clearing put the members they need
cleared at the start of the struct, and wrap the rest of the struct in
a struct group so the offset is known.

While at it, improve the interaction with KASAN such that when/if
KASAN writes to members inside the struct that should be retained over
caching, it won't trip over itself. For rw and net, the retaining of
the iovec over caching is disabled if KASAN is enabled. A helper will
free and clear those members in that case.

Signed-off-by: Jens Axboe &lt;axboe@kernel.dk&gt;
</content>
</entry>
<entry>
<title>io_uring/futex: Allocate ifd with generic alloc_cache helper</title>
<updated>2024-12-27T17:07:17Z</updated>
<author>
<name>Gabriel Krisman Bertazi</name>
</author>
<published>2024-12-16T20:46:09Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=b2846567060638a85724579781fc4a3ca6f137e4'/>
<id>urn:sha1:b2846567060638a85724579781fc4a3ca6f137e4</id>
<content type='text'>
Instead of open-coding the allocation, use the generic alloc_cache
helper.

Signed-off-by: Gabriel Krisman Bertazi &lt;krisman@suse.de&gt;
Link: https://lore.kernel.org/r/20241216204615.759089-4-krisman@suse.de
Signed-off-by: Jens Axboe &lt;axboe@kernel.dk&gt;
</content>
</entry>
<entry>
<title>io_uring: move cancelations to be io_uring_task based</title>
<updated>2024-11-06T20:55:38Z</updated>
<author>
<name>Jens Axboe</name>
</author>
<published>2024-11-03T17:22:43Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=f03baece08188f2e239c0ca0c098c14c71739ffb'/>
<id>urn:sha1:f03baece08188f2e239c0ca0c098c14c71739ffb</id>
<content type='text'>
Right now the task_struct pointer is used as the key to match a task,
but in preparation for some io_kiocb changes, move it to using struct
io_uring_task instead. No functional changes intended in this patch.

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>
</feed>
