Lines Matching refs:vmpr
78 static struct vmpressure *vmpressure_parent(struct vmpressure *vmpr) in vmpressure_parent() argument
80 struct cgroup_subsys_state *css = vmpressure_to_css(vmpr); in vmpressure_parent()
139 static bool vmpressure_event(struct vmpressure *vmpr, in vmpressure_event() argument
148 mutex_lock(&vmpr->events_lock); in vmpressure_event()
150 list_for_each_entry(ev, &vmpr->events, node) { in vmpressure_event()
157 mutex_unlock(&vmpr->events_lock); in vmpressure_event()
164 struct vmpressure *vmpr = work_to_vmpressure(work); in vmpressure_work_fn() local
168 spin_lock(&vmpr->sr_lock); in vmpressure_work_fn()
177 scanned = vmpr->scanned; in vmpressure_work_fn()
179 spin_unlock(&vmpr->sr_lock); in vmpressure_work_fn()
183 reclaimed = vmpr->reclaimed; in vmpressure_work_fn()
184 vmpr->scanned = 0; in vmpressure_work_fn()
185 vmpr->reclaimed = 0; in vmpressure_work_fn()
186 spin_unlock(&vmpr->sr_lock); in vmpressure_work_fn()
189 if (vmpressure_event(vmpr, scanned, reclaimed)) in vmpressure_work_fn()
195 } while ((vmpr = vmpressure_parent(vmpr))); in vmpressure_work_fn()
214 struct vmpressure *vmpr = memcg_to_vmpressure(memcg); in vmpressure() local
241 spin_lock(&vmpr->sr_lock); in vmpressure()
242 vmpr->scanned += scanned; in vmpressure()
243 vmpr->reclaimed += reclaimed; in vmpressure()
244 scanned = vmpr->scanned; in vmpressure()
245 spin_unlock(&vmpr->sr_lock); in vmpressure()
249 schedule_work(&vmpr->work); in vmpressure()
299 struct vmpressure *vmpr = memcg_to_vmpressure(memcg); in vmpressure_register_event() local
318 mutex_lock(&vmpr->events_lock); in vmpressure_register_event()
319 list_add(&ev->node, &vmpr->events); in vmpressure_register_event()
320 mutex_unlock(&vmpr->events_lock); in vmpressure_register_event()
339 struct vmpressure *vmpr = memcg_to_vmpressure(memcg); in vmpressure_unregister_event() local
342 mutex_lock(&vmpr->events_lock); in vmpressure_unregister_event()
343 list_for_each_entry(ev, &vmpr->events, node) { in vmpressure_unregister_event()
350 mutex_unlock(&vmpr->events_lock); in vmpressure_unregister_event()
360 void vmpressure_init(struct vmpressure *vmpr) in vmpressure_init() argument
362 spin_lock_init(&vmpr->sr_lock); in vmpressure_init()
363 mutex_init(&vmpr->events_lock); in vmpressure_init()
364 INIT_LIST_HEAD(&vmpr->events); in vmpressure_init()
365 INIT_WORK(&vmpr->work, vmpressure_work_fn); in vmpressure_init()
375 void vmpressure_cleanup(struct vmpressure *vmpr) in vmpressure_cleanup() argument
381 flush_work(&vmpr->work); in vmpressure_cleanup()