public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: David Howells <dhowells@redhat.com>
To: Oleg Nesterov <oleg@redhat.com>
Cc: dhowells@redhat.com, Alexey Gladkov <legion@kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	Mateusz Guzik <mjguzik@gmail.com>,
	"Paul E. McKenney" <paulmck@kernel.org>,
	linux-kernel@vger.kernel.org
Subject: Re: [RFC 2/1] kill task_ucounts()->rcu_read_lock(), add __task_ucounts()
Date: Mon, 27 Oct 2025 14:55:56 +0000	[thread overview]
Message-ID: <2258932.1761576956@warthog.procyon.org.uk> (raw)
In-Reply-To: <20251026143501.GA22472@redhat.com>

Oleg Nesterov <oleg@redhat.com> wrote:

> So I think task_ucounts() can just do
> 
> 	/* The caller must ensure that ->real_cred is stable or take rcu_read_lock() */
> 	#define task_ucounts(task)	\
> 		rcu_dereference_check((task)->real_cred, 1)->ucounts

Can you use rcu_access_pointer() within exit.c?  E.g.:

	struct cred *pcreds = rcu_access_pointer(task->real_cred);
	dec_rlimit_ucounts(pcreds->ucounts, UCOUNT_RLIMIT_NPROC, 1);

David


  parent reply	other threads:[~2025-10-27 14:56 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-26 14:31 [PATCH 1/1] release_task: kill unnecessary rcu_read_lock() around dec_rlimit_ucounts() Oleg Nesterov
2025-10-26 14:35 ` [RFC 2/1] kill task_ucounts()->rcu_read_lock(), add __task_ucounts() Oleg Nesterov
2025-10-26 14:49   ` Mateusz Guzik
2025-10-27 14:55   ` David Howells [this message]
2025-10-27 15:18     ` Paul E. McKenney
2025-10-26 15:44 ` [PATCH 1/1] release_task: kill unnecessary rcu_read_lock() around dec_rlimit_ucounts() Alexey Gladkov
2025-10-27 14:51 ` David Howells

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=2258932.1761576956@warthog.procyon.org.uk \
    --to=dhowells@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=legion@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mjguzik@gmail.com \
    --cc=oleg@redhat.com \
    --cc=paulmck@kernel.org \
    /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