>>> On 13.10.15 at 16:29, <quan...@intel.com> wrote: >> > >>>On 29.09.2015 at 15:22 <jbeul...@suse.com> wrote: >> >>> On 29.09.15 at 04:53, <quan...@intel.com> wrote: >> >>>> Monday, September 28, 2015 2:47 PM,<jbeul...@suse.com> wrote: >> >> >>> On 28.09.15 at 05:08, <quan...@intel.com> wrote: >> >> >>>> Thursday, September 24, 2015 12:27 AM, Tim Deegan wrote: >>The extra ref taken will prevent the page from getting freed. > > Jan, could you share more about it? > > I want to check some cases of Xen memory. i.e. > > 1. if (page->count_info & PGC_count_mask == 0) and (page->count_info != 0) > In this case, can the page be freed to xen domain heap?
Whether a page can get freed depends on changes to count_info, not just its current state. For instance, PGC_allocated set implies page->count_info & PGC_count_mask != 0, i.e. your question above cannot be answered properly. Just look at put_page() - it frees the page when the count _drops_ to zero. > 2. if (page->count_info & PGC_count_mask == 0) and (page->u.inuse.type_info > != 0) : > In this case, can the page be freed to xen domain heap? Generally type_info should be zero when the ref count is zero; there are, I think, exceptional cases (like during domain death) where this might get violated with no harm. But again - look at put_page() and you'll see that type_info doesn't matter for whether a page gets freed; all it matter is whether a page's type can change: Only when type count is zero. Jan _______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel