netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jan-Bernd Themann <ossthema@de.ibm.com>
To: Krishna Kumar <krkumar2@in.ibm.com>
Cc: davem@davemloft.net, netdev@vger.kernel.org, rdreier@cisco.com,
	general@lists.openfabrics.org,
	Christoph Raisch <raisch@de.ibm.com>
Subject: Re: [Bug, PATCH and another Bug] Was: Fix refcounting problem with netif_rx_reschedule()
Date: Wed, 19 Sep 2007 15:23:48 +0200	[thread overview]
Message-ID: <200709191523.48874.ossthema@de.ibm.com> (raw)
In-Reply-To: <20070919115403.19455.65941.sendpatchset@K50wks273871wss.in.ibm.com>

Hi,

On Wednesday 19 September 2007 13:54, Krishna Kumar wrote:
> CPU#1: ipoib_poll(budget=100)
> {
> 	A. process 100 skbs
> 	B. netif_rx_complete()
> 	<Process unrelated interrupts; executes slower than steps C, D, E on
> 	 CPU#2>
> 	F. ib_req_notify_cq() (no missed completions, do nothing)
> 	G. return 100
> 	H. return to net_rx_action, quota=99, subtract 100, quota=-1, BUG.
> }
> 
> CPU#2: ipoib_ib_completion() : (starts and finishes entire line of execution
> 				*after* step B and *before* H executes).
> {
> 	C. New skb comes, call netif_rx_schedule; set quota=100
> 	D. do ipoib_poll(), process one skb, return work=1 to net_rx_action
> 	E. net_rx_action: set quota=99
> }

If I understood it right the problem you describe (quota update in 
__napi_schdule) can cause further problems when you choose the
following numbers:

CPU1: A. process 99 pkts
CPU1: B. netif_rx_complete()
CPU2: interrupt occures, netif_rx_schedule is called, net_rx_action triggerd:
CPU2: C. set quota = 100 (__napi_schedule)
CPU2: D. call poll(), process 1 pkt
CPU2: D.2 call netif_rx_complete() (quota not exeeded)
CPU2: E. net_rx_action: set quota=99
CPU1: F. net_rx_action: set qutoa=99 - 99 = 0
CPU1: G. modify list (list_move_tail) altough netif_rx_complete has been called

Step G would fail as the device is not in the list due 
to netif_rx_complete. This case can occur for all
devices running on an SMP system where interrupts are not pinned.

Regards,
Jan-Bernd


  reply	other threads:[~2007-09-19 13:23 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-09-19 11:54 [Bug, PATCH and another Bug] Was: Fix refcounting problem with netif_rx_reschedule() Krishna Kumar
2007-09-19 13:23 ` Jan-Bernd Themann [this message]
2007-09-20  5:10   ` Krishna Kumar2
2007-09-20  5:12     ` David Miller
2007-09-20  5:54       ` [ofa-general] " Krishna Kumar2
2007-09-20 18:12         ` David Miller
2007-09-19 16:05 ` David Miller
2007-09-20  5:18   ` Krishna Kumar2
2007-09-20 18:12     ` [ofa-general] " David Miller

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=200709191523.48874.ossthema@de.ibm.com \
    --to=ossthema@de.ibm.com \
    --cc=davem@davemloft.net \
    --cc=general@lists.openfabrics.org \
    --cc=krkumar2@in.ibm.com \
    --cc=netdev@vger.kernel.org \
    --cc=raisch@de.ibm.com \
    --cc=rdreier@cisco.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).