Thread (18 messages) 18 messages, 3 authors, 2018-09-08

Re: [PATCH v36 2/5] virtio_balloon: replace oom notifier with shrinker

From: Wei Wang <hidden>
Date: 2018-07-24 01:45:10
Also in: linux-mm, lkml

On 07/23/2018 10:13 PM, Michael S. Tsirkin wrote:
quoted
quoted
   	vb->vb_dev_info.inode->i_mapping->a_ops = &balloon_aops;
   #endif
+	err = virtio_balloon_register_shrinker(vb);
+	if (err)
+		goto out_del_vqs;
So we can get scans before device is ready. Leak will fail
then. Why not register later after device is ready?
Probably no.

- it would be better not to set device ready when register_shrinker failed.
That's very rare so I won't be too worried.
Just a little confused with the point here. "very rare" means it still 
could happen (even it's a corner case), and if that happens, we got 
something wrong functionally. So it will be a bug if we change like 
that, right?

Still couldn't understand the reason of changing shrinker_register after 
device_ready (the original oom notifier was registered before setting 
device ready too)?
(I think the driver won't get shrinker_scan called if device isn't ready 
because of the reasons below)
quoted
- When the device isn't ready, ballooning won't happen, that is,
vb->num_pages will be 0, which results in shrinker_count=0 and shrinker_scan
won't be called.
Best,
Wei
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help