From: Steven Smith Subject: Minor synchronisation quibble in scsifront Date: Thu, 10 Jul 2008 16:26:56 +0100 Message-ID: <20080710152656.GB11952@weybridge.uk.xensource.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1753669457==" Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: kama@jp.fujitsu.com Cc: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org --===============1753669457== Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="uZ3hkaAS1mZxFaxD" Content-Disposition: inline --uZ3hkaAS1mZxFaxD Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable I've been having a look through scsifront again, and I saw this bit: ring_req->timeout_per_command =3D (sc->timeout_per_command / HZ); ring_req->nr_segments =3D 0; spin_unlock_irq(host->host_lock); scsifront_do_request(info);=09 wait_event_interruptible(info->shadow[ring_req->rqid].wq_reset, info->shadow[ring_req->rqid].wait_reset); in scsifront_dev_reset_handler(). Looking at scsifront_do_request(): static void scsifront_do_request(struct vscsifrnt_info *info) { struct vscsiif_front_ring *ring =3D &(info->ring); unsigned int irq =3D info->irq; int notify; RING_PUSH_REQUESTS_AND_CHECK_NOTIFY(ring, notify); if (notify) notify_remote_via_irq(irq); } scsifront_do_request() is also called from scsifront_queuecommand(), where it's under the host lock. I can't see any other relevant synchronisation, so I think that you might be able to end up with several processors pushing requests at the same time. I'm not sure what'll happen then, but I doubt it's a good idea. The issue could be avoided if you just swapped two lines in scsifront_dev_reset_handler(): ring_req->timeout_per_command =3D (sc->timeout_per_command / HZ); ring_req->nr_segments =3D 0; scsifront_do_request(info);=09 spin_unlock_irq(host->host_lock); wait_event_interruptible(info->shadow[ring_req->rqid].wq_reset, info->shadow[ring_req->rqid].wait_reset); Does that sound sane? On the plus side, that's the only strange bit I could see in current scsifront. :) Steven. --uZ3hkaAS1mZxFaxD Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) iD8DBQFIdipASSW8CTLdF2kRAs0EAJ9960AW1+/MDEM9WsTZhA8g+r3wggCeJhhp DZZCmNecqXeaJgsp55si4ZQ= =QsBs -----END PGP SIGNATURE----- --uZ3hkaAS1mZxFaxD-- --===============1753669457== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --===============1753669457==--