From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Jan Beulich" Subject: Re: non-contiguous allocations Date: Fri, 06 May 2011 11:45:10 +0100 Message-ID: <4DC3ED560200007800040020@vpn.id2.novell.com> References: <3e95e737bc51c2295926.1301508274@localhost> <1301656691.9447.88.camel@elijah> <20110418184541.GA16935@aepfle.de> <4DB6CDE3020000780003E29C@vpn.id2.novell.com> <20110506102557.GA16863@aepfle.de> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Return-path: In-Reply-To: <20110506102557.GA16863@aepfle.de> Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Olaf Hering Cc: "xen-devel@lists.xensource.com" , George Dunlap List-Id: xen-devel@lists.xenproject.org >>> On 06.05.11 at 12:25, Olaf Hering wrote: > On Tue, Apr 26, Jan Beulich wrote: >=20 >> >>> On 18.04.11 at 20:45, Olaf Hering wrote: >> > On Fri, Apr 01, George Dunlap wrote: >> >=20 >> >> On Wed, 2011-03-30 at 19:04 +0100, Olaf Hering wrote: >> >> > Using the u16 means each cpu could in theory use up to 256MB as = trace >> >> > buffer. However such a large allocation will currently fail on x86 = due >> >> > to the MAX_ORDER limit. >> >>=20 >> >> FWIW, I don't believe that there's any reason the allocations have = to be >> >> contiguous any more. I kept them contiguous to minimize the changes = to >> >> the moving parts near a release. But the new system has been pretty >> >> well tested now, so I think looking at non-contiguous allocations = may be >> >> worthwhile. >> >=20 >> > how do I allocate a few mfns and give them a virtual address? >> > I dont find a malloc like interface to allocate random pages. >=20 >> Otherwise I think the only option is to introduce indirection (using >> the 1:1 mapping, and setting up an array of pointers). That may >> however be a little difficult if (and I think that's the case) data >> chunks aren't always of the same size (as then you need to deal >> with the roll-over into the next page). >=20 > I'm almost done with the per-page handling in __insert_record(). > I just need to figure out the a usable address of a given mfn. > Is the u8 *p =3D mfn_to_virt(mfn) the same as page_to_virt(mfn_to_page(mf= n))? Yes. Jan >=20 > Olaf