From: William Lee Irwin III <wli@holomorphy.com>
To: Andrew Morton <akpm@digeo.com>
Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org
Subject: Re: 2.5.73-mm2
Date: Sat, 28 Jun 2003 01:56:52 -0700 [thread overview]
Message-ID: <20030628085652.GW26348@holomorphy.com> (raw)
In-Reply-To: <20030627202130.066c183b.akpm@digeo.com>
On Fri, Jun 27, 2003 at 08:21:30PM -0700, Andrew Morton wrote:
> ftp://ftp.kernel.org/pub/linux/kernel/people/akpm/patches/2.5/2.5.73/2.5.73-mm2/
> Just bits and pieces.
This could almost be sent through rusty, but I think in general BKL
removal patches should go through whatever ringer -mm et al provide.
-- wli
Remove spurious BKL acquisitions in /proc/. The BKL is not required to
access nr_threads for reporting, and get_locks_status() takes it
internally, wrapping all operations with it.
diff -prauN wli-2.5.73-3/fs/proc/proc_misc.c wli-2.5.73-4/fs/proc/proc_misc.c
--- wli-2.5.73-3/fs/proc/proc_misc.c 2003-06-23 10:29:54.000000000 -0700
+++ wli-2.5.73-4/fs/proc/proc_misc.c 2003-06-23 10:32:25.000000000 -0700
@@ -497,11 +497,10 @@ static int ds1286_read_proc(char *page,
static int locks_read_proc(char *page, char **start, off_t off,
int count, int *eof, void *data)
{
- int len;
- lock_kernel();
- len = get_locks_status(page, start, off, count);
- unlock_kernel();
- if (len < count) *eof = 1;
+ int len = get_locks_status(page, start, off, count);
+
+ if (len < count)
+ *eof = 1;
return len;
}
diff -prauN wli-2.5.73-3/fs/proc/root.c wli-2.5.73-4/fs/proc/root.c
--- wli-2.5.73-3/fs/proc/root.c 2003-06-22 11:33:07.000000000 -0700
+++ wli-2.5.73-4/fs/proc/root.c 2003-06-23 10:32:25.000000000 -0700
@@ -81,11 +81,13 @@ void __init proc_root_init(void)
static struct dentry *proc_root_lookup(struct inode * dir, struct dentry * dentry)
{
- if (dir->i_ino == PROC_ROOT_INO) { /* check for safety... */
- lock_kernel();
+ /*
+ * nr_threads is actually protected by the tasklist_lock;
+ * however, it's conventional to do reads, especially for
+ * reporting, without any locking whatsoever.
+ */
+ if (dir->i_ino == PROC_ROOT_INO) /* check for safety... */
dir->i_nlink = proc_root.nlink + nr_threads;
- unlock_kernel();
- }
if (!proc_lookup(dir, dentry)) {
return NULL;
WARNING: multiple messages have this Message-ID (diff)
From: William Lee Irwin III <wli@holomorphy.com>
To: Andrew Morton <akpm@digeo.com>
Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org
Subject: Re: 2.5.73-mm2
Date: Sat, 28 Jun 2003 01:56:52 -0700 [thread overview]
Message-ID: <20030628085652.GW26348@holomorphy.com> (raw)
In-Reply-To: <20030627202130.066c183b.akpm@digeo.com>
On Fri, Jun 27, 2003 at 08:21:30PM -0700, Andrew Morton wrote:
> ftp://ftp.kernel.org/pub/linux/kernel/people/akpm/patches/2.5/2.5.73/2.5.73-mm2/
> Just bits and pieces.
This could almost be sent through rusty, but I think in general BKL
removal patches should go through whatever ringer -mm et al provide.
-- wli
Remove spurious BKL acquisitions in /proc/. The BKL is not required to
access nr_threads for reporting, and get_locks_status() takes it
internally, wrapping all operations with it.
diff -prauN wli-2.5.73-3/fs/proc/proc_misc.c wli-2.5.73-4/fs/proc/proc_misc.c
--- wli-2.5.73-3/fs/proc/proc_misc.c 2003-06-23 10:29:54.000000000 -0700
+++ wli-2.5.73-4/fs/proc/proc_misc.c 2003-06-23 10:32:25.000000000 -0700
@@ -497,11 +497,10 @@ static int ds1286_read_proc(char *page,
static int locks_read_proc(char *page, char **start, off_t off,
int count, int *eof, void *data)
{
- int len;
- lock_kernel();
- len = get_locks_status(page, start, off, count);
- unlock_kernel();
- if (len < count) *eof = 1;
+ int len = get_locks_status(page, start, off, count);
+
+ if (len < count)
+ *eof = 1;
return len;
}
diff -prauN wli-2.5.73-3/fs/proc/root.c wli-2.5.73-4/fs/proc/root.c
--- wli-2.5.73-3/fs/proc/root.c 2003-06-22 11:33:07.000000000 -0700
+++ wli-2.5.73-4/fs/proc/root.c 2003-06-23 10:32:25.000000000 -0700
@@ -81,11 +81,13 @@ void __init proc_root_init(void)
static struct dentry *proc_root_lookup(struct inode * dir, struct dentry * dentry)
{
- if (dir->i_ino == PROC_ROOT_INO) { /* check for safety... */
- lock_kernel();
+ /*
+ * nr_threads is actually protected by the tasklist_lock;
+ * however, it's conventional to do reads, especially for
+ * reporting, without any locking whatsoever.
+ */
+ if (dir->i_ino == PROC_ROOT_INO) /* check for safety... */
dir->i_nlink = proc_root.nlink + nr_threads;
- unlock_kernel();
- }
if (!proc_lookup(dir, dentry)) {
return NULL;
--
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:"aart@kvack.org"> aart@kvack.org </a>
next prev parent reply other threads:[~2003-06-28 8:42 UTC|newest]
Thread overview: 49+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-06-28 3:21 2.5.73-mm2 Andrew Morton
2003-06-28 3:21 ` 2.5.73-mm2 Andrew Morton
2003-06-28 8:56 ` William Lee Irwin III [this message]
2003-06-28 8:56 ` 2.5.73-mm2 William Lee Irwin III
2003-06-28 15:54 ` 2.5.73-mm2 William Lee Irwin III
2003-06-28 15:54 ` 2.5.73-mm2 William Lee Irwin III
2003-06-28 16:08 ` 2.5.73-mm2 Christoph Hellwig
2003-06-28 16:08 ` 2.5.73-mm2 Christoph Hellwig
2003-06-28 20:49 ` 2.5.73-mm2 William Lee Irwin III
2003-06-29 0:34 ` 2.5.73-mm2 Martin J. Bligh
2003-06-29 0:34 ` 2.5.73-mm2 Martin J. Bligh
2003-06-29 2:18 ` 2.5.73-mm2 William Lee Irwin III
2003-06-29 2:18 ` 2.5.73-mm2 William Lee Irwin III
2003-06-29 3:07 ` 2.5.73-mm2 Martin J. Bligh
2003-06-29 3:07 ` 2.5.73-mm2 Martin J. Bligh
2003-06-28 23:00 ` 2.5.73-mm2 Andrew Morton
2003-06-28 23:00 ` 2.5.73-mm2 Andrew Morton
2003-06-28 23:11 ` 2.5.73-mm2 William Lee Irwin III
2003-06-28 23:11 ` 2.5.73-mm2 William Lee Irwin III
2003-06-29 12:45 ` 2.5.73-mm2 Zwane Mwaikambo
2003-06-29 12:45 ` 2.5.73-mm2 Zwane Mwaikambo
2003-07-02 3:11 ` 2.5.73-mm2 William Lee Irwin III
2003-06-29 19:04 ` [patch] 2.5.73-mm2: let CONFIG_TC35815 depend on CONFIG_TOSHIBA_JMR3927 Adrian Bunk
2003-06-29 19:04 ` Adrian Bunk
2003-06-29 21:04 ` Ralf Baechle
2003-06-30 9:51 ` [linux-lvm] Re: 2.5.73-mm2 Wiktor Wodecki
2003-06-29 0:30 ` Andrew Morton
2003-06-30 9:51 ` Wiktor Wodecki
2003-06-30 10:23 ` Joe Thornber
2003-06-30 10:41 ` Wiktor Wodecki
2003-06-30 11:41 ` Heinz J . Mauelshagen
2003-06-30 12:29 ` Christophe Saout
2003-07-01 0:39 ` 2.5.73-mm2 William Lee Irwin III
2003-07-01 0:39 ` 2.5.73-mm2 William Lee Irwin III
2003-07-01 2:14 ` 2.5.73-mm2 Andrew Morton
2003-07-01 2:14 ` 2.5.73-mm2 Andrew Morton
2003-07-01 2:46 ` 2.5.73-mm2 William Lee Irwin III
2003-07-01 2:46 ` 2.5.73-mm2 William Lee Irwin III
2003-07-01 10:46 ` 2.5.73-mm2 Hugh Dickins
2003-07-01 10:46 ` 2.5.73-mm2 Hugh Dickins
2003-07-01 10:51 ` 2.5.73-mm2 William Lee Irwin III
2003-07-01 10:51 ` 2.5.73-mm2 William Lee Irwin III
2003-07-01 11:08 ` 2.5.73-mm2 Hugh Dickins
2003-07-01 11:08 ` 2.5.73-mm2 Hugh Dickins
2003-07-01 11:08 ` 2.5.73-mm2 William Lee Irwin III
2003-07-01 11:08 ` 2.5.73-mm2 William Lee Irwin III
2003-07-01 12:39 ` 2.5.73-mm2 Nikita Danilov
2003-07-01 12:39 ` 2.5.73-mm2 Nikita Danilov
2003-07-01 5:56 ` 2.5.73-mm2 William Lee Irwin III
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=20030628085652.GW26348@holomorphy.com \
--to=wli@holomorphy.com \
--cc=akpm@digeo.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 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.