From: Neil Turton <nturton@solarflare.com>
To: BVK Chaitanya <bayapuneni_chaitanya@symantec.com>
Cc: Xen-devel@lists.xensource.com
Subject: Re: On netfront accelerator add/remove watches
Date: Tue, 29 Jul 2008 12:09:04 +0100 [thread overview]
Message-ID: <488EFA50.1070708@solarflare.com> (raw)
In-Reply-To: <488E8F39.4020406@symantec.com>
Hi,
BVK Chaitanya wrote:
> I see that netfront_accel_add_watch and netfront_accel_remove_watch
> functions are _not_ protected by accelerator_mutex in accel.c Is there
> any specific reason for this?
Yes. These functions need to be synchronised by the callers. Adding a
mutex here would ensure that they didn't execute at the same time, but
wouldn't impose any order on the calls. This matters because add
followed by remove is different from remove followed by add. The
callers need to decide which order they should be executed in.
The relevant call chains are as follows:
xenbus otherend_changed callback
-> backend_changed [netfront.c]
-> network_connect
-> talk_to_backend
-> netfront_accelerator_add_watch
xenbus suspend_cancel callback
-> netfront_suspend_cancel
-> netfront_accelerator_suspend_cancel
-> netfront_accelerator_add_watch
xenbus suspend callback
-> netfront_suspend
-> netfront_accelerator_suspend
-> netfront_accelerator_remove_watch
xenbus remove callback
-> netfront_remove
-> netfront_accelerator_call_remove
-> netfront_accelerator_remove_watch
So the watch is only added/removed from a xenbus callback. I think
these callbacks should be synchronised by xenbus. Can someone confirm that?
> I see that they sometimes get called twice (and result in BUG_ON) in
> very fast (20ms) domain suspend-resume cycles and I couldn't figure out
> how it is possible :-(
Is that the BUG_ON in netfront_accelerator_add_watch? One possible
explanation is that suspend_cancel is called and then otherend_changed
is called. Can you add a printk to netfront_suspend_cancel to see if it
gets called just before the BUG_ON gets triggered?
Cheers, Neil.
next prev parent reply other threads:[~2008-07-29 11:09 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-07-29 3:32 On netfront accelerator add/remove watches BVK Chaitanya
2008-07-29 11:09 ` Neil Turton [this message]
2008-07-30 4:58 ` BVK Chaitanya
2008-07-30 15:17 ` Kieran Mansley
2008-07-31 12:44 ` BVK Chaitanya
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=488EFA50.1070708@solarflare.com \
--to=nturton@solarflare.com \
--cc=Xen-devel@lists.xensource.com \
--cc=bayapuneni_chaitanya@symantec.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 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.