From: greg@kroah.com (Greg KH)
To: kernelnewbies@lists.kernelnewbies.org
Subject: Sleep and Wake up
Date: Mon, 2 May 2011 15:04:37 -0700 [thread overview]
Message-ID: <20110502220437.GA30832@kroah.com> (raw)
In-Reply-To: <BANLkTim3ZKOM2p3D9prXaE-RnL-cLkRGZw@mail.gmail.com>
On Mon, May 02, 2011 at 02:02:34PM -0700, Abu Rasheda wrote:
> On Mon, May 2, 2011 at 12:28 PM, Greg KH <greg@kroah.com> wrote:
> > On Mon, May 02, 2011 at 11:32:32AM -0700, Abu Rasheda wrote:
> >> I am testing my driver on much faster host processor and facing
> >> following issues:
> >>
> >> My host is too powerful and it can fill up device buffer queue very fast.
> >
> > What kind of device is this?
>
> its a networking device
It sounds like a broken device, you need to be able to handle large data
streams, right? Are you running Linux in this device and that is the
issue you are having?
> >> I get best performance when I do busy wait, but this is not desirable
> >> and is bad design.
> >>
> >> I need to sleep and wake up quickly and predictability. Indication
> >> from device that queue has space, is coming in form of memory write
> >> (device writes to a memory location of i86 processor).
> >>
> >> I tried using wait_event_interruptible_timeout, I am depending on 2nd
> >> parameter of the function but it wake up is too slow, even tried using
> >> value of 1.
> >
> > Why not try increasing the buffer in your driver to handle any amount of
> > data needed?
>
> Problem come from the fact that remote end can be slow, so device /
> driver cannot do much. If I increase buffer size, than running on
> (even) faster host processor will bring back same issue. I am looking
> for solution which will scale.
>
> I check for available buffer size if space is low, I sleep and retry.
> This is causing lot of CPU to be wasted.
>
> How can I optimize this ?
Use NAPI for your network driver?
good luck,
greg k-h
next prev parent reply other threads:[~2011-05-02 22:04 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-05-02 18:32 Sleep and Wake up Abu Rasheda
2011-05-02 19:28 ` Greg KH
2011-05-02 21:02 ` Abu Rasheda
2011-05-02 22:04 ` Greg KH [this message]
2011-05-02 23:04 ` Fwd: " Abu Rasheda
2011-05-02 19:40 ` Kernel compilation Ezequiel García
2011-05-05 14:15 ` Pico Geyer
2011-05-03 7:10 ` Sleep and Wake up Mulyadi Santosa
2011-05-10 3:14 ` Peter Teoh
-- strict thread matches above, loose matches on Subject: below --
2011-05-03 2:13 Vikram Narayanan
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=20110502220437.GA30832@kroah.com \
--to=greg@kroah.com \
--cc=kernelnewbies@lists.kernelnewbies.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).