netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Cong Wang <cwang@twopensource.com>
To: Neil Horman <nhorman@tuxdriver.com>
Cc: netdev <netdev@vger.kernel.org>, David Miller <davem@davemloft.net>
Subject: Re: [RFC PATCH] net: Provide linear backoff mechanism for constrained resources at the driver
Date: Wed, 21 May 2014 11:05:28 -0700	[thread overview]
Message-ID: <CAHA+R7Ox+6f2Kd9ZyHLez_7rDrQs1vHEZnsoarhYhd9QRVumJw@mail.gmail.com> (raw)
In-Reply-To: <1399577392-4457-1-git-send-email-nhorman@tuxdriver.com>

On Thu, May 8, 2014 at 12:29 PM, Neil Horman <nhorman@tuxdriver.com> wrote:
> What about something like this?  Its not even compile tested, but let me know
> what you think of the idea.  The reasoning behind it is that transient resources
> like dma address ranges in the iommu or swiotlb have the following attributes
>
> 1) they are quickly allocated and freed
>
> 2) Usually handled by simply trying again at some later point in time
>
> 3) Likely to fail again if tried again immediately.
>
> 4) Not condusive to interlocked signaling mechanisms as the time it takes to
> find and signal a waiting tx queue that resources are now available may take
> longer than needed, and may still result in failure, as competing allocators
> may race in and claim said resources during the signaling period.
>
> As such, what if we try something more simple like a linear backoff? In this
> example we add a TX return code that indicates that the driver is not busy, but
> unable to transmit due to resource constraints.  This signals the qdisc layer to
> skip trying to drain this transmit queue for a short period of time, with
> subsequent simmilar errors causing increased backoff.  Once the condition is
> cleared, the backoff delay is removed and operation returns to normal.

Loos like this is a more general issue which should be solved for every
spinlock:

http://thread.gmane.org/gmane.linux.kernel/1437186

  parent reply	other threads:[~2014-05-21 18:05 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-05 18:51 [PATCH] jme: Fix DMA unmap warning Neil Horman
2014-05-06 20:25 ` Govindarajulu Varadarajan
2014-05-06 20:50   ` Neil Horman
2014-05-06 20:53     ` David Miller
2014-05-06 21:04       ` Govindarajulu Varadarajan
2014-05-06 21:10         ` David Miller
2014-05-07 19:56 ` David Miller
2014-05-07 20:33   ` Neil Horman
2014-05-07 20:44     ` David Miller
2014-05-07 21:54       ` Neil Horman
2014-05-08  9:02     ` David Laight
2014-05-08 11:00       ` Neil Horman
2014-05-08 11:16         ` David Laight
2014-05-08 17:24       ` David Miller
2014-05-08 19:29   ` [RFC PATCH] net: Provide linear backoff mechanism for constrained resources at the driver Neil Horman
2014-05-09  8:55     ` David Laight
2014-05-09 11:17       ` Neil Horman
2014-05-09 12:53         ` David Laight
2014-05-09 15:33           ` Neil Horman
2014-05-09 15:46             ` David Laight
2014-05-09 17:02               ` Neil Horman
2014-05-18 16:19     ` Neil Horman
2014-05-21 18:05     ` Cong Wang [this message]
2014-05-21 18:49       ` Neil Horman
2014-05-11 12:49 ` [PATCH] jme: Fix DMA unmap warning Ben Hutchings
2014-05-11 13:04   ` Neil Horman

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=CAHA+R7Ox+6f2Kd9ZyHLez_7rDrQs1vHEZnsoarhYhd9QRVumJw@mail.gmail.com \
    --to=cwang@twopensource.com \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    --cc=nhorman@tuxdriver.com \
    /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).