[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] cpupools and locking


  • To: George Dunlap <George.Dunlap@xxxxxxxxxxxxx>, Keir Fraser <Keir.Fraser@xxxxxxxxxxxxx>
  • From: Juergen Gross <juergen.gross@xxxxxxxxxxxxxx>
  • Date: Wed, 05 May 2010 07:25:51 +0200
  • Cc: xen-devel@xxxxxxxxxxxxxxxxxxx
  • Delivery-date: Tue, 04 May 2010 22:26:40 -0700
  • Domainkey-signature: s=s1536a; d=ts.fujitsu.com; c=nofws; q=dns; h=X-SBRSScore:X-IronPort-AV:Received:X-IronPort-AV: Received:Received:Message-ID:Date:From:Organization: User-Agent:MIME-Version:To:CC:Subject:References: In-Reply-To:Content-Type:Content-Transfer-Encoding; b=BXfHRvb/6WUEYZpfjIU35dOnfdcJd3F0yIhFsQ2/peu8X08LFeuvG8DJ yKQCN5l+RqDPn8G4uaKNwVr+jsnDV5QgkWK1swBSh/VYFRb4FofYsll04 gyDT/iZPHMHP1hhkvsPkFtM3ZVpgFYEoQJ+HoIhd/OTMjvbXaW1Cl1yzL tdKIZ/Dpjs/9s5scVFqDk+uzEZXhWU6j1lAeeCsbPhVgZ3dwNe7EEwXvj 4hyAYUhvb/GLq7cE8ilw+CBdLtzaR;
  • List-id: Xen developer discussion <xen-devel.lists.xensource.com>

On 05/04/2010 08:51 PM, George Dunlap wrote:
Something seems not quite right about the cpupool locking... in
xen/common/cpupool.c:cpupool_do_domctl(), the cpupool_lock is only
held during the find for several operations.  Doesn't that mean that,
for instance, it's possible for someone to call CPUPOOL_OP_DESTROY,
while someone concurrently calls CPUPOOL_OP_INFO, such that in the
INFO case, the find succeeds, but the structure is shortly thereafter
freed by DESTROY, even though INFO code still has a pointer to it
which may be dereferenced?  I don't see any reference counting... am I
missing something?

cpupool_do_domctl is called always while the domctl lock is being held. Maybe
I should have added a comment to document this assumption.

Keir's patch to move the cpupool commands to the sysctl interface makes a
change of the locking mandatory. I'll setup a patch for this.


Juergen

--
Juergen Gross                 Principal Developer Operating Systems
TSP ES&S SWE OS6                       Telephone: +49 (0) 89 3222 2967
Fujitsu Technology Solutions              e-mail: juergen.gross@xxxxxxxxxxxxxx
Domagkstr. 28                           Internet: ts.fujitsu.com
D-80807 Muenchen                 Company details: ts.fujitsu.com/imprint.html

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.