All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Jason A. Donenfeld" <Jason@zx2c4.com>
To: Hannes Frederic Sowa <hannes@stressinduktion.org>
Cc: David Miller <davem@davemloft.net>,
	Netdev <netdev@vger.kernel.org>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: irq_fpu_usable() is false in ndo_start_xmit() for UDP packets
Date: Tue, 17 Nov 2015 00:57:45 +0100	[thread overview]
Message-ID: <CAHmME9pEgER+xr7xtV8POgfJt8jao=DmaFmvzXp7P9+3hoWHPg@mail.gmail.com> (raw)
In-Reply-To: <1447712830.2096939.441563921.3680DBCF@webmail.messagingengine.com>

Hi Hannes,

Thanks for your response.

On Mon, Nov 16, 2015 at 11:27 PM, Hannes Frederic Sowa
<hannes@stressinduktion.org> wrote:
> Use the irqsoff tracer to find the problematic functions which disable
> interrupts and try to work around it in case of UDP. This could benefit
> the whole stack.

I didn't know about the irqsoff tracer. This looks very useful.
Unfortunately, it turns out that David was right: in_interrupt() is
always true, anyway, when ndo_start_xmit is called. This means, based
on this function:

bool irq_fpu_usable(void)
{
        return !in_interrupt() ||
                interrupted_user_mode() ||
                interrupted_kernel_fpu_idle();
}


1. irq_fpu_usable() is true for TCP. Since in_interrupt() is always
true in ndo_start_xmit, this means that in this case, we're lucky and
either interrupted_user_mode() is true, or
interrupted_kernel_fpu_idle() is true.

2. irq_fpu_usable() is FALSE for UDP! Since in_interrupt() is always
true in ndo_start_xmit, this means that in this case, both
interrupted_user_mode() and interrupted_kernel_fpu_idle() are false!

I now need to determine why precisely these are false in that case. Is
there other UDP code that's somehow making use of the FPU? Some
strange accelerated CRC32 perhaps? Or is there a weird situation
happening in which user mode isn't being interrupted? I suspect not,
since tracing this shows an entry point always of a syscall.

Investigating further, will report back.

Jason

  reply	other threads:[~2015-11-16 23:57 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-16 19:52 irq_fpu_usable() is false in ndo_start_xmit() for UDP packets Jason A. Donenfeld
2015-11-16 20:32 ` David Miller
2015-11-16 20:58   ` Jason A. Donenfeld
2015-11-16 21:17     ` David Miller
2015-11-16 21:28       ` Jason A. Donenfeld
2015-11-16 21:33         ` David Miller
2015-11-16 21:37           ` Jason A. Donenfeld
2015-11-16 22:27     ` Hannes Frederic Sowa
2015-11-16 23:57       ` Jason A. Donenfeld [this message]
2015-11-17  0:04         ` Jason A. Donenfeld
2015-11-17 12:38   ` David Laight

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='CAHmME9pEgER+xr7xtV8POgfJt8jao=DmaFmvzXp7P9+3hoWHPg@mail.gmail.com' \
    --to=jason@zx2c4.com \
    --cc=davem@davemloft.net \
    --cc=hannes@stressinduktion.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@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.