[lkml]   [2018]   [Jul]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH v36 2/5] virtio_balloon: replace oom notifier with shrinker
On 07/23/2018 10:13 PM, Michael S. Tsirkin wrote:
>>> 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)

>> - 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.


 \ /
  Last update: 2018-07-24 03:46    [W:0.057 / U:0.140 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site