WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: [Xen-devel] [PATCH-REWORKED] Added xen_is_contiguous_region

To: "Keir Fraser" <Keir.Fraser@xxxxxxxxxxxx>
Subject: Re: [Xen-devel] [PATCH-REWORKED] Added xen_is_contiguous_region
From: "Jambunathan K" <kjambunathan@xxxxxxxxx>
Date: Sat, 14 Apr 2007 10:26:54 +0530
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx
Delivery-date: Fri, 13 Apr 2007 21:55:31 -0700
Dkim-signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=PUI0h69cst0qXZJTT4T8AsHg9Z/RO6nhAqkulzoiVzo2BRYWnOtBM6GgbstqnoXKe48PIH9SveFD5KGa/oybWsI/sRy4gU2t5v9EP1Pa+3hyEysqHWosnslmg2z6341KE8DLEjouYFwjcy+W1+/Z0bkPnFXqhf2WhLPwSYSBD5Y=
Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=dNMXfrVPQ0WBxwW282ThOTmt24TyFkxTgcmHyHUrQwLcu+ZrKJemFcEkXm7IJtUulvne83b62H0MoOrNogDU2b91a1Q8Fkdro9I/CEQgbDz+0/RvTTBpnLW+H1so+eSNnWbQkB9ttVOZf954qlPm6n0gpUShFdQwan+MRoB8OSE=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <C245B23F.5D72%Keir.Fraser@xxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <b8e946230704131256o40517ff4g70e57aafe1898ba3@xxxxxxxxxxxxxx> <C245B23F.5D72%Keir.Fraser@xxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
 You can check whether a memory region straddles a page boundary yourself
without needing an external helper function. Also you should have a pretty
good idea whether a piece of memory you allocated will pass the
contiguous_bitmap test:

Agreed.

But I had seen a crash in DomU (with no swiotlb) when we try to pci_map_single
a alloc_skb buffer.

In Xen-3.0.4, alloc_skb in all probability allocs a contig buffer but
it wouldn't
guarantee me the same. With Xen-3.0.5, with bit-width based allocator
we are much
more likely to succeed compared to system-wide functions that cater to least
common denominator.

But anyway — I thought the issue was your DMA limit of 32GB? Why should
page-straddling buffers be a problem at all: your hardware probably supports
scatter-gather DMA, right?

We don't do scatter-gather DMA as yet.

Jambunathan K.

On 4/14/07, Keir Fraser <Keir.Fraser@xxxxxxxxxxxx> wrote:

 On 13/4/07 20:56, "Jambunathan K" <kjambunathan@xxxxxxxxx> wrote:


Using the new xen_is_contiguous_region() would enable our driver to fall back 
upon it's own pool.

 This is my first patch to Xen. If you approve of the patch, I will resubmit 
the changes as required by you.

 You can check whether a memory region straddles a page boundary yourself 
without needing an external helper function. Also you should have a pretty good 
idea whether a piece of memory you allocated will pass the contiguous_bitmap 
test: if you called pci_alloc_consistent(), or xen_create_contiguous_region(), 
then it will; if you simply kmalloc()ed or get_free_pages()ed a region then it 
will not. If you are getting buffers passed to you from elsewhere in the 
kernel, I guess it depends what kind of device you're talking about, but it's 
pretty likely to be the case that if you are passed page-straddling buffers 
that you are going to need to use a bounce buffer.

 But anyway — I thought the issue was your DMA limit of 32GB? Why should 
page-straddling buffers be a problem at all: your hardware probably supports 
scatter-gather DMA, right?

  -- Keir


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