All of lore.kernel.org
 help / color / mirror / Atom feed
* Question about locks in qdisc_restart
@ 2009-04-27 19:48 Tom Herbert
  2009-04-27 20:20 ` Eric Dumazet
  0 siblings, 1 reply; 2+ messages in thread
From: Tom Herbert @ 2009-04-27 19:48 UTC (permalink / raw)
  To: netdev

In qdisc_restart the qdisc lock is released before taking the
netif_tx_lock, and only acquired again after unlocking the
netif_tx_lock.  There's a comment with the function that
"qdisc_lock(q) and netif_tx_lock are mutually exclusive, if one is
grabbed, another must be free."  Can anyone tell me the motivation for
this restriction?  We are seeing some performance improvements by
holding the lock through qdisc_restart, and I'm not sure why this
would be bad to do.

Thanks,
Tom

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Question about locks in qdisc_restart
  2009-04-27 19:48 Question about locks in qdisc_restart Tom Herbert
@ 2009-04-27 20:20 ` Eric Dumazet
  0 siblings, 0 replies; 2+ messages in thread
From: Eric Dumazet @ 2009-04-27 20:20 UTC (permalink / raw)
  To: Tom Herbert; +Cc: netdev

Tom Herbert a écrit :
> In qdisc_restart the qdisc lock is released before taking the
> netif_tx_lock, and only acquired again after unlocking the
> netif_tx_lock.  There's a comment with the function that
> "qdisc_lock(q) and netif_tx_lock are mutually exclusive, if one is
> grabbed, another must be free."  Can anyone tell me the motivation for
> this restriction?  We are seeing some performance improvements by
> holding the lock through qdisc_restart, and I'm not sure why this
> would be bad to do.
> 

Well, motivation is to let other users (cpus) have a chance getting the lock :)

Do you see performance improvements too if using spin_is_contended()
to break the __qdisc_run loop ?

if (need_resched() || jiffies != start_time || spin_is_contended(qdisc_lock(q))

(And removing the unlock/lock in qdisc_restart() as you did)


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-04-27 20:20 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-04-27 19:48 Question about locks in qdisc_restart Tom Herbert
2009-04-27 20:20 ` Eric Dumazet

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.