search for: shrinker

Displaying 20 results from an estimated 236 matches for "shrinker".

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 the shrinker for VIRTIO_BALLOON_F_FREE_PAGE_HINT, as it is hard to trigge...
2020 Feb 05
2
[PATCH v1 3/3] virtio-balloon: Switch back to OOM handler for VIRTIO_BALLOON_F_DEFLATE_ON_OOM
On Wed, Feb 5, 2020 at 8:34 AM David Hildenbrand <david at redhat.com> wrote: > Commit 71994620bb25 ("virtio_balloon: replace oom notifier with shrinker") > changed the behavior when deflation happens automatically. Instead of > deflating when called by the OOM handler, the shrinker is used. > > However, the balloon is not simply some slab cache that should be > shrunk when under memory pressure. The shrinker does not have a con...
2020 Feb 05
2
[PATCH v1 3/3] virtio-balloon: Switch back to OOM handler for VIRTIO_BALLOON_F_DEFLATE_ON_OOM
On Wed, Feb 5, 2020 at 8:34 AM David Hildenbrand <david at redhat.com> wrote: > Commit 71994620bb25 ("virtio_balloon: replace oom notifier with shrinker") > changed the behavior when deflation happens automatically. Instead of > deflating when called by the OOM handler, the shrinker is used. > > However, the balloon is not simply some slab cache that should be > shrunk when under memory pressure. The shrinker does not have a con...
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_S...
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_S...
2018 Jul 22
2
[PATCH v36 2/5] virtio_balloon: replace oom notifier with shrinker
On Fri, Jul 20, 2018 at 04:33:02PM +0800, Wei Wang wrote: > The OOM notifier is getting deprecated to use for the reasons mentioned > here by Michal Hocko: https://lkml.org/lkml/2018/7/12/314 > > This patch replaces the virtio-balloon oom notifier with a shrinker > to release balloon pages on memory pressure. > > In addition, the bug in the replaced virtballoon_oom_notify that only > VIRTIO_BALLOON_ARRAY_PFNS_MAX (i.e 256) balloon pages can be freed > though the user has specified more than that number is fixed in the > shrinker_scan func...
2018 Jul 22
2
[PATCH v36 2/5] virtio_balloon: replace oom notifier with shrinker
On Fri, Jul 20, 2018 at 04:33:02PM +0800, Wei Wang wrote: > The OOM notifier is getting deprecated to use for the reasons mentioned > here by Michal Hocko: https://lkml.org/lkml/2018/7/12/314 > > This patch replaces the virtio-balloon oom notifier with a shrinker > to release balloon pages on memory pressure. > > In addition, the bug in the replaced virtballoon_oom_notify that only > VIRTIO_BALLOON_ARRAY_PFNS_MAX (i.e 256) balloon pages can be freed > though the user has specified more than that number is fixed in the > shrinker_scan func...
2023 Aug 22
0
[PATCH v4 43/48] drm/ttm: introduce pool_shrink_rwsem
On Mon, Aug 07, 2023 at 07:09:31PM +0800, Qi Zheng wrote: > Currently, the synchronize_shrinkers() is only used by TTM pool. It only > requires that no shrinkers run in parallel. > > After we use RCU+refcount method to implement the lockless slab shrink, > we can not use shrinker_rwsem or synchronize_rcu() to guarantee that all > shrinker invocations have seen an update before...
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() in init_vqs virtio_balloon: replace oom notifier with shrinker drivers/virtio/virtio_balloon.c | 121 ++++++++++++++++++++++------------------ 1 file changed, 67 insertions(+), 54 deletions(-) -...
2020 Feb 05
0
[PATCH v1 3/3] virtio-balloon: Switch back to OOM handler for VIRTIO_BALLOON_F_DEFLATE_ON_OOM
Commit 71994620bb25 ("virtio_balloon: replace oom notifier with shrinker") changed the behavior when deflation happens automatically. Instead of deflating when called by the OOM handler, the shrinker is used. However, the balloon is not simply some slab cache that should be shrunk when under memory pressure. The shrinker does not have a concept of priorities, so t...
2020 Feb 06
1
[PATCH v1 3/3] virtio-balloon: Switch back to OOM handler for VIRTIO_BALLOON_F_DEFLATE_ON_OOM
On Wed, Feb 05, 2020 at 05:34:02PM +0100, David Hildenbrand wrote: > Commit 71994620bb25 ("virtio_balloon: replace oom notifier with shrinker") > changed the behavior when deflation happens automatically. Instead of > deflating when called by the OOM handler, the shrinker is used. > > However, the balloon is not simply some slab cache that should be > shrunk when under memory pressure. The shrinker does not have a co...
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 allocate...
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 allocate...
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"
...RIORITY 80 +#define VIRTBALLOON_OOM_NOTIFY_PRIORITY 80 #define VIRTIO_BALLOON_FREE_PAGE_ALLOC_FLAG (__GFP_NORETRY | __GFP_NOWARN | \ __GFP_NOMEMALLOC) @@ -115,11 +112,8 @@ struct virtio_balloon { /* Memory statistics */ struct virtio_balloon_stat stats[VIRTIO_BALLOON_S_NR]; - /* Shrinker to return free pages - VIRTIO_BALLOON_F_FREE_PAGE_HINT */ + /* To register a shrinker to shrink memory upon memory pressure */ struct shrinker shrinker; - - /* OOM notifier to deflate on OOM - VIRTIO_BALLOON_F_DEFLATE_ON_OOM */ - struct notifier_block oom_nb; }; static struct virtio_device_id...
2020 Feb 03
6
Balloon pressuring page cache
...n over other memory reclaim >>> > > > mechanisms is that it can pressure the guest's page cache into >>> > > shrinking. >>> > > > >>> > > > However, since the balloon driver changed to using the shrinker >>> API >>> > > > >>> > > >>> > <https://github.com/torvalds/linux/commit/71994620bb25a8b109388fefa9 >>> > e99a28e355255a#diff-fd202acf694d9eba19c8c64da3e480c9> this >>> > > > u...
2020 Feb 03
6
Balloon pressuring page cache
...n over other memory reclaim >>> > > > mechanisms is that it can pressure the guest's page cache into >>> > > shrinking. >>> > > > >>> > > > However, since the balloon driver changed to using the shrinker >>> API >>> > > > >>> > > >>> > <https://github.com/torvalds/linux/commit/71994620bb25a8b109388fefa9 >>> > e99a28e355255a#diff-fd202acf694d9eba19c8c64da3e480c9> this >>> > > > u...
2018 Aug 06
1
[PATCH v3 2/2] virtio_balloon: replace oom notifier with shrinker
...21:44, Wang, Wei W wrote: > On Monday, August 6, 2018 6:29 PM, Tetsuo Handa wrote: >> 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; >>>>&gt...
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""
...ne VIRTIO_BALLOON_OOM_NOTIFY_PRIORITY 80 #define VIRTIO_BALLOON_FREE_PAGE_ALLOC_FLAG (__GFP_NORETRY | __GFP_NOWARN | \ __GFP_NOMEMALLOC) @@ -112,8 +115,11 @@ struct virtio_balloon { /* Memory statistics */ struct virtio_balloon_stat stats[VIRTIO_BALLOON_S_NR]; - /* To register a shrinker to shrink memory upon memory pressure */ + /* Shrinker to return free pages - VIRTIO_BALLOON_F_FREE_PAGE_HINT */ struct shrinker shrinker; + + /* OOM notifier to deflate on OOM - VIRTIO_BALLOON_F_DEFLATE_ON_OOM */ + struct notifier_block oom_nb; }; static struct virtio_device_id id_table[] =...
2018 Aug 03
0
[PATCH v3 2/2] virtio_balloon: replace oom notifier with shrinker
...has been performed). Drivers with large amuont of reclaimable memory is expected to release them at an early stage of memory pressure; - The notifier callback isn't aware of oom contrains; Link: https://lkml.org/lkml/2018/7/12/314 This patch replaces the virtio-balloon oom notifier with a shrinker to release balloon pages on memory pressure. The balloon pages are given back to mm adaptively by returning the number of pages that the reclaimer is asking for (i.e. sc->nr_to_scan). Currently the max possible value of sc->nr_to_scan passed to the balloon shrinker is SHRINK_BATCH, which is...
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 +++++++++++++++++++++++----------------- 1 file changed, 72 insertions(+), 53 deletions(-) --...