search for: scan_objects

Displaying 20 results from an estimated 35 matches for "scan_objects".

2018 Aug 03
2
[PATCH v3 2/2] virtio_balloon: replace oom notifier with shrinker
On 2018/08/03 17:32, Wei Wang wrote: > +static int virtio_balloon_register_shrinker(struct virtio_balloon *vb) > +{ > + vb->shrinker.scan_objects = virtio_balloon_shrinker_scan; > + vb->shrinker.count_objects = virtio_balloon_shrinker_count; > + vb->shrinker.batch = 0; > + vb->shrinker.seeks = DEFAULT_SEEKS; Why flags field is not set? If vb is allocated by kmalloc(GFP_KERNEL) and is nowhere zero-cleared, KASAN would compl...
2018 Aug 03
2
[PATCH v3 2/2] virtio_balloon: replace oom notifier with shrinker
On 2018/08/03 17:32, Wei Wang wrote: > +static int virtio_balloon_register_shrinker(struct virtio_balloon *vb) > +{ > + vb->shrinker.scan_objects = virtio_balloon_shrinker_scan; > + vb->shrinker.count_objects = virtio_balloon_shrinker_count; > + vb->shrinker.batch = 0; > + vb->shrinker.seeks = DEFAULT_SEEKS; Why flags field is not set? If vb is allocated by kmalloc(GFP_KERNEL) and is nowhere zero-cleared, KASAN would compl...
2018 Aug 06
2
[PATCH v3 2/2] virtio_balloon: replace oom notifier with shrinker
On 2018/08/06 18:56, Wei Wang wrote: > On 08/03/2018 08:11 PM, Tetsuo Handa wrote: >> On 2018/08/03 17:32, Wei Wang wrote: >>> +static int virtio_balloon_register_shrinker(struct virtio_balloon *vb) >>> +{ >>> +??? vb->shrinker.scan_objects = virtio_balloon_shrinker_scan; >>> +??? vb->shrinker.count_objects = virtio_balloon_shrinker_count; >>> +??? vb->shrinker.batch = 0; >>> +??? vb->shrinker.seeks = DEFAULT_SEEKS; >> Why flags field is not set? If vb is allocated by kmalloc(GFP_KERNEL) >&...
2018 Aug 06
2
[PATCH v3 2/2] virtio_balloon: replace oom notifier with shrinker
On 2018/08/06 18:56, Wei Wang wrote: > On 08/03/2018 08:11 PM, Tetsuo Handa wrote: >> On 2018/08/03 17:32, Wei Wang wrote: >>> +static int virtio_balloon_register_shrinker(struct virtio_balloon *vb) >>> +{ >>> +??? vb->shrinker.scan_objects = virtio_balloon_shrinker_scan; >>> +??? vb->shrinker.count_objects = virtio_balloon_shrinker_count; >>> +??? vb->shrinker.batch = 0; >>> +??? vb->shrinker.seeks = DEFAULT_SEEKS; >> Why flags field is not set? If vb is allocated by kmalloc(GFP_KERNEL) >&...
2018 Aug 06
1
[PATCH v3 2/2] virtio_balloon: replace oom notifier with shrinker
.../08/06 18:56, Wei Wang wrote: >>> On 08/03/2018 08:11 PM, Tetsuo Handa wrote: >>>> On 2018/08/03 17:32, Wei Wang wrote: >>>>> +static int virtio_balloon_register_shrinker(struct virtio_balloon >>>>> +*vb) { >>>>> +??? vb->shrinker.scan_objects = virtio_balloon_shrinker_scan; >>>>> +??? vb->shrinker.count_objects = virtio_balloon_shrinker_count; >>>>> +??? vb->shrinker.batch = 0; >>>>> +??? vb->shrinker.seeks = DEFAULT_SEEKS; >>>> Why flags field is not set? If vb is alloca...
2020 Jun 08
0
[PATCH AUTOSEL 5.6 165/606] virtio-balloon: Revert "virtio-balloon: Switch back to OOM handler for VIRTIO_BALLOON_F_DEFLATE_ON_OOM"
...); - unsigned long *freed = parm; + unregister_shrinker(&vb->shrinker); +} - *freed += leak_balloon(vb, VIRTIO_BALLOON_OOM_NR_PAGES) / - VIRTIO_BALLOON_PAGES_PER_PAGE; - update_balloon_size(vb); +static int virtio_balloon_register_shrinker(struct virtio_balloon *vb) +{ + vb->shrinker.scan_objects = virtio_balloon_shrinker_scan; + vb->shrinker.count_objects = virtio_balloon_shrinker_count; + vb->shrinker.seeks = DEFAULT_SEEKS; - return NOTIFY_OK; + return register_shrinker(&vb->shrinker); } static int virtballoon_probe(struct virtio_device *vdev) @@ -900,35 +935,22 @@ stat...
2020 Jun 08
0
[PATCH AUTOSEL 5.6 240/606] Revert "virtio-balloon: Revert "virtio-balloon: Switch back to OOM handler for VIRTIO_BALLOON_F_DEFLATE_ON_OOM""
...unsigned long dummy, void *parm) { - unregister_shrinker(&vb->shrinker); -} + struct virtio_balloon *vb = container_of(nb, + struct virtio_balloon, oom_nb); + unsigned long *freed = parm; -static int virtio_balloon_register_shrinker(struct virtio_balloon *vb) -{ - vb->shrinker.scan_objects = virtio_balloon_shrinker_scan; - vb->shrinker.count_objects = virtio_balloon_shrinker_count; - vb->shrinker.seeks = DEFAULT_SEEKS; + *freed += leak_balloon(vb, VIRTIO_BALLOON_OOM_NR_PAGES) / + VIRTIO_BALLOON_PAGES_PER_PAGE; + update_balloon_size(vb); - return register_shrinker(&vb-&...
2020 Feb 05
12
[PATCH v1 0/3] virtio-balloon: Fixes + switch back to OOM handler
Two fixes for issues I stumbled over while working on patch #3. Switch back to the good ol' OOM handler for VIRTIO_BALLOON_F_DEFLATE_ON_OOM as the switch to the shrinker introduce some undesired side effects. Keep the shrinker in place to handle VIRTIO_BALLOON_F_FREE_PAGE_HINT. Lengthy discussion under [1]. I tested with QEMU and "deflate-on-oom=on". Works as expected. Did not test
2018 Aug 03
4
[PATCH v3 0/2] virtio-balloon: some improvements
This series is split from the "Virtio-balloon: support free page reporting" series to make some improvements. ChangeLog: v2->v3: - shrink the balloon pages according to the amount requested by the claimer, instead of using a user specified number; v1->v2: - register the shrinker when VIRTIO_BALLOON_F_DEFLATE_ON_OOM is negotiated. Wei Wang (2): virtio-balloon: remove BUG()
2020 Feb 05
0
[PATCH v1 3/3] virtio-balloon: Switch back to OOM handler for VIRTIO_BALLOON_F_DEFLATE_ON_OOM
...unsigned long dummy, void *parm) { - unregister_shrinker(&vb->shrinker); -} + struct virtio_balloon *vb = container_of(nb, + struct virtio_balloon, oom_nb); + unsigned long *freed = parm; -static int virtio_balloon_register_shrinker(struct virtio_balloon *vb) -{ - vb->shrinker.scan_objects = virtio_balloon_shrinker_scan; - vb->shrinker.count_objects = virtio_balloon_shrinker_count; - vb->shrinker.seeks = DEFAULT_SEEKS; + *freed += leak_balloon(vb, VIRTIO_BALLOON_OOM_NR_PAGES) / + VIRTIO_BALLOON_PAGES_PER_PAGE; + update_balloon_size(vb); - return register_shrinker(&vb-&...
2020 Feb 05
2
[PATCH v1 3/3] virtio-balloon: Switch back to OOM handler for VIRTIO_BALLOON_F_DEFLATE_ON_OOM
...struct virtio_balloon *vb = container_of(nb, > + struct virtio_balloon, > oom_nb); > + unsigned long *freed = parm; > > -static int virtio_balloon_register_shrinker(struct virtio_balloon *vb) > -{ > - vb->shrinker.scan_objects = virtio_balloon_shrinker_scan; > - vb->shrinker.count_objects = virtio_balloon_shrinker_count; > - vb->shrinker.seeks = DEFAULT_SEEKS; > + *freed += leak_balloon(vb, VIRTIO_BALLOON_OOM_NR_PAGES) / > + VIRTIO_BALLOON_PAGES_PER_PAGE; > + u...
2020 Feb 05
2
[PATCH v1 3/3] virtio-balloon: Switch back to OOM handler for VIRTIO_BALLOON_F_DEFLATE_ON_OOM
...struct virtio_balloon *vb = container_of(nb, > + struct virtio_balloon, > oom_nb); > + unsigned long *freed = parm; > > -static int virtio_balloon_register_shrinker(struct virtio_balloon *vb) > -{ > - vb->shrinker.scan_objects = virtio_balloon_shrinker_scan; > - vb->shrinker.count_objects = virtio_balloon_shrinker_count; > - vb->shrinker.seeks = DEFAULT_SEEKS; > + *freed += leak_balloon(vb, VIRTIO_BALLOON_OOM_NR_PAGES) / > + VIRTIO_BALLOON_PAGES_PER_PAGE; > + u...
2020 Apr 15
0
[PATCH AUTOSEL 5.6 111/129] virtio-balloon: Switch back to OOM handler for VIRTIO_BALLOON_F_DEFLATE_ON_OOM
...unsigned long dummy, void *parm) { - unregister_shrinker(&vb->shrinker); -} + struct virtio_balloon *vb = container_of(nb, + struct virtio_balloon, oom_nb); + unsigned long *freed = parm; -static int virtio_balloon_register_shrinker(struct virtio_balloon *vb) -{ - vb->shrinker.scan_objects = virtio_balloon_shrinker_scan; - vb->shrinker.count_objects = virtio_balloon_shrinker_count; - vb->shrinker.seeks = DEFAULT_SEEKS; + *freed += leak_balloon(vb, VIRTIO_BALLOON_OOM_NR_PAGES) / + VIRTIO_BALLOON_PAGES_PER_PAGE; + update_balloon_size(vb); - return register_shrinker(&vb-&...
2020 Apr 15
0
[PATCH AUTOSEL 5.5 091/106] virtio-balloon: Switch back to OOM handler for VIRTIO_BALLOON_F_DEFLATE_ON_OOM
...unsigned long dummy, void *parm) { - unregister_shrinker(&vb->shrinker); -} + struct virtio_balloon *vb = container_of(nb, + struct virtio_balloon, oom_nb); + unsigned long *freed = parm; -static int virtio_balloon_register_shrinker(struct virtio_balloon *vb) -{ - vb->shrinker.scan_objects = virtio_balloon_shrinker_scan; - vb->shrinker.count_objects = virtio_balloon_shrinker_count; - vb->shrinker.seeks = DEFAULT_SEEKS; + *freed += leak_balloon(vb, VIRTIO_BALLOON_OOM_NR_PAGES) / + VIRTIO_BALLOON_PAGES_PER_PAGE; + update_balloon_size(vb); - return register_shrinker(&vb-&...
2018 Aug 06
0
[PATCH v3 2/2] virtio_balloon: replace oom notifier with shrinker
On 08/03/2018 08:11 PM, Tetsuo Handa wrote: > On 2018/08/03 17:32, Wei Wang wrote: >> +static int virtio_balloon_register_shrinker(struct virtio_balloon *vb) >> +{ >> + vb->shrinker.scan_objects = virtio_balloon_shrinker_scan; >> + vb->shrinker.count_objects = virtio_balloon_shrinker_count; >> + vb->shrinker.batch = 0; >> + vb->shrinker.seeks = DEFAULT_SEEKS; > Why flags field is not set? If vb is allocated by kmalloc(GFP_KERNEL) > and is nowhere zero-clear...
2018 Aug 06
0
[PATCH v3 2/2] virtio_balloon: replace oom notifier with shrinker
...e: > On 2018/08/06 18:56, Wei Wang wrote: > > On 08/03/2018 08:11 PM, Tetsuo Handa wrote: > >> On 2018/08/03 17:32, Wei Wang wrote: > >>> +static int virtio_balloon_register_shrinker(struct virtio_balloon > >>> +*vb) { > >>> +??? vb->shrinker.scan_objects = virtio_balloon_shrinker_scan; > >>> +??? vb->shrinker.count_objects = virtio_balloon_shrinker_count; > >>> +??? vb->shrinker.batch = 0; > >>> +??? vb->shrinker.seeks = DEFAULT_SEEKS; > >> Why flags field is not set? If vb is allocated by kmall...
2020 Feb 06
1
[PATCH v1 3/3] virtio-balloon: Switch back to OOM handler for VIRTIO_BALLOON_F_DEFLATE_ON_OOM
...unregister_shrinker(&vb->shrinker); > -} > + struct virtio_balloon *vb = container_of(nb, > + struct virtio_balloon, oom_nb); > + unsigned long *freed = parm; > > -static int virtio_balloon_register_shrinker(struct virtio_balloon *vb) > -{ > - vb->shrinker.scan_objects = virtio_balloon_shrinker_scan; > - vb->shrinker.count_objects = virtio_balloon_shrinker_count; > - vb->shrinker.seeks = DEFAULT_SEEKS; > + *freed += leak_balloon(vb, VIRTIO_BALLOON_OOM_NR_PAGES) / > + VIRTIO_BALLOON_PAGES_PER_PAGE; > + update_balloon_size(vb); > > -...
2018 Jul 27
5
[PATCH v2 0/2] virtio-balloon: some improvements
This series is split from the "Virtio-balloon: support free page reporting" series to make some improvements. v1->v2 ChangeLog: - register the shrinker when VIRTIO_BALLOON_F_DEFLATE_ON_OOM is negotiated. Wei Wang (2): virtio-balloon: remove BUG() in init_vqs virtio_balloon: replace oom notifier with shrinker drivers/virtio/virtio_balloon.c | 125
2018 Jul 27
5
[PATCH v2 0/2] virtio-balloon: some improvements
This series is split from the "Virtio-balloon: support free page reporting" series to make some improvements. v1->v2 ChangeLog: - register the shrinker when VIRTIO_BALLOON_F_DEFLATE_ON_OOM is negotiated. Wei Wang (2): virtio-balloon: remove BUG() in init_vqs virtio_balloon: replace oom notifier with shrinker drivers/virtio/virtio_balloon.c | 125
2018 Jul 27
0
[PATCH v2 2/2] virtio_balloon: replace oom notifier with shrinker
...pages, balloon_pages_to_shrink) / + VIRTIO_BALLOON_PAGES_PER_PAGE; +} + +static void virtio_balloon_unregister_shrinker(struct virtio_balloon *vb) +{ + unregister_shrinker(&vb->shrinker); +} + +static int virtio_balloon_register_shrinker(struct virtio_balloon *vb) +{ + vb->shrinker.scan_objects = virtio_balloon_shrinker_scan; + vb->shrinker.count_objects = virtio_balloon_shrinker_count; + vb->shrinker.batch = 0; + vb->shrinker.seeks = DEFAULT_SEEKS; + + return register_shrinker(&vb->shrinker); +} + static int virtballoon_probe(struct virtio_device *vdev) { struct virti...