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/
Home Products Support Community News


[Xen-devel] a question about count_info

To: "xen-devel" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] a question about count_info
From: "strongerwill" <strongerwill@xxxxxxxxx>
Date: Thu, 5 Aug 2010 13:39:52 +0800
Delivery-date: Wed, 04 Aug 2010 22:40:45 -0700
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:to:subject :message-id:x-mailer:mime-version:content-type; bh=xVFcvbNuC8HbfZcR+NqpCbFdjcZEQkokSfUITnsBXxo=; b=OqumdB22k+896/JoB9DG3oeiU0jAL78qgPBm/SrO6gg+wWXlu2j2oXsRvqUphjmJIV lprTrn3G8lW5eedts7xB3VMs6rlKiPav0RrAdIdsFqHDprKweuiJaNejzwa6zsW0DU3U QcbY4gSl34HTAfbTGjOaNvKq7nDsdZjAfUi+U=
Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:subject:message-id:x-mailer:mime-version:content-type; b=WZLGqFiR0oGv5ynOkn54/DKSlNfLj4KOnie3H7xn3RKs4Kr3CkUVNBWQGjqqZ6R3JJ DkdW9WV2KqpZluPczTEK4eCf1uscHKL0TuuFrEgVZf0RJWtejIa1s2bE7tKlIJ0i3LPy LRcqK5LMCYiCk0vXaIv2uUblT8WP96QByYEIM=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
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
Hi guys:
   I am working on Xen 4.0.0. In my project, I need to know the reference number of a paticular page. But I found the result do not match what I think. I need your help.
For example, I allocate a buffer in kernel (dom0)
char * buf = kmalloc( 4096, ...);
Then I use my designed hypercall to read the count_info like this way:
// add is the location of the buffer
l1_pgentry_t nl1e = guest_map_l1e(current, add, &tmp);
                unsigned long pfn = 0, mfn = 0;
                p2m_type_t p2mt = 0;
                struct page_info *page = NULL;
                pfn = l1e_get_pfn(nl1e);
                mfn = mfn_x( gfn_to_mfn( current->domain, pfn, &p2mt ) );
                debug_trace(printk("pfn %lx, mfn %lx, p2mt %x nl1e.l1 %llx\n", pfn, mfn, p2mt, nl1e.l1));
// here I check the validation of mfn, then try to get page
                page = mfn_to_page(mfn);
                debug_trace(printk("page count %lx, marked count %lx, page typeinfo %lx\n",
                        page->count_info, page->count_info & PGC_count_mask, page->u.inuse.type_info));
the output likes this:
pfn 5a4d0, mfn 5a4d0, p2mt 1  nl1e.l1 800000005a4d0063 
page count 80000002, marked count 2, page typeinfo 74000001
When I allocate memory using vmalloc
the output likes this:
pfn 351ed, mfn 351ed, p2mt 1 nl1e.l1 80000000351ed063
page count 80000003, marked count 3, page typeinfo 74000002
previously I think the referece number (count_info) of  these new allocated buffers should be "1". Now the output confuses me. Any one can explain this?
Thanks very much

Xen-devel mailing list
<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] a question about count_info, strongerwill <=