search for: balloon_page_dequeu

Displaying 20 results from an estimated 175 matches for "balloon_page_dequeu".

Did you mean: balloon_page_dequeue
2016 Jan 01
5
[PATCH 2/2] virtio_balloon: fix race between migration and ballooning
On Mon, Dec 28, 2015 at 08:35:13AM +0900, Minchan Kim wrote: > In balloon_page_dequeue, pages_lock should cover the loop > (ie, list_for_each_entry_safe). Otherwise, the cursor page could > be isolated by compaction and then list_del by isolation could > poison the page->lru.{prev,next} so the loop finally could > access wrong address like this. This patch fixes the b...
2016 Jan 01
5
[PATCH 2/2] virtio_balloon: fix race between migration and ballooning
On Mon, Dec 28, 2015 at 08:35:13AM +0900, Minchan Kim wrote: > In balloon_page_dequeue, pages_lock should cover the loop > (ie, list_for_each_entry_safe). Otherwise, the cursor page could > be isolated by compaction and then list_del by isolation could > poison the page->lru.{prev,next} so the loop finally could > access wrong address like this. This patch fixes the b...
2016 Jan 09
1
[PATCH 2/2] virtio_balloon: fix race between migration and ballooning
On Fri, Jan 08, 2016 at 02:56:14PM -0500, Rafael Aquini wrote: > On Fri, Jan 01, 2016 at 11:36:13AM +0200, Michael S. Tsirkin wrote: > > On Mon, Dec 28, 2015 at 08:35:13AM +0900, Minchan Kim wrote: > > > In balloon_page_dequeue, pages_lock should cover the loop > > > (ie, list_for_each_entry_safe). Otherwise, the cursor page could > > > be isolated by compaction and then list_del by isolation could > > > poison the page->lru.{prev,next} so the loop finally could > > > access wrong a...
2016 Jan 09
1
[PATCH 2/2] virtio_balloon: fix race between migration and ballooning
On Fri, Jan 08, 2016 at 02:56:14PM -0500, Rafael Aquini wrote: > On Fri, Jan 01, 2016 at 11:36:13AM +0200, Michael S. Tsirkin wrote: > > On Mon, Dec 28, 2015 at 08:35:13AM +0900, Minchan Kim wrote: > > > In balloon_page_dequeue, pages_lock should cover the loop > > > (ie, list_for_each_entry_safe). Otherwise, the cursor page could > > > be isolated by compaction and then list_del by isolation could > > > poison the page->lru.{prev,next} so the loop finally could > > > access wrong a...
2015 Dec 27
5
[PATCH 1/2] virtio_balloon: fix race by fill and leak
During my compaction-related stuff, I encountered a bug with ballooning. With repeated inflating and deflating cycle, guest memory( ie, cat /proc/meminfo | grep MemTotal) is decreased and couldn't be recovered. The reason is balloon_lock doesn't cover release_pages_balloon so struct virtio_balloon fields could be overwritten by race of fill_balloon(e,g, vb->*pfns could be critical).
2015 Dec 27
5
[PATCH 1/2] virtio_balloon: fix race by fill and leak
During my compaction-related stuff, I encountered a bug with ballooning. With repeated inflating and deflating cycle, guest memory( ie, cat /proc/meminfo | grep MemTotal) is decreased and couldn't be recovered. The reason is balloon_lock doesn't cover release_pages_balloon so struct virtio_balloon fields could be overwritten by race of fill_balloon(e,g, vb->*pfns could be critical).
2016 Jan 04
0
[PATCH 2/2] virtio_balloon: fix race between migration and ballooning
On Fri, Jan 01, 2016 at 11:36:13AM +0200, Michael S. Tsirkin wrote: > On Mon, Dec 28, 2015 at 08:35:13AM +0900, Minchan Kim wrote: > > In balloon_page_dequeue, pages_lock should cover the loop > > (ie, list_for_each_entry_safe). Otherwise, the cursor page could > > be isolated by compaction and then list_del by isolation could > > poison the page->lru.{prev,next} so the loop finally could > > access wrong address like this. Th...
2016 Jan 08
0
[PATCH 2/2] virtio_balloon: fix race between migration and ballooning
On Fri, Jan 01, 2016 at 11:36:13AM +0200, Michael S. Tsirkin wrote: > On Mon, Dec 28, 2015 at 08:35:13AM +0900, Minchan Kim wrote: > > In balloon_page_dequeue, pages_lock should cover the loop > > (ie, list_for_each_entry_safe). Otherwise, the cursor page could > > be isolated by compaction and then list_del by isolation could > > poison the page->lru.{prev,next} so the loop finally could > > access wrong address like this. Th...
2017 Oct 22
1
[PATCH v1 1/3] virtio-balloon: replace the coarse-grained balloon_lock
...; > >> - vb->num_pfns += VIRTIO_BALLOON_PAGES_PER_PAGE) { > >> + num = min_t(size_t, num, atomic64_read(&vb->num_pages)); > >> + for (num_pfns = 0; num_pfns < num; > >> + num_pfns += VIRTIO_BALLOON_PAGES_PER_PAGE) { > >> page = balloon_page_dequeue(vb_dev_info); > > If balloon_page_dequeue() can be concurrently called by both host's request > > and guest's OOM event, is (!dequeued_page) test in balloon_page_dequeue() safe? > > > I'm not sure about the question. The "dequeue_page" is a local variab...
2017 Oct 22
1
[PATCH v1 1/3] virtio-balloon: replace the coarse-grained balloon_lock
...; > >> - vb->num_pfns += VIRTIO_BALLOON_PAGES_PER_PAGE) { > >> + num = min_t(size_t, num, atomic64_read(&vb->num_pages)); > >> + for (num_pfns = 0; num_pfns < num; > >> + num_pfns += VIRTIO_BALLOON_PAGES_PER_PAGE) { > >> page = balloon_page_dequeue(vb_dev_info); > > If balloon_page_dequeue() can be concurrently called by both host's request > > and guest's OOM event, is (!dequeued_page) test in balloon_page_dequeue() safe? > > > I'm not sure about the question. The "dequeue_page" is a local variab...
2015 Dec 27
0
[PATCH 2/2] virtio_balloon: fix race between migration and ballooning
In balloon_page_dequeue, pages_lock should cover the loop (ie, list_for_each_entry_safe). Otherwise, the cursor page could be isolated by compaction and then list_del by isolation could poison the page->lru.{prev,next} so the loop finally could access wrong address like this. This patch fixes the bug. general protect...
2015 Dec 27
0
[PATCH 2/2] virtio_balloon: fix race between migration and ballooning
On Mon, Dec 28, 2015 at 08:35:13AM +0900, Minchan Kim wrote: > In balloon_page_dequeue, pages_lock should cover the loop > (ie, list_for_each_entry_safe). Otherwise, the cursor page could > be isolated by compaction and then list_del by isolation could > poison the page->lru.{prev,next} so the loop finally could > access wrong address like this. This patch fixes the b...
2017 Oct 22
2
[PATCH v1 1/3] virtio-balloon: replace the coarse-grained balloon_lock
...(vb->num_pfns = 0; vb->num_pfns < num; > - vb->num_pfns += VIRTIO_BALLOON_PAGES_PER_PAGE) { > + num = min_t(size_t, num, atomic64_read(&vb->num_pages)); > + for (num_pfns = 0; num_pfns < num; > + num_pfns += VIRTIO_BALLOON_PAGES_PER_PAGE) { > page = balloon_page_dequeue(vb_dev_info); If balloon_page_dequeue() can be concurrently called by both host's request and guest's OOM event, is (!dequeued_page) test in balloon_page_dequeue() safe? Is such concurrency needed? > if (!page) > break; > - set_page_pfns(vb, vb->pfns + vb->num_pfns...
2017 Oct 22
2
[PATCH v1 1/3] virtio-balloon: replace the coarse-grained balloon_lock
...(vb->num_pfns = 0; vb->num_pfns < num; > - vb->num_pfns += VIRTIO_BALLOON_PAGES_PER_PAGE) { > + num = min_t(size_t, num, atomic64_read(&vb->num_pages)); > + for (num_pfns = 0; num_pfns < num; > + num_pfns += VIRTIO_BALLOON_PAGES_PER_PAGE) { > page = balloon_page_dequeue(vb_dev_info); If balloon_page_dequeue() can be concurrently called by both host's request and guest's OOM event, is (!dequeued_page) test in balloon_page_dequeue() safe? Is such concurrency needed? > if (!page) > break; > - set_page_pfns(vb, vb->pfns + vb->num_pfns...
2016 Jan 01
0
[PATCH RFC] balloon: fix page list locking
Minchan Kim noticed that balloon_page_dequeue walks the pages list without holding the pages_lock. This can race e.g. with isolation, which has been reported to cause list corruption and crashes in leak_balloon. Page can also in theory get freed before it's locked, corrupting memory. To fix, make sure list accesses are done under lock, a...
2016 Jan 01
0
[PATCH RFC] balloon: fix page list locking
Minchan Kim noticed that balloon_page_dequeue walks the pages list without holding the pages_lock. This can race e.g. with isolation, which has been reported to cause list corruption and crashes in leak_balloon. Page can also in theory get freed before it's locked, corrupting memory. To fix, make sure list accesses are done under lock, a...
2019 Apr 24
1
[PATCH v3 1/4] mm/balloon_compaction: list interfaces
...0644 > --- a/include/linux/balloon_compaction.h > +++ b/include/linux/balloon_compaction.h > @@ -64,6 +64,10 @@ extern struct page *balloon_page_alloc(void); > extern void balloon_page_enqueue(struct balloon_dev_info *b_dev_info, > struct page *page); > extern struct page *balloon_page_dequeue(struct balloon_dev_info *b_dev_info); > +extern size_t balloon_page_list_enqueue(struct balloon_dev_info *b_dev_info, > + struct list_head *pages); > +extern size_t balloon_page_list_dequeue(struct balloon_dev_info *b_dev_info, > + struct list_head *pages, size_t n_req...
2019 Jul 18
1
[PATCH v3 2/2] balloon: fix up comments
...ages on a list, use balloon_page_list_enqueue instead. "To enqueue a list of pages" ? > */ > void balloon_page_enqueue(struct balloon_dev_info *b_dev_info, > struct page *page) > @@ -157,14 +156,24 @@ EXPORT_SYMBOL_GPL(balloon_page_enqueue); > > /* > * balloon_page_dequeue - removes a page from balloon's page list and > returns > - * the its address to allow the driver release the page. > + * its address to allow the driver to release the page. > * @b_dev_info: balloon device decriptor where we will grab a page from. > * > - * Drive...
2016 Jan 10
1
[PATCH 2/2] virtio_balloon: fix race between migration and ballooning
On Mon, Jan 04, 2016 at 09:27:47AM +0900, Minchan Kim wrote: > > I think this will cause deadlocks. > > > > pages_lock now nests within page lock, balloon_page_putback > > nests them in the reverse order. > > In balloon_page_dequeu, we used trylock so I don't think it's > deadlock. I went over this again and I don't see the issue anymore. I think I was mistaken, so I dropped my patch and picked up yours. Sorry about the noise. > > > > Also, there's another issue there I think: after isolatio...
2016 Jan 10
1
[PATCH 2/2] virtio_balloon: fix race between migration and ballooning
On Mon, Jan 04, 2016 at 09:27:47AM +0900, Minchan Kim wrote: > > I think this will cause deadlocks. > > > > pages_lock now nests within page lock, balloon_page_putback > > nests them in the reverse order. > > In balloon_page_dequeu, we used trylock so I don't think it's > deadlock. I went over this again and I don't see the issue anymore. I think I was mistaken, so I dropped my patch and picked up yours. Sorry about the noise. > > > > Also, there's another issue there I think: after isolatio...