From: Oleg Nesterov <oleg@tv-sign.ru>
To: Jens Axboe <axboe@suse.de>
Cc: Andrew Morton <akpm@osdl.org>, linux-kernel@vger.kernel.org
Subject: [PATCH] sys_ioprio_set: don't disable irqs
Date: Mon, 21 Aug 2006 00:43:45 +0400 [thread overview]
Message-ID: <20060820204345.GA5750@oleg> (raw)
It is not good to disable interrupts while traversing all tasks in the
system. As I see it, sys_ioprio_get() doesn't need to cli() at all,
sys_ioprio_set() does it for cfq_ioc_set_ioprio() which can do it itself.
Signed-off-by: Oleg Nesterov <oleg@tv-sign.ru>
--- 2.6.18-rc4/block/cfq-iosched.c~5_setpr 2006-08-09 22:00:44.000000000 +0400
+++ 2.6.18-rc4/block/cfq-iosched.c 2006-08-20 21:23:25.000000000 +0400
@@ -1421,14 +1421,14 @@ static inline void changed_ioprio(struct
}
/*
- * callback from sys_ioprio_set, irqs are disabled
+ * callback from sys_ioprio_set.
*/
static int cfq_ioc_set_ioprio(struct io_context *ioc, unsigned int ioprio)
{
struct cfq_io_context *cic;
struct rb_node *n;
- spin_lock(&cfq_exit_lock);
+ spin_lock_irq(&cfq_exit_lock);
n = rb_first(&ioc->cic_root);
while (n != NULL) {
@@ -1438,7 +1438,7 @@ static int cfq_ioc_set_ioprio(struct io_
n = rb_next(n);
}
- spin_unlock(&cfq_exit_lock);
+ spin_unlock_irq(&cfq_exit_lock);
return 0;
}
--- 2.6.18-rc4/fs/ioprio.c~5_setpr 2006-08-20 20:16:39.000000000 +0400
+++ 2.6.18-rc4/fs/ioprio.c 2006-08-20 21:21:26.000000000 +0400
@@ -81,7 +81,7 @@ asmlinkage long sys_ioprio_set(int which
}
ret = -ESRCH;
- read_lock_irq(&tasklist_lock);
+ read_lock(&tasklist_lock);
switch (which) {
case IOPRIO_WHO_PROCESS:
if (!who)
@@ -124,7 +124,7 @@ free_uid:
ret = -EINVAL;
}
- read_unlock_irq(&tasklist_lock);
+ read_unlock(&tasklist_lock);
return ret;
}
@@ -170,7 +170,7 @@ asmlinkage long sys_ioprio_get(int which
int ret = -ESRCH;
int tmpio;
- read_lock_irq(&tasklist_lock);
+ read_lock(&tasklist_lock);
switch (which) {
case IOPRIO_WHO_PROCESS:
if (!who)
@@ -221,7 +221,7 @@ asmlinkage long sys_ioprio_get(int which
ret = -EINVAL;
}
- read_unlock_irq(&tasklist_lock);
+ read_unlock(&tasklist_lock);
return ret;
}
next reply other threads:[~2006-08-20 16:19 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-08-20 20:43 Oleg Nesterov [this message]
2006-08-20 20:50 ` [PATCH] sys_ioprio_set: don't disable irqs Oleg Nesterov
2006-08-21 22:48 ` Andrew Morton
2006-08-22 17:22 ` [PATCH] elv_unregister: fix possible crash on module unload Oleg Nesterov
2006-08-22 13:05 ` Jens Axboe
2006-08-22 17:57 ` [PATCH] sys_ioprio_set: don't disable irqs Oleg Nesterov
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=20060820204345.GA5750@oleg \
--to=oleg@tv-sign.ru \
--cc=akpm@osdl.org \
--cc=axboe@suse.de \
--cc=linux-kernel@vger.kernel.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;
as well as URLs for NNTP newsgroup(s).