Skip to contentSkip to conversation

Questions about memory zone

DISCUSSION ruby young 2 participants 2 messages May 5, 2009

lore
Share & tools
lore

ruby young

author
#0 lore raw

Hi, all~
I'm interested in memory of xen. And I wondered what does the real mean of xen 'zone'. It seems different from linux 'zone'.
In the source code of xen-3.3.0/xen/common/page_alloc.c, there is defined:
#define pfn_dom_zone_type(_pfn) (fls(_pfn)-1)

and NR_ZONES is defined:
#define NR_ZONES (PADDR_BITS - PAGE_SHIFT)

It seems Zone in xen set up as physic address and are separate by the last pfn bit set.
But Why does Xen Zone organize like this? And What does the Zone mean?

Best Wishes!

Ruby Young

Signature · 15 lines
Best wishes

杨漾
北京航空航天大学计算机学院体系结构研究所
电话:010-82338059-132
邮件:[email protected]
地址:北京市海淀区学院路37号北京航空航天大学新主楼 G座1026
--------------------------------------------------------------------------------
Yang Yang
Institute of Computer Architecture and System
BeiHang University(BUAA)
Tel: (86-10)82338059-132
Email: [email protected]
Addr: Room 1026,Building G,The New Main Building,37# Xueyuan Rd.,Haidian
District, Beijing 100083, PRC

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

#1 lore raw
Quoted 7 lines
Quoted 1 line
Quoted 1 line

ruby young <[email protected]> 05.05.09 10:05 >>>

Hi, all~
I'm interested in memory of xen. And I wondered what does the real mean of xen 'zone'. It seems different from linux 'zone'.
In the source code of xen-3.3.0/xen/common/page_alloc.c, there is defined:
#define pfn_dom_zone_type(_pfn) (fls(_pfn)-1)

Quoted 5 lines

and NR_ZONES is defined:
#define NR_ZONES (PADDR_BITS - PAGE_SHIFT)

It seems Zone in xen set up as physic address and are separate by the last pfn bit set.

Correct.

Quoted 1 line

But Why does Xen Zone organize like this? And What does the Zone mean?

In order to be able to allocate memory based on address width restrictions, without adding overhead on sorting memory as it gets (or after it got) freed.

Jan