From: Ben Greear <greearb@candelatech.com>
To: Johannes Berg <johannes@sipsolutions.net>,
linux-wireless <linux-wireless@vger.kernel.org>
Subject: Re: Question on iwlwifi iwl_mvm_mac_itxq_xmit, possible busy-spin.
Date: Tue, 29 Oct 2024 09:13:03 -0700 [thread overview]
Message-ID: <2fae54fe-9a15-4003-855f-34a8de889f3c@candelatech.com> (raw)
In-Reply-To: <10ef9bc82600e0ee0ccf763b842f056bcb1e2fdb.camel@sipsolutions.net>
On 10/29/24 9:02 AM, Johannes Berg wrote:
> On Tue, 2024-10-29 at 08:55 -0700, Ben Greear wrote:
>>>
>>> Not really? It should only get here from two places: userspace
>>> (serialized, so you're not going to get to this point with two threads
>>> from there), and the "queue no longer full" logic I mentioned above. Oh,
>>> maybe technically a third at the beginning after allocating a new queue.
>>
>> How is user-space serialized here? The comments in the code seem to assume
>> that multiple threads/whatever calling into this is expected (ie, the whole
>> 3-state atomic counter).
>
> Well mac80211, certainly serialized per iTXQ, but since we don't have
> LLTX (yet) also through a single netdev queue.
>
>>> I guess I could sort of see a scenario where
>>>
>>> - queues got full
>>> - queues got not full
>>> - we kick this logic via "queue not full"
>>> - while this is running, userspace TX permanently bumps
>>> tx_request from 1 to 2, this decrements it again, etc.
>>
>> Considering GSO and KASAN slowness and highly loaded system, perhaps under memory pressure too,
>> maybe upper stack could feed the txq fast enough that something is always bumping
>> tx_requests to 2 before inner loop can finish?
>
> Maybe? But at some point the socket buffers are full too. You can't
> indefinitely queue packets.
>
>>> What thread is the soft lockup in that you see?
>>
>> I believe this below is the culprit. Other threads are blocked on trying to grab xmit lock on
>> netdev and sock locks on tcp socket(s).
>
> That seems odd though - it's locked up at a different place, and also
> coming in from userspace - but that's serialized against other
> userspace, and the "queue not full" thread can only run once really?
>
> OTOH if it's deadlocked at that level you could get interrupted at any
> level below...
>
> I guess it's still possible that you end up pushing a packet down, it
> gets transmitted, space becomes available, and then we run this again to
> push more packets all while the original loop didn't finish? But that
> seem pretty unlikely?
>
> Hard to tell what's going on.
Yes, that sums it up nicely. Anyway, we'll keep digging and thanks for
taking a look.
--Ben
>
> johannes
>
--
Ben Greear <greearb@candelatech.com>
Candela Technologies Inc http://www.candelatech.com
prev parent reply other threads:[~2024-10-29 16:13 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-28 17:48 Question on iwlwifi iwl_mvm_mac_itxq_xmit, possible busy-spin Ben Greear
2024-10-29 8:01 ` Johannes Berg
2024-10-29 15:55 ` Ben Greear
2024-10-29 16:02 ` Johannes Berg
2024-10-29 16:13 ` Ben Greear [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=2fae54fe-9a15-4003-855f-34a8de889f3c@candelatech.com \
--to=greearb@candelatech.com \
--cc=johannes@sipsolutions.net \
--cc=linux-wireless@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.