From: Thomas Gleixner <tglx@linutronix.de>
To: David Howells <dhowells@redhat.com>
Cc: LKML <linux-kernel@vger.kernel.org>,
"Paul E. McKenney" <paulmck@linux.vnet.ibm.com>,
Dipankar Sarma <dipankar@in.ibm.com>, Ingo Molnar <mingo@elte.hu>,
Peter Zijlstra <peterz@infradead.org>,
Oleg Nesterov <oleg@tv-sign.ru>,
Al Viro <viro@zeniv.linux.org.uk>,
James Morris <jmorris@namei.org>,
Andrew Morton <akpm@linux-foundation.org>,
Linus Torvalds <torvalds@linux-foundation.org>,
linux-mm@kvack.org
Subject: Re: [patch 4/9] oom: Add missing rcu protection of __task_cred() in dump_tasks
Date: Fri, 11 Dec 2009 14:52:48 +0100 (CET) [thread overview]
Message-ID: <alpine.LFD.2.00.0912111452360.3089@localhost.localdomain> (raw)
In-Reply-To: <13284.1260539371@redhat.com>
On Fri, 11 Dec 2009, David Howells wrote:
> Thomas Gleixner <tglx@linutronix.de> wrote:
>
> > + /* Protect __task_cred() access */
> > + rcu_read_lock();
> > printk(KERN_INFO "[%5d] %5d %5d %8lu %8lu %3d %3d %s\n",
> > p->pid, __task_cred(p)->uid, p->tgid, mm->total_vm,
> > get_mm_rss(mm), (int)task_cpu(p), p->signal->oom_adj,
> > p->comm);
> > + rcu_read_unlock();
>
> No. If there's only one access to __task_cred() like this, use
> task_cred_xxx() or one of its wrappers instead:
>
> - p->pid, __task_cred(p)->uid, p->tgid, mm->total_vm,
> + p->pid, task_uid(p), p->tgid, mm->total_vm,
>
> that limits the size of the critical section.
Fair enough.
tglx
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
prev parent reply other threads:[~2009-12-11 13:53 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20091210001308.247025548@linutronix.de>
2009-12-10 0:53 ` Thomas Gleixner
2009-12-10 1:57 ` KOSAKI Motohiro
2009-12-11 13:49 ` David Howells
2009-12-11 13:52 ` Thomas Gleixner [this message]
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=alpine.LFD.2.00.0912111452360.3089@localhost.localdomain \
--to=tglx@linutronix.de \
--cc=akpm@linux-foundation.org \
--cc=dhowells@redhat.com \
--cc=dipankar@in.ibm.com \
--cc=jmorris@namei.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mingo@elte.hu \
--cc=oleg@tv-sign.ru \
--cc=paulmck@linux.vnet.ibm.com \
--cc=peterz@infradead.org \
--cc=torvalds@linux-foundation.org \
--cc=viro@zeniv.linux.org.uk \
/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