search for: inflate_lock

Displaying 11 results from an estimated 11 matches for "inflate_lock".

2017 Oct 20
0
[PATCH v1 1/3] virtio-balloon: replace the coarse-grained balloon_lock
...ons, thereby resulting in a deadlock issue on OOM: fill_balloon: take balloon_lock and wait for OOM to get some memory; oom_notify: release some inflated memory via leak_balloon(); leak_balloon: wait for balloon_lock to be released by fill_balloon. This patch breaks the lock into two fine-grained inflate_lock and deflate_lock, and eliminates the unnecessary use of the shared data (i.e. vb->pnfs, vb->num_pfns). This enables leak_balloon and fill_balloon to run concurrently and solves the deadlock issue. Reported-by: Tetsuo Handa <penguin-kernel at I-love.SAKURA.ne.jp> Signed-off-by: Wei Wang...
2017 Oct 20
9
[PATCH v1 0/3] Virtio-balloon Improvement
This patch series intends to summarize the recent contributions made by Michael S. Tsirkin, Tetsuo Handa, Michal Hocko etc. via reporting and discussing the related deadlock issues on the mailinglist. Please check each patch for details. >From a high-level point of view, this patch series achieves: 1) eliminate the deadlock issue fundamentally caused by the inability to run leak_balloon and
2017 Oct 20
9
[PATCH v1 0/3] Virtio-balloon Improvement
This patch series intends to summarize the recent contributions made by Michael S. Tsirkin, Tetsuo Handa, Michal Hocko etc. via reporting and discussing the related deadlock issues on the mailinglist. Please check each patch for details. >From a high-level point of view, this patch series achieves: 1) eliminate the deadlock issue fundamentally caused by the inability to run leak_balloon and
2017 Oct 22
2
[PATCH v1 1/3] virtio-balloon: replace the coarse-grained balloon_lock
...adlock issue on OOM: > > fill_balloon: take balloon_lock and wait for OOM to get some memory; > oom_notify: release some inflated memory via leak_balloon(); > leak_balloon: wait for balloon_lock to be released by fill_balloon. > > This patch breaks the lock into two fine-grained inflate_lock and > deflate_lock, and eliminates the unnecessary use of the shared data > (i.e. vb->pnfs, vb->num_pfns). This enables leak_balloon and > fill_balloon to run concurrently and solves the deadlock issue. > > @@ -162,20 +160,20 @@ static unsigned fill_balloon(struct virtio_ball...
2017 Oct 22
2
[PATCH v1 1/3] virtio-balloon: replace the coarse-grained balloon_lock
...adlock issue on OOM: > > fill_balloon: take balloon_lock and wait for OOM to get some memory; > oom_notify: release some inflated memory via leak_balloon(); > leak_balloon: wait for balloon_lock to be released by fill_balloon. > > This patch breaks the lock into two fine-grained inflate_lock and > deflate_lock, and eliminates the unnecessary use of the shared data > (i.e. vb->pnfs, vb->num_pfns). This enables leak_balloon and > fill_balloon to run concurrently and solves the deadlock issue. > > @@ -162,20 +160,20 @@ static unsigned fill_balloon(struct virtio_ball...
2017 Oct 22
1
[PATCH v1 1/3] virtio-balloon: replace the coarse-grained balloon_lock
...e); > >> if (!virtio_has_feature(vb->vdev, > >> VIRTIO_BALLOON_F_DEFLATE_ON_OOM)) > >> adjust_managed_page_count(page, -1); > >> } > >> > >> - num_allocated_pages = vb->num_pfns; > >> + mutex_lock(&vb->inflate_lock); > >> /* Did we get any? */ > >> - if (vb->num_pfns != 0) > >> - tell_host(vb, vb->inflate_vq); > >> - mutex_unlock(&vb->balloon_lock); > >> + if (num_pfns != 0) > >> + tell_host(vb, vb->inflate_vq, pfns, num_pfns); > &g...
2017 Oct 22
1
[PATCH v1 1/3] virtio-balloon: replace the coarse-grained balloon_lock
...e); > >> if (!virtio_has_feature(vb->vdev, > >> VIRTIO_BALLOON_F_DEFLATE_ON_OOM)) > >> adjust_managed_page_count(page, -1); > >> } > >> > >> - num_allocated_pages = vb->num_pfns; > >> + mutex_lock(&vb->inflate_lock); > >> /* Did we get any? */ > >> - if (vb->num_pfns != 0) > >> - tell_host(vb, vb->inflate_vq); > >> - mutex_unlock(&vb->balloon_lock); > >> + if (num_pfns != 0) > >> + tell_host(vb, vb->inflate_vq, pfns, num_pfns); > &g...
2017 Oct 20
0
[PATCH v1 3/3] virtio-balloon: stop inflating when OOM occurs
...adjust_managed_page_count(page, -1); } + /* + * The oom_mode is set, but we've already been able to get some + * pages, so it is time to turn it off here. + */ + if (unlikely(READ_ONCE(vb->oom_mode) && page)) + WRITE_ONCE(vb->oom_mode, false); + mutex_lock(&vb->inflate_lock); /* Did we get any? */ if (num_pfns != 0) @@ -173,6 +189,13 @@ static unsigned fill_balloon(struct virtio_balloon *vb, size_t num) mutex_unlock(&vb->inflate_lock); atomic64_add(num_pfns, &vb->num_pages); + /* + * If oom_mode is on, return the original @num passed by + * u...
2017 Oct 22
0
[PATCH v1 1/3] virtio-balloon: replace the coarse-grained balloon_lock
...gt;> >> fill_balloon: take balloon_lock and wait for OOM to get some memory; >> oom_notify: release some inflated memory via leak_balloon(); >> leak_balloon: wait for balloon_lock to be released by fill_balloon. >> >> This patch breaks the lock into two fine-grained inflate_lock and >> deflate_lock, and eliminates the unnecessary use of the shared data >> (i.e. vb->pnfs, vb->num_pfns). This enables leak_balloon and >> fill_balloon to run concurrently and solves the deadlock issue. >> >> @@ -162,20 +160,20 @@ static unsigned fill_balloon(...
2017 Oct 22
1
[PATCH v1 3/3] virtio-balloon: stop inflating when OOM occurs
...gt; > + /* > + * The oom_mode is set, but we've already been able to get some > + * pages, so it is time to turn it off here. > + */ > + if (unlikely(READ_ONCE(vb->oom_mode) && page)) > + WRITE_ONCE(vb->oom_mode, false); > + > mutex_lock(&vb->inflate_lock); > /* Did we get any? */ > if (num_pfns != 0) > @@ -173,6 +189,13 @@ static unsigned fill_balloon(struct virtio_balloon *vb, size_t num) > mutex_unlock(&vb->inflate_lock); > atomic64_add(num_pfns, &vb->num_pages); > > + /* > + * If oom_mode is on, r...
2017 Oct 22
1
[PATCH v1 3/3] virtio-balloon: stop inflating when OOM occurs
...gt; > + /* > + * The oom_mode is set, but we've already been able to get some > + * pages, so it is time to turn it off here. > + */ > + if (unlikely(READ_ONCE(vb->oom_mode) && page)) > + WRITE_ONCE(vb->oom_mode, false); > + > mutex_lock(&vb->inflate_lock); > /* Did we get any? */ > if (num_pfns != 0) > @@ -173,6 +189,13 @@ static unsigned fill_balloon(struct virtio_balloon *vb, size_t num) > mutex_unlock(&vb->inflate_lock); > atomic64_add(num_pfns, &vb->num_pages); > > + /* > + * If oom_mode is on, r...