Displaying 20 results from an estimated 31 matches for "set_page_count".
2020 Sep 17
1
[PATCH] mm: remove extra ZONE_DEVICE struct page refcount
...t; something that is not system memory. For both the ppc kvm case (magic
> hypervisor pool) and Noveau (device internal) memory that clear is the
> case. But looks like test_hmm uses normal pages to fake this up, so
> I was wrong about the third caller. But I think we can just call
> set_page_count just before freeing the page there with a comment
> explaining what is goin on.
Dan Williams thought that having the ZONE_DEVICE struct pages
be on a free list with a refcount of one was a bit strange and
that the driver should handle the zero to one transition.
But, that would mean a bit more...
2020 Sep 15
2
[PATCH] mm: remove extra ZONE_DEVICE struct page refcount
...5/20 9:29 AM, Christoph Hellwig wrote:
> On Mon, Sep 14, 2020 at 04:53:25PM -0700, Ralph Campbell wrote:
>> Since set_page_refcounted() is defined in mm_interal.h I would have to
>> move the definition to someplace like page_ref.h or have the drivers
>> cal init_page_count() or set_page_count() since get_page() calls
>> VM_BUG_ON_PAGE() if refcount == 0.
>> I'll move set_page_refcounted() since that is what the page allocator
>> uses and seems named for the purpose.
>
> I don't think any of the three ->page_free instances even cares about
> the pag...
2020 Sep 14
2
[PATCH] mm: remove extra ZONE_DEVICE struct page refcount
...zero to the wider kernel but expect that drivers
> get a fake reference on entry to their ->page_free() callbacks.
Good point.
Since set_page_refcounted() is defined in mm_interal.h I would have to
move the definition to someplace like page_ref.h or have the drivers
cal init_page_count() or set_page_count() since get_page() calls
VM_BUG_ON_PAGE() if refcount == 0.
I'll move set_page_refcounted() since that is what the page allocator
uses and seems named for the purpose.
2006 Jun 08
5
balloon question
Running with Xen option dom0_mem=6G and kernel option mem=8G, I would have expected that I would see the system with a
2G balloon right after boot. However, the balloon is empty. Briefly looking at this, it would seem to me that, with all
pages being reserved when the system starts and only the populated ones getting the reserved status cleared in
__free_pages_bootmem(), the condition to put pages
2020 Oct 08
2
[PATCH] mm: make device private reference counts zero based
...@@ int kvmppc_uvmem_init(void)
goto out_unmap;
}
+ /*
+ * Pages are created with an initial reference count of one but should
+ * have a reference count of zero while in the free state.
+ */
+ for (pfn = pfn_first; pfn < pfn_last; pfn++) {
+ struct page *dpage = pfn_to_page(pfn);
+
+ set_page_count(dpage, 0);
+ }
+
pr_info("KVMPPC-UVMEM: Secure Memory size 0x%lx\n", size);
return ret;
out_unmap:
diff --git a/drivers/gpu/drm/nouveau/nouveau_dmem.c b/drivers/gpu/drm/nouveau/nouveau_dmem.c
index 92987daa5e17..8bc7120e1216 100644
--- a/drivers/gpu/drm/nouveau/nouveau_dmem.c
+++ b/d...
2007 Jan 10
1
[PATCH] linux/i386: allow CONFIG_HIGHPTE on i386 (take 2)
...kmap_flush_unused();
+ op.cmd = MMUEXT_PIN_L1_TABLE;
+ op.arg1.mfn = pfn_to_mfn(page_to_pfn(pte));
+ BUG_ON(HYPERVISOR_mmuext_op(&op, 1, NULL, DOMID_SELF) < 0);
+ }
#else
pte = alloc_pages(GFP_KERNEL|__GFP_REPEAT|__GFP_ZERO, 0);
+#endif
if (pte) {
SetPageForeign(pte, pte_free);
set_page_count(pte, 1);
}
-#endif
return pte;
}
void pte_free(struct page *pte)
{
- unsigned long va = (unsigned long)__va(page_to_pfn(pte)<<PAGE_SHIFT);
+ unsigned long pfn = page_to_pfn(pte);
- if (!pte_write(*virt_to_ptep(va)))
- BUG_ON(HYPERVISOR_update_va_mapping(
- va, pfn_pte(page_to_pf...
2019 Oct 23
2
[PATCH RFC v3 6/9] mm: Allow to offline PageOffline() pages with a reference count of 0
...gain the reference back to balance the
> >>> MEM_GOING_OFFLINE step.
> >>
> >> The pages are already unisolated and could be used by the buddy. But again,
> >> I think you have an idea that tries to avoid putting pages to the buddy.
> >
> > Yeah, set_page_count(page, 0) if you do not want to release that page
> > from the notifier context to reflect that the page is ok to be offlined
> > with the rest.
> >
>
> I neither see how you deal with __test_page_isolated_in_pageblock() nor with
> __offline_isolated_pages(). Sorry, bu...
2019 Oct 22
2
[PATCH RFC v3 6/9] mm: Allow to offline PageOffline() pages with a reference count of 0
...EM_GOING_OFFLINE.
> > MEM_CANCEL_OFFLINE could gain the reference back to balance the
> > MEM_GOING_OFFLINE step.
>
> The pages are already unisolated and could be used by the buddy. But again,
> I think you have an idea that tries to avoid putting pages to the buddy.
Yeah, set_page_count(page, 0) if you do not want to release that page
from the notifier context to reflect that the page is ok to be offlined
with the rest.
[...]
> > explicit control via the reference count which is the standard way to
> > control the struct page life cycle.
> >
> > Anyway...
2019 Oct 23
2
[PATCH RFC v3 6/9] mm: Allow to offline PageOffline() pages with a reference count of 0
...gain the reference back to balance the
> >>> MEM_GOING_OFFLINE step.
> >>
> >> The pages are already unisolated and could be used by the buddy. But again,
> >> I think you have an idea that tries to avoid putting pages to the buddy.
> >
> > Yeah, set_page_count(page, 0) if you do not want to release that page
> > from the notifier context to reflect that the page is ok to be offlined
> > with the rest.
> >
>
> I neither see how you deal with __test_page_isolated_in_pageblock() nor with
> __offline_isolated_pages(). Sorry, bu...
2019 Oct 22
2
[PATCH RFC v3 6/9] mm: Allow to offline PageOffline() pages with a reference count of 0
...EM_GOING_OFFLINE.
> > MEM_CANCEL_OFFLINE could gain the reference back to balance the
> > MEM_GOING_OFFLINE step.
>
> The pages are already unisolated and could be used by the buddy. But again,
> I think you have an idea that tries to avoid putting pages to the buddy.
Yeah, set_page_count(page, 0) if you do not want to release that page
from the notifier context to reflect that the page is ok to be offlined
with the rest.
[...]
> > explicit control via the reference count which is the standard way to
> > control the struct page life cycle.
> >
> > Anyway...
2020 Sep 15
0
[PATCH] mm: remove extra ZONE_DEVICE struct page refcount
On Mon, Sep 14, 2020 at 04:53:25PM -0700, Ralph Campbell wrote:
> Since set_page_refcounted() is defined in mm_interal.h I would have to
> move the definition to someplace like page_ref.h or have the drivers
> cal init_page_count() or set_page_count() since get_page() calls
> VM_BUG_ON_PAGE() if refcount == 0.
> I'll move set_page_refcounted() since that is what the page allocator
> uses and seems named for the purpose.
I don't think any of the three ->page_free instances even cares about
the page refcount.
2020 Sep 16
0
[PATCH] mm: remove extra ZONE_DEVICE struct page refcount
...have a struct page for
something that is not system memory. For both the ppc kvm case (magic
hypervisor pool) and Noveau (device internal) memory that clear is the
case. But looks like test_hmm uses normal pages to fake this up, so
I was wrong about the third caller. But I think we can just call
set_page_count just before freeing the page there with a comment
explaining what is goin on.
2020 Oct 09
0
[PATCH] mm: make device private reference counts zero based
...s are created with an initial reference count of one but should
> + * have a reference count of zero while in the free state.
> + */
> spin_lock(&mdevice->lock);
> for (pfn = pfn_first; pfn < pfn_last; pfn++) {
> struct page *page = pfn_to_page(pfn);
>
> + set_page_count(page, 0);
This confuses me. How does this and init_page_count() not confuse the buddy
allocator? Don't you have to reset the refcount somewhere after the test?
> page->zone_device_data = mdevice->free_pages;
> mdevice->free_pages = page;
> }
> @@ -561,7 +566,7 @...
2020 Oct 12
2
[PATCH v2] mm/hmm: make device private reference counts zero based
...@@ int kvmppc_uvmem_init(void)
goto out_unmap;
}
+ /*
+ * Pages are created with an initial reference count of one but should
+ * have a reference count of zero while in the free state.
+ */
+ for (pfn = pfn_first; pfn < pfn_last; pfn++) {
+ struct page *dpage = pfn_to_page(pfn);
+
+ set_page_count(dpage, 0);
+ }
+
pr_info("KVMPPC-UVMEM: Secure Memory size 0x%lx\n", size);
return ret;
out_unmap:
diff --git a/drivers/gpu/drm/nouveau/nouveau_dmem.c b/drivers/gpu/drm/nouveau/nouveau_dmem.c
index 92987daa5e17..8bc7120e1216 100644
--- a/drivers/gpu/drm/nouveau/nouveau_dmem.c
+++ b/d...
2007 Apr 28
4
confused about the balloon code
hi
I try to understand the code of balloon ,and got confused about the
following parts of code:
static int decrease_reservation(unsigned long nr_pages)
{
....
if (!PageHighMem(page)) {
v = phys_to_virt(pfn << PAGE_SHIFT);
scrub_pages(v, 1);
ret = HYPERVISOR_update_va_mapping(
(unsigned long)v, __pte_ma(0), 0);
2019 Oct 23
0
[PATCH RFC v3 6/9] mm: Allow to offline PageOffline() pages with a reference count of 0
...ce back to balance the
>>>>> MEM_GOING_OFFLINE step.
>>>>
>>>> The pages are already unisolated and could be used by the buddy. But again,
>>>> I think you have an idea that tries to avoid putting pages to the buddy.
>>>
>>> Yeah, set_page_count(page, 0) if you do not want to release that page
>>> from the notifier context to reflect that the page is ok to be offlined
>>> with the rest.
>>>
>>
>> I neither see how you deal with __test_page_isolated_in_pageblock() nor with
>> __offline_isolat...
2019 Oct 22
0
[PATCH RFC v3 6/9] mm: Allow to offline PageOffline() pages with a reference count of 0
...;> MEM_CANCEL_OFFLINE could gain the reference back to balance the
>>> MEM_GOING_OFFLINE step.
>>
>> The pages are already unisolated and could be used by the buddy. But again,
>> I think you have an idea that tries to avoid putting pages to the buddy.
>
> Yeah, set_page_count(page, 0) if you do not want to release that page
> from the notifier context to reflect that the page is ok to be offlined
> with the rest.
>
I neither see how you deal with __test_page_isolated_in_pageblock() nor with
__offline_isolated_pages(). Sorry, but what I read is incomplete an...
2020 Sep 25
0
[PATCH 2/2] mm: remove extra ZONE_DEVICE struct page refcount
...c.c b/mm/page_alloc.c
index fab5e97dc9ca..397b0765de97 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -6070,6 +6070,9 @@ void __ref memmap_init_zone_device(struct zone *zone,
__init_single_page(page, pfn, zone_idx, nid);
+ /* ZONE_DEVICE pages start with a zero reference count. */
+ set_page_count(page, 0);
+
/*
* Mark page reserved as it will need to wait for onlining
* phase for it to be fully associated with a zone.
diff --git a/mm/swap.c b/mm/swap.c
index e7bdf094f76a..769644fe70ef 100644
--- a/mm/swap.c
+++ b/mm/swap.c
@@ -116,12 +116,11 @@ static void __put_compound_page(str...
2020 Oct 01
0
[RFC PATCH v3 2/2] mm: remove extra ZONE_DEVICE struct page refcount
...c.c b/mm/page_alloc.c
index eb0962976a0e..039b88bb3978 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -6154,6 +6154,9 @@ void __ref memmap_init_zone_device(struct zone *zone,
__init_single_page(page, pfn, zone_idx, nid);
+ /* ZONE_DEVICE pages start with a zero reference count. */
+ set_page_count(page, 0);
+
/*
* Mark page reserved as it will need to wait for onlining
* phase for it to be fully associated with a zone.
diff --git a/mm/swap.c b/mm/swap.c
index 0eb057141a04..82cbe069dcf3 100644
--- a/mm/swap.c
+++ b/mm/swap.c
@@ -116,12 +116,11 @@ static void __put_compound_page(str...
2019 Oct 18
2
[PATCH RFC v3 6/9] mm: Allow to offline PageOffline() pages with a reference count of 0
On Fri 18-10-19 10:50:24, David Hildenbrand wrote:
> On 18.10.19 10:15, Michal Hocko wrote:
> > On Wed 16-10-19 16:14:52, David Hildenbrand wrote:
> > > On 16.10.19 16:03, Michal Hocko wrote:
> > [...]
> > > > But why cannot you keep the reference count at 1 (do get_page when
> > > > offlining the page)? In other words as long as the driver knows the