From: Paul Jackson <pj@sgi.com>
To: Andrew Morton <akpm@osdl.org>
Cc: Dinakar Guniguntala <dino@in.ibm.com>,
Linus Torvalds <torvalds@osdl.org>,
Simon Derr <Simon.Derr@bull.net>, Paul Jackson <pj@sgi.com>,
linux-kernel@vger.kernel.org
Subject: [PATCH 2.6.12-rc4] cpuset rmdir scheduling while atomic fix
Date: Thu, 26 May 2005 01:25:16 -0700 (PDT) [thread overview]
Message-ID: <20050526082516.927.6806.sendpatchset@tomahawk.engr.sgi.com> (raw)
Andrew,
This fixes a complaint that I am seeing while running
a particular stress test. Please push it along at your
convenience.
The cpuset kernel code can generate a "scheduling while atomic"
complaint from the cpuset_rmdir code. This complaint means
that we had to sleep while trying to get the cpuset_sem global
semaphore during the handling of a 'rmdir()' call to remove
a cpuset.
The existing code tries to take the global cpuset_sem semaphore
while holding a dentry spinlock. The fix is easy enough -
the code that requires cpuset_sem can be moved below the point
where the dentry spinlock is released.
This bug is usually only seen when running stress tests or
loads causing rapid cpuset creation and deletion and queries.
The following fix has been tested using a current -linus git
kernel. Without the fix, I have a stress test that generates a
scheduling while atomic complaint every few seconds. With the
fix, I've seen no more complaints in several hours of the same
stress test.
Signed-off-by: Paul Jackson <pj@sgi.com>
Index: 2.6-cpuset_path_fix/kernel/cpuset.c
===================================================================
--- 2.6-cpuset_path_fix.orig/kernel/cpuset.c 2005-05-20 22:11:48.000000000 -0700
+++ 2.6-cpuset_path_fix/kernel/cpuset.c 2005-05-20 22:12:15.000000000 -0700
@@ -1320,11 +1320,11 @@ static int cpuset_rmdir(struct inode *un
parent = cs->parent;
set_bit(CS_REMOVED, &cs->flags);
list_del(&cs->sibling); /* delete my sibling from parent->children */
- if (list_empty(&parent->children))
- check_for_release(parent);
d = dget(cs->dentry);
cs->dentry = NULL;
spin_unlock(&d->d_lock);
+ if (list_empty(&parent->children))
+ check_for_release(parent);
cpuset_d_remove_dir(d);
dput(d);
up(&cpuset_sem);
--
--
I won't rest till it's the best ...
Programmer, Linux Scalability
Paul Jackson <pj@sgi.com> 1.650.933.1373
next reply other threads:[~2005-05-26 8:25 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-05-26 8:25 Paul Jackson [this message]
2005-05-26 12:41 ` [PATCH 2.6.12-rc4] cpuset rmdir scheduling while atomic fix Dinakar Guniguntala
2005-05-26 14:33 ` Dinakar Guniguntala
2005-05-26 18:26 ` Paul Jackson
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=20050526082516.927.6806.sendpatchset@tomahawk.engr.sgi.com \
--to=pj@sgi.com \
--cc=Simon.Derr@bull.net \
--cc=akpm@osdl.org \
--cc=dino@in.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=torvalds@osdl.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