All of lore.kernel.org
 help / color / mirror / Atom feed
From: Feng Tang <feng.79.tang@gmail.com>
To: Peter Hurley <peter@hurleysoftware.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Jiri Slaby <jslaby@suse.cz>,
	linux-serial@vger.kernel.org, Beat Bolli <bbolli@ewanet.ch>,
	Pavel Roskin <proski@gnu.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Jiri Kosina <jkosina@suse.cz>, David Sterba <dsterba@suse.cz>,
	Felipe Balbi <balbi@ti.com>,
	Grant Edwards <grant.b.edwards@gmail.com>,
	Stanislaw Gruszka <sgruszka@redhat.com>,
	Hal Murray <murray+fedora@ip-64-139-1-69.sjc.megapath.net>,
	Alan Cox <gnomes@lxorguk.ukuu.org.uk>,
	stable@vger.kernel.org,
	linux-bluetooth <linux-bluetooth@vger.kernel.org>,
	feng.tang@intel.com, bin.yang@intel.com, alek.du@intel.com
Subject: Re: [PATCH] tty: Fix low_latency BUG
Date: Thu, 27 Feb 2014 11:28:59 +0800	[thread overview]
Message-ID: <CA++bM2vjzFOt5wmc=TQ1XMvRCwgnpq6=PKpex=GGZBK_-M6=mw@mail.gmail.com> (raw)
In-Reply-To: <530E0AD3.7040909@hurleysoftware.com>

Hi Peter,

2014-02-26 23:40 GMT+08:00 Peter Hurley <peter@hurleysoftware.com>:
> [ +cc linux-bluetooth ]

>>>
>>> Historically, low_latency was used to force wake-up the reading
>>> process rather than wait for the next scheduler tick. The
>>> effect was to trim multiple milliseconds of latency from
>>> when the process would receive new data.
>>>
>>> Recent tests [1] have shown that the reading process now receives
>>> data with only 10's of microseconds latency without low_latency set.
>>
>>
>> The 10's of miscroseconds is ok for 115200 bps like device, but it may
>> hurt the high speed device like Bluetooth which runs at 3M/4M bps or
>> higher.
>
>
> The tests were run at 400Mbps, so 3Mbps or 4Mbps is not a problem
> (but I think you may be confusing throughput with latency).

I wrote the serial driver for intel mid platforms which are widely used
in current smart phones, so I guess I know what I'm talking :)

Our test and customer test cover both the performance and latency.
say like transferring  2 GB file while using BT A2DP to playing music.

Also I heard there is some app which will do real time void/data
exchange with paired bluetooth, here microseconds really means
something.

>
> FWIW, two things affected the latency times of those particular tests;
> 1) the kernel firewire subsystem handles rx data in a tasklet (so not
>    directly from IRQ) which negatively affected the latency reported, and
> 2) the ftrace instrumentation is not free and there are several traces per
> rx.
>
> If you look carefully at the test trace data, you'll see that the timestamps
> from tty_flip_buffer_push() of the rx data to n_tty_write() of the
> response averages _~11us_; this is the measured latency from tty driver
> receiving the rx data to reading of that data *and* the process
> response (which comes back up through several tty locks).
>
> Naturally, in mainline kernel, the scheduler load will affect the
> measured latency *but that's true regardless of low_latency rx steering
> because the user-space process must still be woken to complete the read*.
>
>
>> More and more smartphones are using uart as the Bluetooth data
>> interface due to its low-pin, low-power feature, and many of them
>> are using HZ=100 kernel, I'm afraid this added delay may cause
>> some problem.
>
>
> Some hard data showing a real problem would help further this
> discussion; my belief is that 3.12+ w/o low_latency rx steering
> will outperform 3.11- w/ low_latency rx steering in every test.

As for measurements, I guess it should cover 2 parts:
1. the performance, like the BT file transfer data rate
2. the latency, like the real time BT communication

I'll try to get some test data soon. Also I'm wondering what devices
have you tested? regarding these 2 points.

>
> I'm glad to hear that the Bluetooth uart interface is getting
> some use; that means someone will soon be fixing the hard lockup
> in hci_uart_tx_wakeup() reported here:

I'm not very familiar with the BT devices on our platforms, but most
of them are not using the in-kernel BT driver, some just use the
n_tty ldisc and the raw data, some use their own ldisc driver.

Thanks,
Feng

  reply	other threads:[~2014-02-27  3:29 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-22 12:31 [PATCH] tty: Fix low_latency BUG Peter Hurley
2014-02-22 12:31 ` Peter Hurley
2014-02-22 21:56 ` One Thousand Gnomes
2014-02-22 21:56   ` One Thousand Gnomes
2014-02-24 13:02 ` David Sterba
2014-02-26  5:11 ` Feng Tang
2014-02-26 15:40   ` Peter Hurley
2014-02-27  3:28     ` Feng Tang [this message]
2014-02-27  9:22       ` One Thousand Gnomes

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='CA++bM2vjzFOt5wmc=TQ1XMvRCwgnpq6=PKpex=GGZBK_-M6=mw@mail.gmail.com' \
    --to=feng.79.tang@gmail.com \
    --cc=alek.du@intel.com \
    --cc=balbi@ti.com \
    --cc=bbolli@ewanet.ch \
    --cc=bin.yang@intel.com \
    --cc=dsterba@suse.cz \
    --cc=feng.tang@intel.com \
    --cc=gnomes@lxorguk.ukuu.org.uk \
    --cc=grant.b.edwards@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jkosina@suse.cz \
    --cc=jslaby@suse.cz \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=murray+fedora@ip-64-139-1-69.sjc.megapath.net \
    --cc=peter@hurleysoftware.com \
    --cc=proski@gnu.org \
    --cc=sgruszka@redhat.com \
    --cc=stable@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.