mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Neeraj Upadhyay <Neeraj.Upadhyay@amd.com>
To: <john.johansen@canonical.com>, <paul@paul-moore.com>,
	<jmorris@namei.org>, <serge@hallyn.com>
Cc: <linux-security-module@vger.kernel.org>,
	<apparmor@lists.ubuntu.com>, <linux-kernel@vger.kernel.org>,
	<gautham.shenoy@amd.com>, <Santosh.Shukla@amd.com>,
	<Ananth.Narayan@amd.com>, <raghavendra.kodsarathimmappa@amd.com>,
	<paulmck@kernel.org>, <boqun.feng@gmail.com>,
	<vinicius.gomes@intel.com>, <mjguzik@gmail.com>,
	Neeraj Upadhyay <Neeraj.Upadhyay@amd.com>
Subject: [RFC 5/9] apparmor: Switch intree labels to percpu mode
Date: Wed, 10 Jan 2024 16:48:52 +0530	[thread overview]
Message-ID: <20240110111856.87370-5-Neeraj.Upadhyay@amd.com> (raw)
In-Reply-To: <f184a2d6-7892-4e43-a0cd-cab638c3d5c2@amd.com>

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 --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);
 }
-- 
2.34.1


  parent reply	other threads:[~2024-01-10 11:22 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-10 11:11 [RFC 0/9] Nginx refcount scalability issue with Apparmor enabled and potential solutions Neeraj Upadhyay
2024-01-10 11:18 ` [RFC 1/9] doc: Add document for apparmor refcount management Neeraj Upadhyay
2024-01-10 11:18 ` [RFC 2/9] apparmor: Switch labels to percpu refcount in atomic mode Neeraj Upadhyay
2024-01-10 11:18 ` [RFC 3/9] apparmor: Switch unconfined namespaces refcount to percpu mode Neeraj Upadhyay
2024-01-10 11:18 ` [RFC 4/9] apparmor: Add infrastructure to reclaim percpu labels Neeraj Upadhyay
2024-01-10 11:18 ` Neeraj Upadhyay [this message]
2024-01-10 11:18 ` [RFC 6/9] apparmor: Initial prototype for optimizing ref switch Neeraj Upadhyay
2024-01-10 11:18 ` [RFC 7/9] percpu-rcuref: Add basic infrastructure Neeraj Upadhyay
2024-01-10 11:18 ` [RFC 8/9] apparmor: Switch labels to percpu rcurefcount in unmanaged mode Neeraj Upadhyay
2024-01-10 11:18 ` [RFC 9/9] apparmor: Switch unconfined and in tree labels to managed ref mode Neeraj Upadhyay
2024-02-07  4:40 ` [RFC 0/9] Nginx refcount scalability issue with Apparmor enabled and potential solutions Neeraj Upadhyay
2024-02-09 17:33   ` John Johansen
2024-03-02 10:23     ` Mateusz Guzik
2024-03-08 20:09       ` John Johansen
2024-05-24 21:10         ` Mateusz Guzik
2024-05-24 21:51           ` John Johansen
2024-05-28 13:29             ` Mateusz Guzik
2024-05-29  0:37               ` John Johansen
2024-05-29  9:38                 ` Mateusz Guzik
2024-05-30  4:19                 ` Neeraj Upadhyay
2024-05-30  5:59                   ` John Johansen
2024-05-30  9:47                     ` Mateusz Guzik
2024-05-31  0:17                       ` John Johansen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240110111856.87370-5-Neeraj.Upadhyay@amd.com \
    --to=neeraj.upadhyay@amd.com \
    --cc=Ananth.Narayan@amd.com \
    --cc=Santosh.Shukla@amd.com \
    --cc=apparmor@lists.ubuntu.com \
    --cc=boqun.feng@gmail.com \
    --cc=gautham.shenoy@amd.com \
    --cc=jmorris@namei.org \
    --cc=john.johansen@canonical.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-security-module@vger.kernel.org \
    --cc=mjguzik@gmail.com \
    --cc=paul@paul-moore.com \
    --cc=paulmck@kernel.org \
    --cc=raghavendra.kodsarathimmappa@amd.com \
    --cc=serge@hallyn.com \
    --cc=vinicius.gomes@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®