From: David Rientjes <rientjes@google.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Dave Jones <davej@redhat.com>,
linux-kernel@vger.kernel.org, linux-mm@kvack.org
Subject: Re: [patch] mm, hugetlb: add thread name and pid to SHM_HUGETLB mlock rlimit warning
Date: Thu, 8 Mar 2012 14:08:30 -0800 (PST) [thread overview]
Message-ID: <alpine.DEB.2.00.1203081400340.23632@chino.kir.corp.google.com> (raw)
In-Reply-To: <20120308135643.225920ad.akpm@linux-foundation.org>
On Thu, 8 Mar 2012, Andrew Morton wrote:
> > We have a get_task_comm() that does the task_lock()
> > internally but requires a TASK_COMM_LEN buffer in the calling code. It's
> > just easier for the calling code to the task_lock() itself for a tiny
> > little printk().
>
> Well for a tiny little printk we could just omit the locking? The
> printk() won't oops and once in a million years one person will see a
> garbled comm[] string?
>
Sure, but task_lock() shouldn't be highly contended when the thread isn't
forking or exiting (everything else is attaching/detaching from a cgroup
or testing a mempolicy). I've always added it (like in the oom killer for
the same reason) just because the race exists. Taking it for every thread
on the system for one call to the oom killer has never slowed it down.
--
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/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next prev parent reply other threads:[~2012-03-08 22:08 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-07 2:26 David Rientjes
2012-03-08 20:02 ` Andrew Morton
2012-03-08 21:37 ` David Rientjes
2012-03-08 21:56 ` Andrew Morton
2012-03-08 22:08 ` David Rientjes [this message]
2012-03-08 22:23 ` Andrew Morton
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.DEB.2.00.1203081400340.23632@chino.kir.corp.google.com \
--to=rientjes@google.com \
--cc=akpm@linux-foundation.org \
--cc=davej@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.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