diff mbox series

[RFC,5/9] apparmor: Switch intree labels to percpu mode

Message ID 20240110111856.87370-5-Neeraj.Upadhyay@amd.com (mailing list archive)
State Handled Elsewhere
Headers show
Series Nginx refcount scalability issue with Apparmor enabled and potential solutions | expand

Commit Message

Neeraj Upadhyay Jan. 10, 2024, 11:18 a.m. UTC
Now that we have an infrastructure to reclaim
the percpu labels, switch intree labels to
percpu mode, to improve the ref scalability.

Signed-off-by: Neeraj Upadhyay <Neeraj.Upadhyay@amd.com>
---
 security/apparmor/label.c | 2 ++
 1 file changed, 2 insertions(+)
diff mbox series

Patch

diff --git a/security/apparmor/label.c b/security/apparmor/label.c
index aa9e6eac3ecc..1299262f54e1 100644
--- a/security/apparmor/label.c
+++ b/security/apparmor/label.c
@@ -710,6 +710,8 @@  static struct aa_label *__label_insert(struct aa_labelset *ls,
 	rb_link_node(&label->node, parent, new);
 	rb_insert_color(&label->node, &ls->root);
 	label->flags |= FLAG_IN_TREE;
+	percpu_ref_switch_to_percpu(&label->count);
+	aa_label_reclaim_add_label(label);
 
 	return aa_get_label(label);
 }