Displaying 18 results from an estimated 18 matches for "page_ref_dec".
2020 Mar 10
2
[PATCH v1 07/11] virtio-mem: Allow to offline partially unplugged memory blocks
...ers (so offlining code can correctly subtract
> + * them again).
> + */
> + pfn = PFN_DOWN(virtio_mem_mb_id_to_phys(mb_id) +
> + sb_id * vm->subblock_size);
> + adjust_managed_page_count(pfn_to_page(pfn), nr_pages);
> + for (i = 0; i < nr_pages; i++)
> + page_ref_dec(pfn_to_page(pfn + i));
Is there ever situation this might be a different than 1->0 transition?
--
Michal Hocko
SUSE Labs
2020 Mar 10
2
[PATCH v1 07/11] virtio-mem: Allow to offline partially unplugged memory blocks
...ers (so offlining code can correctly subtract
> + * them again).
> + */
> + pfn = PFN_DOWN(virtio_mem_mb_id_to_phys(mb_id) +
> + sb_id * vm->subblock_size);
> + adjust_managed_page_count(pfn_to_page(pfn), nr_pages);
> + for (i = 0; i < nr_pages; i++)
> + page_ref_dec(pfn_to_page(pfn + i));
Is there ever situation this might be a different than 1->0 transition?
--
Michal Hocko
SUSE Labs
2020 Mar 10
1
[PATCH v1 07/11] virtio-mem: Allow to offline partially unplugged memory blocks
...* them again).
> >> + */
> >> + pfn = PFN_DOWN(virtio_mem_mb_id_to_phys(mb_id) +
> >> + sb_id * vm->subblock_size);
> >> + adjust_managed_page_count(pfn_to_page(pfn), nr_pages);
> >> + for (i = 0; i < nr_pages; i++)
> >> + page_ref_dec(pfn_to_page(pfn + i));
> >
> > Is there ever situation this might be a different than 1->0 transition?
>
> Only if some other code would be taking a reference. At least not from
> virtio-mem perspective.
OK, so that is essentially an error condition. I think it shouldn...
2019 Oct 18
0
[PATCH RFC v3 6/9] mm: Allow to offline PageOffline() pages with a reference count of 0
...e to the allocator (via put_page). You can also set
> the reference count to 0 explicitly. The driver is in control of the
> page, right? And that is the whole point I wanted to make. There is an
This is what virtio-mem does whenever it allocates a range using
alloc_contig_range(). It uses page_ref_dec() instead of put_page()
/*
* Set a range of pages PG_offline and drop the reference. The dropped
* reference (0) and the flag allows isolation code to isolate thisrange
* and offline code to offline it.
*/
static void virtio_mem_set_fake_offline(unsigned long pfn,...
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
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
2019 Oct 22
2
[PATCH RFC v3 6/9] mm: Allow to offline PageOffline() pages with a reference count of 0
...arely used on most systems) doesn't sound nice to me.
> > This is the whole point which made me think about the whole reference
> > count approach in the first place.
>
> Again, the race I think that is possible
>
> somebody: get_page_unless_zero(page)
> virtio_mem: page_ref_dec(pfn_to_page(pfn)
> somebody: put_page() -> straight to the buddy
Who is that somebody? I thought that it is only the owner/driver to have
a control over the page. Also the above is not possible as long as the
owner/driver keeps a reference to the PageOffline page throughout the
time it is ma...
2019 Oct 22
2
[PATCH RFC v3 6/9] mm: Allow to offline PageOffline() pages with a reference count of 0
...arely used on most systems) doesn't sound nice to me.
> > This is the whole point which made me think about the whole reference
> > count approach in the first place.
>
> Again, the race I think that is possible
>
> somebody: get_page_unless_zero(page)
> virtio_mem: page_ref_dec(pfn_to_page(pfn)
> somebody: put_page() -> straight to the buddy
Who is that somebody? I thought that it is only the owner/driver to have
a control over the page. Also the above is not possible as long as the
owner/driver keeps a reference to the PageOffline page throughout the
time it is ma...
2020 Mar 10
0
[PATCH v1 07/11] virtio-mem: Allow to offline partially unplugged memory blocks
...orrectly subtract
>> + * them again).
>> + */
>> + pfn = PFN_DOWN(virtio_mem_mb_id_to_phys(mb_id) +
>> + sb_id * vm->subblock_size);
>> + adjust_managed_page_count(pfn_to_page(pfn), nr_pages);
>> + for (i = 0; i < nr_pages; i++)
>> + page_ref_dec(pfn_to_page(pfn + i));
>
> Is there ever situation this might be a different than 1->0 transition?
Only if some other code would be taking a reference. At least not from
virtio-mem perspective.
--
Thanks,
David / dhildenb
2020 Mar 02
0
[PATCH v1 07/11] virtio-mem: Allow to offline partially unplugged memory blocks
...ges to the managed
+ * page counters (so offlining code can correctly subtract
+ * them again).
+ */
+ pfn = PFN_DOWN(virtio_mem_mb_id_to_phys(mb_id) +
+ sb_id * vm->subblock_size);
+ adjust_managed_page_count(pfn_to_page(pfn), nr_pages);
+ for (i = 0; i < nr_pages; i++)
+ page_ref_dec(pfn_to_page(pfn + i));
+ }
+}
+
+static void virtio_mem_notify_cancel_offline(struct virtio_mem *vm,
+ unsigned long mb_id)
+{
+ const unsigned long nr_pages = PFN_DOWN(vm->subblock_size);
+ unsigned long pfn;
+ int sb_id, i;
+
+ for (sb_id = 0; sb_id < vm->nb_sb_per_mb; sb_id++)...
2019 Oct 22
0
[PATCH RFC v3 6/9] mm: Allow to offline PageOffline() pages with a reference count of 0
...ms) doesn't sound nice to me.
>>> This is the whole point which made me think about the whole reference
>>> count approach in the first place.
>>
>> Again, the race I think that is possible
>>
>> somebody: get_page_unless_zero(page)
>> virtio_mem: page_ref_dec(pfn_to_page(pfn)
>> somebody: put_page() -> straight to the buddy
>
> Who is that somebody? I thought that it is only the owner/driver to have
> a control over the page. Also the above is not possible as long as the
> owner/driver keeps a reference to the PageOffline page thro...
2019 Oct 23
2
[PATCH RFC v3 6/9] mm: Allow to offline PageOffline() pages with a reference count of 0
...gt; >>> This is the whole point which made me think about the whole reference
> >>> count approach in the first place.
> >>
> >> Again, the race I think that is possible
> >>
> >> somebody: get_page_unless_zero(page)
> >> virtio_mem: page_ref_dec(pfn_to_page(pfn)
> >> somebody: put_page() -> straight to the buddy
> >
> > Who is that somebody? I thought that it is only the owner/driver to have
> > a control over the page. Also the above is not possible as long as the
> > owner/driver keeps a reference to...
2019 Oct 23
2
[PATCH RFC v3 6/9] mm: Allow to offline PageOffline() pages with a reference count of 0
...gt; >>> This is the whole point which made me think about the whole reference
> >>> count approach in the first place.
> >>
> >> Again, the race I think that is possible
> >>
> >> somebody: get_page_unless_zero(page)
> >> virtio_mem: page_ref_dec(pfn_to_page(pfn)
> >> somebody: put_page() -> straight to the buddy
> >
> > Who is that somebody? I thought that it is only the owner/driver to have
> > a control over the page. Also the above is not possible as long as the
> > owner/driver keeps a reference to...
2020 Mar 02
20
[PATCH v1 00/11] virtio-mem: paravirtualized memory
This series is based on latest linux-next. The patches are located at:
https://github.com/davidhildenbrand/linux.git virtio-mem-v1
The basic idea of virtio-mem is to provide a flexible,
cross-architecture memory hot(un)plug solution that avoids many limitations
imposed by existing technologies, architectures, and interfaces. More
details can be found below and in linked material.
It's
2020 Mar 02
20
[PATCH v1 00/11] virtio-mem: paravirtualized memory
This series is based on latest linux-next. The patches are located at:
https://github.com/davidhildenbrand/linux.git virtio-mem-v1
The basic idea of virtio-mem is to provide a flexible,
cross-architecture memory hot(un)plug solution that avoids many limitations
imposed by existing technologies, architectures, and interfaces. More
details can be found below and in linked material.
It's
2019 Dec 12
19
[PATCH RFC v4 00/13] virtio-mem: paravirtualized memory
This series is based on latest linux-next. The patches are located at:
https://github.com/davidhildenbrand/linux.git virtio-mem-rfc-v4
The basic idea of virtio-mem is to provide a flexible,
cross-architecture memory hot(un)plug solution that avoids many limitations
imposed by existing technologies, architectures, and interfaces. More
details can be found below and in linked material.
This
2019 Dec 12
19
[PATCH RFC v4 00/13] virtio-mem: paravirtualized memory
This series is based on latest linux-next. The patches are located at:
https://github.com/davidhildenbrand/linux.git virtio-mem-rfc-v4
The basic idea of virtio-mem is to provide a flexible,
cross-architecture memory hot(un)plug solution that avoids many limitations
imposed by existing technologies, architectures, and interfaces. More
details can be found below and in linked material.
This
2019 Sep 19
14
[PATCH RFC v3 0/9] virtio-mem: paravirtualized memory
Long time no RFC! I finally had time to get the next version of the Linux
driver side of virtio-mem into shape, incorporating ideas and feedback from
previous discussions.
This RFC is based on the series currently on the mm list:
- [PATCH 0/3] Remove __online_page_set_limits()
- [PATCH v1 0/3] mm/memory_hotplug: Export generic_online_page()
- [PATCH v4 0/8] mm/memory_hotplug: Shrink zones before