[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <5B5685A0.9040005@intel.com>
Date: Tue, 24 Jul 2018 09:49:20 +0800
From: Wei Wang <wei.w.wang@...el.com>
To: "Michael S. Tsirkin" <mst@...hat.com>
CC: virtio-dev@...ts.oasis-open.org, linux-kernel@...r.kernel.org,
virtualization@...ts.linux-foundation.org, kvm@...r.kernel.org,
linux-mm@...ck.org, mhocko@...nel.org, akpm@...ux-foundation.org,
torvalds@...ux-foundation.org, pbonzini@...hat.com,
liliang.opensource@...il.com, yang.zhang.wz@...il.com,
quan.xu0@...il.com, nilal@...hat.com, riel@...hat.com,
peterx@...hat.com
Subject: Re: [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.
Best,
Wei
Powered by blists - more mailing lists