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] big local array in routine in hypervisor

To: Keir Fraser <keir.fraser@xxxxxxxxxxxxx>, "Xen-Devel (E-mail)" <xen-devel@xxxxxxxxxxxxxxxxxxx>, George Dunlap <George.Dunlap@xxxxxxxxxxxxx>
Subject: RE: [Xen-devel] big local array in routine in hypervisor
From: Dan Magenheimer <dan.magenheimer@xxxxxxxxxx>
Date: Tue, 27 Jan 2009 14:47:18 +0000 (GMT)
Cc:
Delivery-date: Tue, 27 Jan 2009 06:48:13 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <C5A47D26.21DBA%keir.fraser@xxxxxxxxxxxxx>
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/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
> Does it *really* have to be multi-page contiguous? You 
> couldn't for example
> build your workspace out of a radix tree with page-sized leaves?
> Or are you saying that maybe you can't allocate even a single 
> page, or a
> sub-page? In that case it would seem memory is so tight you 
> have little
> choice but to pre-reserve.

I'm trying to use the lzo compression code now in Linux
(as of 2.6.27 I think) in linux/lib/lzo.  It uses a large
static work area... which now that I look more carefully
is actually 128kB!...  apparently ffs2 (its sole user in
Linux as of now) doesn't care about SMP?

> So you want us to wastefully pre-reserve some space for you, 
> but call it the
> 'stack' to assuage your guilt? ;-)

Point taken ;-)  But the stack can be used by others and
my pre-reserved space could not.

> It's common practice not to have very
> large stacks in kernels, since pre-reservation is wateful, 
> dynamic growth is not necessarily feasible to implement,
> and kernel code doesn't tend to need lots of local storage
> or recursion. In Linux you'd be limited to 4kB, and
> there's a lot more code there living under that stricter regime.

True, but the history of most kernels goes back a bit farther
than Xen's, back when memory density and cost was a factor
of 1000x different.  So... 4kb * 1000 is 4M ;-)

> It's a slippery slope though, determining how much stack is 
> enough and how
> big a local array is too big. I generally end up having to 
> check and fix big
> stack frames from time to time, and I'm not sure that even 
> doubling the
> stack a few times would avoid that job!

Agreed.  It will never be enough.

I'll live with the private static array for now.

Dan

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