All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Matt Helsley <matthltc@us.ibm.com>
Cc: Chris Wright <chrisw@sous-sol.org>,
	linux-mm@kvack.org, LKML <linux-kernel@vger.kernel.org>,
	Christoph Hellwig <hch@lst.de>,
	"Hallyn, Serge" <serue@us.ibm.com>,
	Peter Zijlstra <peterz@infradead.org>
Subject: Re: [PATCH] Simplify /proc/<pid|self>/exe symlink code
Date: Thu, 12 Jul 2007 19:21:14 -0700	[thread overview]
Message-ID: <20070712192114.bb357ce4.akpm@linux-foundation.org> (raw)
In-Reply-To: <1184292012.13479.14.camel@localhost.localdomain>

On Thu, 12 Jul 2007 19:00:12 -0700 Matt Helsley <matthltc@us.ibm.com> wrote:

> This patch avoids holding the mmap semaphore while walking VMAs in response to
> programs which read or follow the /proc/<pid|self>/exe symlink. This also allows
> us to merge mmu and nommu proc_exe_link() functions. The costs are holding the
> task lock, a separate reference to the executable file stored in the task
> struct, and increased code in fork, exec, and exit paths.
> 
> Signed-off-by: Matt Helsley <matthltc@us.ibm.com>
> ---
> 
> Changelog:
> 
> Hold task_lock() while using task->exe_file. With this change I haven't
> 	been able to reproduce Chris Wright's Oops report:
> 		http://lkml.org/lkml/2007/5/31/34 
> 	I used a 4-way, x86 system running kernbench. I also tried a 4-way x86_64
> 	system running pidof. I used oprofile during all runs but I could not
> 	reproduce Chris' Oops with the new patch.
> 
> Compiled and passed simple tests for regressions when patched against a 2.6.20
> and a 2.6.22 kernel. Regression tests included a variety of file operations on
> /proc/<pid|self>/exe such as stat, lstat, open, close, readlink, and unlink. All
> produced the expected, baseline output results.
> 
> Andrew, please consider this patch for inclusion in -mm.

I wish we had a description of the bug which this fixes.  That email of
Chris's is referencing code which diddles with task_struct.exe_file, but
your patch _adds_ task_struct.exe_file, so I am all confused.

Your patch does lots of fput()s under task_lock(), but fput() can sleep.

Plus what Al said.

WARNING: multiple messages have this Message-ID (diff)
From: Andrew Morton <akpm@linux-foundation.org>
To: Matt Helsley <matthltc@us.ibm.com>
Cc: Chris Wright <chrisw@sous-sol.org>,
	linux-mm@kvack.org, LKML <linux-kernel@vger.kernel.org>,
	Christoph Hellwig <hch@lst.de>,
	"Hallyn, Serge" <serue@us.ibm.com>,
	Peter Zijlstra <peterz@infradead.org>
Subject: Re: [PATCH] Simplify /proc/<pid|self>/exe symlink code
Date: Thu, 12 Jul 2007 19:21:14 -0700	[thread overview]
Message-ID: <20070712192114.bb357ce4.akpm@linux-foundation.org> (raw)
In-Reply-To: <1184292012.13479.14.camel@localhost.localdomain>

On Thu, 12 Jul 2007 19:00:12 -0700 Matt Helsley <matthltc@us.ibm.com> wrote:

> This patch avoids holding the mmap semaphore while walking VMAs in response to
> programs which read or follow the /proc/<pid|self>/exe symlink. This also allows
> us to merge mmu and nommu proc_exe_link() functions. The costs are holding the
> task lock, a separate reference to the executable file stored in the task
> struct, and increased code in fork, exec, and exit paths.
> 
> Signed-off-by: Matt Helsley <matthltc@us.ibm.com>
> ---
> 
> Changelog:
> 
> Hold task_lock() while using task->exe_file. With this change I haven't
> 	been able to reproduce Chris Wright's Oops report:
> 		http://lkml.org/lkml/2007/5/31/34 
> 	I used a 4-way, x86 system running kernbench. I also tried a 4-way x86_64
> 	system running pidof. I used oprofile during all runs but I could not
> 	reproduce Chris' Oops with the new patch.
> 
> Compiled and passed simple tests for regressions when patched against a 2.6.20
> and a 2.6.22 kernel. Regression tests included a variety of file operations on
> /proc/<pid|self>/exe such as stat, lstat, open, close, readlink, and unlink. All
> produced the expected, baseline output results.
> 
> Andrew, please consider this patch for inclusion in -mm.

I wish we had a description of the bug which this fixes.  That email of
Chris's is referencing code which diddles with task_struct.exe_file, but
your patch _adds_ task_struct.exe_file, so I am all confused.

Your patch does lots of fput()s under task_lock(), but fput() can sleep.

Plus what Al said.

--
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>

  parent reply	other threads:[~2007-07-13  2:22 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-13  2:00 [PATCH] Simplify /proc/<pid|self>/exe symlink code Matt Helsley
2007-07-13  2:00 ` Matt Helsley
2007-07-13  2:07 ` Al Viro
2007-07-13  2:07   ` Al Viro
2007-07-16 19:31   ` Matt Helsley
2007-07-16 19:31     ` Matt Helsley
2007-07-13  2:21 ` Andrew Morton [this message]
2007-07-13  2:21   ` Andrew Morton
2007-07-13 19:54   ` Matt Helsley
2007-07-13 19:54     ` Matt Helsley

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=20070712192114.bb357ce4.akpm@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=chrisw@sous-sol.org \
    --cc=hch@lst.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=matthltc@us.ibm.com \
    --cc=peterz@infradead.org \
    --cc=serue@us.ibm.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.