Lines Matching refs:rdtgrp

153 	struct rdtgroup *rdtgrp, *rdtgrp_match = NULL;  in region_find_by_minor()  local
155 list_for_each_entry(rdtgrp, &rdt_all_groups, rdtgroup_list) { in region_find_by_minor()
156 if (rdtgrp->plr && rdtgrp->plr->minor == minor) { in region_find_by_minor()
157 rdtgrp_match = rdtgrp; in region_find_by_minor()
320 static int pseudo_lock_init(struct rdtgroup *rdtgrp) in pseudo_lock_init() argument
330 rdtgrp->plr = plr; in pseudo_lock_init()
387 static void pseudo_lock_free(struct rdtgroup *rdtgrp) in pseudo_lock_free() argument
389 pseudo_lock_region_clear(rdtgrp->plr); in pseudo_lock_free()
390 kfree(rdtgrp->plr); in pseudo_lock_free()
391 rdtgrp->plr = NULL; in pseudo_lock_free()
415 struct rdtgroup *rdtgrp = _rdtgrp; in pseudo_lock_fn() local
416 struct pseudo_lock_region *plr = rdtgrp->plr; in pseudo_lock_fn()
474 __wrmsr(IA32_PQR_ASSOC, rmid_p, rdtgrp->closid); in pseudo_lock_fn()
528 static int rdtgroup_monitor_in_progress(struct rdtgroup *rdtgrp) in rdtgroup_monitor_in_progress() argument
530 return !list_empty(&rdtgrp->mon.crdtgrp_list); in rdtgroup_monitor_in_progress()
548 static int rdtgroup_locksetup_user_restrict(struct rdtgroup *rdtgrp) in rdtgroup_locksetup_user_restrict() argument
552 ret = rdtgroup_kn_mode_restrict(rdtgrp, "tasks"); in rdtgroup_locksetup_user_restrict()
556 ret = rdtgroup_kn_mode_restrict(rdtgrp, "cpus"); in rdtgroup_locksetup_user_restrict()
560 ret = rdtgroup_kn_mode_restrict(rdtgrp, "cpus_list"); in rdtgroup_locksetup_user_restrict()
565 ret = rdtgroup_kn_mode_restrict(rdtgrp, "mon_groups"); in rdtgroup_locksetup_user_restrict()
574 rdtgroup_kn_mode_restore(rdtgrp, "cpus_list", 0777); in rdtgroup_locksetup_user_restrict()
576 rdtgroup_kn_mode_restore(rdtgrp, "cpus", 0777); in rdtgroup_locksetup_user_restrict()
578 rdtgroup_kn_mode_restore(rdtgrp, "tasks", 0777); in rdtgroup_locksetup_user_restrict()
595 static int rdtgroup_locksetup_user_restore(struct rdtgroup *rdtgrp) in rdtgroup_locksetup_user_restore() argument
599 ret = rdtgroup_kn_mode_restore(rdtgrp, "tasks", 0777); in rdtgroup_locksetup_user_restore()
603 ret = rdtgroup_kn_mode_restore(rdtgrp, "cpus", 0777); in rdtgroup_locksetup_user_restore()
607 ret = rdtgroup_kn_mode_restore(rdtgrp, "cpus_list", 0777); in rdtgroup_locksetup_user_restore()
612 ret = rdtgroup_kn_mode_restore(rdtgrp, "mon_groups", 0777); in rdtgroup_locksetup_user_restore()
621 rdtgroup_kn_mode_restrict(rdtgrp, "cpus_list"); in rdtgroup_locksetup_user_restore()
623 rdtgroup_kn_mode_restrict(rdtgrp, "cpus"); in rdtgroup_locksetup_user_restore()
625 rdtgroup_kn_mode_restrict(rdtgrp, "tasks"); in rdtgroup_locksetup_user_restore()
648 int rdtgroup_locksetup_enter(struct rdtgroup *rdtgrp) in rdtgroup_locksetup_enter() argument
656 if (rdtgrp == &rdtgroup_default) { in rdtgroup_locksetup_enter()
703 if (rdtgroup_monitor_in_progress(rdtgrp)) { in rdtgroup_locksetup_enter()
708 if (rdtgroup_tasks_assigned(rdtgrp)) { in rdtgroup_locksetup_enter()
713 if (!cpumask_empty(&rdtgrp->cpu_mask)) { in rdtgroup_locksetup_enter()
718 if (rdtgroup_locksetup_user_restrict(rdtgrp)) { in rdtgroup_locksetup_enter()
723 ret = pseudo_lock_init(rdtgrp); in rdtgroup_locksetup_enter()
735 free_rmid(rdtgrp->mon.rmid); in rdtgroup_locksetup_enter()
741 rdtgroup_locksetup_user_restore(rdtgrp); in rdtgroup_locksetup_enter()
755 int rdtgroup_locksetup_exit(struct rdtgroup *rdtgrp) in rdtgroup_locksetup_exit() argument
765 rdtgrp->mon.rmid = ret; in rdtgroup_locksetup_exit()
768 ret = rdtgroup_locksetup_user_restore(rdtgrp); in rdtgroup_locksetup_exit()
770 free_rmid(rdtgrp->mon.rmid); in rdtgroup_locksetup_exit()
774 pseudo_lock_free(rdtgrp); in rdtgroup_locksetup_exit()
1151 static int pseudo_lock_measure_cycles(struct rdtgroup *rdtgrp, int sel) in pseudo_lock_measure_cycles() argument
1153 struct pseudo_lock_region *plr = rdtgrp->plr; in pseudo_lock_measure_cycles()
1161 if (rdtgrp->flags & RDT_DELETED) { in pseudo_lock_measure_cycles()
1222 struct rdtgroup *rdtgrp = file->private_data; in pseudo_lock_measure_trigger() local
1240 ret = pseudo_lock_measure_cycles(rdtgrp, sel); in pseudo_lock_measure_trigger()
1271 int rdtgroup_pseudo_lock_create(struct rdtgroup *rdtgrp) in rdtgroup_pseudo_lock_create() argument
1273 struct pseudo_lock_region *plr = rdtgrp->plr; in rdtgroup_pseudo_lock_create()
1291 thread = kthread_create_on_node(pseudo_lock_fn, rdtgrp, in rdtgroup_pseudo_lock_create()
1336 plr->debugfs_dir = debugfs_create_dir(rdtgrp->kn->name, in rdtgroup_pseudo_lock_create()
1340 plr->debugfs_dir, rdtgrp, in rdtgroup_pseudo_lock_create()
1346 rdtgrp, "%s", rdtgrp->kn->name); in rdtgroup_pseudo_lock_create()
1358 if (rdtgrp->flags & RDT_DELETED) { in rdtgroup_pseudo_lock_create()
1365 rdtgrp->mode = RDT_MODE_PSEUDO_LOCKED; in rdtgroup_pseudo_lock_create()
1366 closid_free(rdtgrp->closid); in rdtgroup_pseudo_lock_create()
1367 rdtgroup_kn_mode_restore(rdtgrp, "cpus", 0444); in rdtgroup_pseudo_lock_create()
1368 rdtgroup_kn_mode_restore(rdtgrp, "cpus_list", 0444); in rdtgroup_pseudo_lock_create()
1400 void rdtgroup_pseudo_lock_remove(struct rdtgroup *rdtgrp) in rdtgroup_pseudo_lock_remove() argument
1402 struct pseudo_lock_region *plr = rdtgrp->plr; in rdtgroup_pseudo_lock_remove()
1404 if (rdtgrp->mode == RDT_MODE_PSEUDO_LOCKSETUP) { in rdtgroup_pseudo_lock_remove()
1409 closid_free(rdtgrp->closid); in rdtgroup_pseudo_lock_remove()
1414 debugfs_remove_recursive(rdtgrp->plr->debugfs_dir); in rdtgroup_pseudo_lock_remove()
1419 pseudo_lock_free(rdtgrp); in rdtgroup_pseudo_lock_remove()
1424 struct rdtgroup *rdtgrp; in pseudo_lock_dev_open() local
1428 rdtgrp = region_find_by_minor(iminor(inode)); in pseudo_lock_dev_open()
1429 if (!rdtgrp) { in pseudo_lock_dev_open()
1434 filp->private_data = rdtgrp; in pseudo_lock_dev_open()
1435 atomic_inc(&rdtgrp->waitcount); in pseudo_lock_dev_open()
1446 struct rdtgroup *rdtgrp; in pseudo_lock_dev_release() local
1449 rdtgrp = filp->private_data; in pseudo_lock_dev_release()
1450 WARN_ON(!rdtgrp); in pseudo_lock_dev_release()
1451 if (!rdtgrp) { in pseudo_lock_dev_release()
1456 atomic_dec(&rdtgrp->waitcount); in pseudo_lock_dev_release()
1476 struct rdtgroup *rdtgrp; in pseudo_lock_dev_mmap() local
1482 rdtgrp = filp->private_data; in pseudo_lock_dev_mmap()
1483 WARN_ON(!rdtgrp); in pseudo_lock_dev_mmap()
1484 if (!rdtgrp) { in pseudo_lock_dev_mmap()
1489 plr = rdtgrp->plr; in pseudo_lock_dev_mmap()
1553 struct rdtgroup *rdtgrp; in pseudo_lock_devnode() local
1555 rdtgrp = dev_get_drvdata(dev); in pseudo_lock_devnode()
1558 return kasprintf(GFP_KERNEL, "pseudo_lock/%s", rdtgrp->kn->name); in pseudo_lock_devnode()