Re: use of shrinker in virtio balloon free page hinting

2019-07-18 Thread Wei Wang
On 07/18/2019 02:47 PM, Michael S. Tsirkin wrote: On Thu, Jul 18, 2019 at 02:30:01PM +0800, Wei Wang wrote: On 07/18/2019 01:58 PM, Michael S. Tsirkin wrote: what if it does not fail? Shrinker is called on system memory pressure. On memory pressure get_free_page_and_send will fail memory

Re: use of shrinker in virtio balloon free page hinting

2019-07-18 Thread Michael S. Tsirkin
On Thu, Jul 18, 2019 at 02:30:01PM +0800, Wei Wang wrote: > On 07/18/2019 01:58 PM, Michael S. Tsirkin wrote: > > > > what if it does not fail? > > > > > > > Shrinker is called on system memory pressure. On memory pressure > > > get_free_page_and_send will fail memory allocation, so it stops

Re: use of shrinker in virtio balloon free page hinting

2019-07-18 Thread Wei Wang
On 07/18/2019 01:58 PM, Michael S. Tsirkin wrote: what if it does not fail? Shrinker is called on system memory pressure. On memory pressure get_free_page_and_send will fail memory allocation, so it stops allocating more. Memory pressure could be triggered by an unrelated allocation e.g.

Re: use of shrinker in virtio balloon free page hinting

2019-07-17 Thread Michael S. Tsirkin
On Thu, Jul 18, 2019 at 01:57:06PM +0800, Wei Wang wrote: > On 07/18/2019 12:13 PM, Michael S. Tsirkin wrote: > > > > It makes sense for pages in the balloon (requested by hypervisor). > > However free page hinting can freeze up lots of memory for its own > > internal reasons. It does not make

Re: use of shrinker in virtio balloon free page hinting

2019-07-17 Thread Wei Wang
On 07/18/2019 12:13 PM, Michael S. Tsirkin wrote: It makes sense for pages in the balloon (requested by hypervisor). However free page hinting can freeze up lots of memory for its own internal reasons. It does not make sense to ask hypervisor to set flags in order to fix internal guest issues.

Re: use of shrinker in virtio balloon free page hinting

2019-07-17 Thread Michael S. Tsirkin
On Wed, Jul 17, 2019 at 03:46:57PM +, Wang, Wei W wrote: > On Wednesday, July 17, 2019 7:21 PM, Michael S. Tsirkin wrote: > > > > Wei, others, > > > > ATM virtio_balloon_shrinker_scan will only get registered when deflate on > > oom feature bit is set. > > > > Not sure whether that's

RE: use of shrinker in virtio balloon free page hinting

2019-07-17 Thread Wang, Wei W
On Wednesday, July 17, 2019 7:21 PM, Michael S. Tsirkin wrote: > > Wei, others, > > ATM virtio_balloon_shrinker_scan will only get registered when deflate on > oom feature bit is set. > > Not sure whether that's intentional. Yes, we wanted to follow the old oom behavior, which allows the oom

Re: use of shrinker in virtio balloon free page hinting

2019-07-17 Thread David Hildenbrand
On 17.07.19 16:34, Michael S. Tsirkin wrote: > On Wed, Jul 17, 2019 at 04:10:47PM +0200, David Hildenbrand wrote: >> On 17.07.19 13:20, Michael S. Tsirkin wrote: >>> Wei, others, >>> >>> ATM virtio_balloon_shrinker_scan will only get registered >>> when deflate on oom feature bit is set. >>> >>>

Re: use of shrinker in virtio balloon free page hinting

2019-07-17 Thread Michael S. Tsirkin
On Wed, Jul 17, 2019 at 04:10:47PM +0200, David Hildenbrand wrote: > On 17.07.19 13:20, Michael S. Tsirkin wrote: > > Wei, others, > > > > ATM virtio_balloon_shrinker_scan will only get registered > > when deflate on oom feature bit is set. > > > > Not sure whether that's intentional. Assuming

Re: use of shrinker in virtio balloon free page hinting

2019-07-17 Thread David Hildenbrand
On 17.07.19 13:20, Michael S. Tsirkin wrote: > Wei, others, > > ATM virtio_balloon_shrinker_scan will only get registered > when deflate on oom feature bit is set. > > Not sure whether that's intentional. Assuming it is: > > virtio_balloon_shrinker_scan will try to locate and free > pages that

Re: use of shrinker in virtio balloon free page hinting

2019-07-17 Thread David Hildenbrand
On 17.07.19 13:20, Michael S. Tsirkin wrote: > Wei, others, > > ATM virtio_balloon_shrinker_scan will only get registered > when deflate on oom feature bit is set. > > Not sure whether that's intentional. Assuming it is: > > virtio_balloon_shrinker_scan will try to locate and free > pages that

use of shrinker in virtio balloon free page hinting

2019-07-17 Thread Michael S. Tsirkin
Wei, others, ATM virtio_balloon_shrinker_scan will only get registered when deflate on oom feature bit is set. Not sure whether that's intentional. Assuming it is: virtio_balloon_shrinker_scan will try to locate and free pages that are processed by host. The above seems broken in several ways: