login
Login
/
Register
Search
Search this site:
Forums
News
Blogs
Features
Site
Home
»
Mailing list archives
»
linux-kernel
»
2008
»
October
»
2
Re: [PATCH] Give kjournald a IOPRIO_CLASS_RT io priority
view
thread
Previous message: [
thread
] [
date
] [
author
]
Next message: [
thread
] [
date
] [
author
]
[view in full thread]
From: Jens Axboe
Subject:
Re: [PATCH] Give kjournald a IOPRIO_CLASS_RT io priority
Date: Thursday, October 2, 2008 - 12:22 pm
On Thu, Oct 02 2008, Arjan van de Ven wrote:
quoted text
> On Thu, 2 Oct 2008 11:45:37 +0200 > Jens Axboe <jens.axboe@oracle.com> wrote: > > > > The RT folk were happy with the idea of journal I/O using the > > > highest non-RT priority for the journal, but I never got around > > > to testing that out as I had a bunnch of other stuff to fix at > > > the time. > > > > That's a good idea, just bump the priority a little bit. Arjan, did > > you test that out? I'd suggest just trying prio level 0 and still > > using best-effort scheduling. Probably still need the sync marking, > > would be interesting to experiment with though. > > > > ok 0 works ok enough in quick testing as well...... updated patch below > > From df64cc4e2ab0c102bbac609dd948958a6f804fd3 Mon Sep 17 00:00:00 2001 > From: Arjan van de Ven <arjan@linux.intel.com> > Date: Wed, 1 Oct 2008 19:58:18 -0700 > Subject: [PATCH] Give kjournald a higher io priority > > With latencytop, I noticed that the (in memory) file updates during my > workload (reading mail) had latencies of 6 seconds or longer; this is > obviously not so nice behavior. Other EXT3 journal related operations had > similar or even longer latencies. > > Digging into this a bit more, it appears to be an interaction between EXT3 > and CFQ in that CFQ tries to be fair to everyone, including kjournald. > However, in reality, kjournald is "special" in that it does a lot of journal > work and effectively this leads to a twisted kind of "mass priority > inversion" type of behavior. > > The good news is that CFQ already has the infrastructure to make certain > processes special... JBD just wasn't using that quite yet. > > The patch below makes kjournald of a slighlty higher priority than normal > applications, reducing these latencies significantly. > > Signed-off-by: Arjan van de Ven <arjan@linux.intel.com> > --- > fs/ioprio.c | 3 ++- > fs/jbd/journal.c | 12 ++++++++++++ > include/linux/ioprio.h | 2 ++ > 3 files changed, 16 insertions(+), 1 deletions(-) > > diff --git a/fs/ioprio.c b/fs/ioprio.c > index da3cc46..3bd95dc 100644 > --- a/fs/ioprio.c > +++ b/fs/ioprio.c > @@ -27,7 +27,7 @@ > #include <linux/security.h> > #include <linux/pid_namespace.h> > > -static int set_task_ioprio(struct task_struct *task, int ioprio) > +int set_task_ioprio(struct task_struct *task, int ioprio) > { > int err; > struct io_context *ioc; > @@ -64,6 +64,7 @@ static int set_task_ioprio(struct task_struct *task, int ioprio) > task_unlock(task); > return err; > } > +EXPORT_SYMBOL_GPL(set_task_ioprio); > > asmlinkage long sys_ioprio_set(int which, int who, int ioprio) > { > diff --git a/fs/jbd/journal.c b/fs/jbd/journal.c > index aa7143a..a859a46 100644 > --- a/fs/jbd/journal.c > +++ b/fs/jbd/journal.c > @@ -36,6 +36,7 @@ > #include <linux/poison.h> > #include <linux/proc_fs.h> > #include <linux/debugfs.h> > +#include <linux/ioprio.h> > > #include <asm/uaccess.h> > #include <asm/page.h> > @@ -131,6 +132,17 @@ static int kjournald(void *arg) > journal->j_commit_interval / HZ); > > /* > + * kjournald is the process on which most other processes depend on > + * for doing the filesystem portion of their IO. As such, there exists > + * the equivalent of a priority inversion situation, where kjournald > + * would get less priority as it should. > + * > + * For this reason we set to "medium real time priority", which is higher > + * than regular tasks, but not infinitely powerful. > + */ > + set_task_ioprio(current, IOPRIO_PRIO_VALUE(IOPRIO_CLASS_BE, 0)); > + > + /* > * And now, wait forever for commit wakeup events. > */ > spin_lock(&journal->j_state_lock); > diff --git a/include/linux/ioprio.h b/include/linux/ioprio.h > index f98a656..76dad48 100644 > --- a/include/linux/ioprio.h > +++ b/include/linux/ioprio.h > @@ -86,4 +86,6 @@ static inline int task_nice_ioclass(struct task_struct *task) > */ > extern int ioprio_best(unsigned short aprio, unsigned short bprio); > > +extern int set_task_ioprio(struct task_struct *task, int ioprio); > + > #endif > -- > 1.5.5.1
Can we agree on this patch? -- Jens Axboe --
unsubscribe notice
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to
majordomo@vger.kernel.org
More majordomo info at
http://vger.kernel.org/majordomo-info.html
Please read the FAQ at
http://www.tux.org/lkml/
Previous message: [
thread
] [
date
] [
author
]
Next message: [
thread
] [
date
] [
author
]
Messages in current thread:
[PATCH] Give kjournald a IOPRIO_CLASS_RT io priority
, Arjan van de Ven
, (Wed Oct 1, 8:00 pm)
Re: [PATCH] Give kjournald a IOPRIO_CLASS_RT io priority
, Andrew Morton
, (Wed Oct 1, 9:56 pm)
Re: [PATCH] Give kjournald a IOPRIO_CLASS_RT io priority
, Jens Axboe
, (Wed Oct 1, 11:27 pm)
Re: [PATCH] Give kjournald a IOPRIO_CLASS_RT io priority
, Andrew Morton
, (Wed Oct 1, 11:55 pm)
Re: [PATCH] Give kjournald a IOPRIO_CLASS_RT io priority
, Andi Kleen
, (Wed Oct 1, 11:57 pm)
Re: [PATCH] Give kjournald a IOPRIO_CLASS_RT io priority
, Jens Axboe
, (Thu Oct 2, 12:45 am)
Re: [PATCH] Give kjournald a IOPRIO_CLASS_RT io priority
, Jens Axboe
, (Thu Oct 2, 12:55 am)
Re: [PATCH] Give kjournald a IOPRIO_CLASS_RT io priority
, Andrew Morton
, (Thu Oct 2, 1:03 am)
Re: [PATCH] Give kjournald a IOPRIO_CLASS_RT io priority
, Jens Axboe
, (Thu Oct 2, 1:22 am)
Re: [PATCH] Give kjournald a IOPRIO_CLASS_RT io priority
, Andrew Morton
, (Thu Oct 2, 1:43 am)
Re: [PATCH] Give kjournald a IOPRIO_CLASS_RT io priority
, Jens Axboe
, (Thu Oct 2, 1:46 am)
Re: [PATCH] Give kjournald a IOPRIO_CLASS_RT io priority
, Dave Chinner
, (Thu Oct 2, 2:33 am)
Re: [PATCH] Give kjournald a IOPRIO_CLASS_RT io priority
, Jens Axboe
, (Thu Oct 2, 2:45 am)
Re: [PATCH] Give kjournald a IOPRIO_CLASS_RT io priority
, Theodore Tso
, (Thu Oct 2, 5:04 am)
Re: [PATCH] Give kjournald a IOPRIO_CLASS_RT io priority
, Arjan van de Ven
, (Thu Oct 2, 6:05 am)
Re: [PATCH] Give kjournald a IOPRIO_CLASS_RT io priority
, Arjan van de Ven
, (Thu Oct 2, 6:12 am)
Re: [PATCH] Give kjournald a IOPRIO_CLASS_RT io priority
, Arjan van de Ven
, (Thu Oct 2, 6:14 am)
Re: [PATCH] Give kjournald a IOPRIO_CLASS_RT io priority
, Arjan van de Ven
, (Thu Oct 2, 6:16 am)
Re: [PATCH] Give kjournald a IOPRIO_CLASS_RT io priority
, Jens Axboe
, (Thu Oct 2, 6:27 am)
Re: [PATCH] Give kjournald a IOPRIO_CLASS_RT io priority
, Arjan van de Ven
, (Thu Oct 2, 6:36 am)
Re: [PATCH] Give kjournald a IOPRIO_CLASS_RT io priority
, Theodore Tso
, (Thu Oct 2, 6:46 am)
Re: [PATCH] Give kjournald a IOPRIO_CLASS_RT io priority
, Jens Axboe
, (Thu Oct 2, 6:47 am)
Re: [PATCH] Give kjournald a IOPRIO_CLASS_RT io priority
, Arjan van de Ven
, (Thu Oct 2, 7:26 am)
Re: [PATCH] Give kjournald a IOPRIO_CLASS_RT io priority
, Arjan van de Ven
, (Thu Oct 2, 7:33 am)
Re: [PATCH] Give kjournald a IOPRIO_CLASS_RT io priority
, Jens Axboe
, (Thu Oct 2, 9:42 am)
Re: [PATCH] Give kjournald a IOPRIO_CLASS_RT io priority
, Jens Axboe
, (Thu Oct 2, 10:11 am)
Re: [PATCH] Give kjournald a IOPRIO_CLASS_RT io priority
, Arjan van de Ven
, (Thu Oct 2, 12:04 pm)
Re: [PATCH] Give kjournald a IOPRIO_CLASS_RT io priority
, Jens Axboe
, (Thu Oct 2, 12:22 pm)
Re: [PATCH] Give kjournald a IOPRIO_CLASS_RT io priority
, Andrew Morton
, (Thu Oct 2, 1:24 pm)
Re: [PATCH] Give kjournald a IOPRIO_CLASS_RT io priority
, Andrew Morton
, (Thu Oct 2, 2:37 pm)
Re: [PATCH] Give kjournald a IOPRIO_CLASS_RT io priority
, Dave Chinner
, (Thu Oct 2, 4:58 pm)
Re: [PATCH] Give kjournald a IOPRIO_CLASS_RT io priority
, Andrew Morton
, (Thu Oct 2, 5:06 pm)
Re: [PATCH] Give kjournald a IOPRIO_CLASS_RT io priority
, Andrew Morton
, (Thu Oct 2, 5:20 pm)
Re: [PATCH] Give kjournald a IOPRIO_CLASS_RT io priority
, Arjan van de Ven
, (Thu Oct 2, 9:01 pm)
Re: [PATCH] Give kjournald a IOPRIO_CLASS_RT io priority
, Arjan van de Ven
, (Thu Oct 2, 9:23 pm)
Re: [PATCH] Give kjournald a IOPRIO_CLASS_RT io priority
, Andrew Morton
, (Thu Oct 2, 9:40 pm)
Re: [PATCH] Give kjournald a IOPRIO_CLASS_RT io priority
, Arjan van de Ven
, (Thu Oct 2, 9:43 pm)
Re: [PATCH] Give kjournald a IOPRIO_CLASS_RT io priority
, Arjan van de Ven
, (Thu Oct 2, 9:45 pm)
Re: [PATCH] Give kjournald a IOPRIO_CLASS_RT io priority
, Andrew Morton
, (Thu Oct 2, 9:50 pm)
Re: [PATCH] Give kjournald a IOPRIO_CLASS_RT io priority
, Arjan van de Ven
, (Thu Oct 2, 10:00 pm)
Re: [PATCH] Give kjournald a IOPRIO_CLASS_RT io priority
, Andrew Morton
, (Thu Oct 2, 10:24 pm)
Re: [PATCH] Give kjournald a IOPRIO_CLASS_RT io priority
, Arjan van de Ven
, (Fri Oct 3, 10:21 am)
Re: [PATCH] Give kjournald a IOPRIO_CLASS_RT io priority
, Theodore Tso
, (Sat Oct 4, 7:12 am)
Re: [PATCH] Give kjournald a IOPRIO_CLASS_RT io priority
, Joseph Fannin
, (Sat Oct 4, 10:14 am)
Re: [PATCH] Give kjournald a IOPRIO_CLASS_RT io priority
, Theodore Tso
, (Sat Oct 4, 2:27 pm)
Re: [PATCH] Give kjournald a IOPRIO_CLASS_RT io priority
, Theodore Tso
, (Wed Oct 8, 8:00 pm)
Re: [PATCH] Give kjournald a IOPRIO_CLASS_RT io priority
, Andrew Morton
, (Wed Oct 8, 8:38 pm)
Navigation
Create content
Mailing list archives
Recent posts
Popular discussions
linux-kernel
:
Frederic Weisbecker
[PATCH v2] struct sort_entry has a callback named snprintf that turns an entry int...
FUJITA Tomonori
Re: [Scst-devel] Integration of SCST in the mainstream Linux kernel
Andrew Morton
Re: [PATCH v3 0/4] Introduce hardware spinlock framework
Ingo Molnar
Re: [GIT PULL] time.c - respin
Alexander van Heukelum
Re: [PATCH] bitops: simplify generic bit finding functions
git
:
Mark Junker
git on MacOSX and files with decomposed utf-8 file names
Junio C Hamano
Re: git-svnimport
Johannes Schindelin
Re: [PATCH] Fix approxidate("never") to always return 0
A Large Angry SCM
Re: [RFC] origin link for cherry-pick and revert
Michal Sojka
[PATCHv5 1/2] filter-branch: Fix to allow replacing submodules with another content
git-commits-head
:
Linux Kernel Mailing List
ath9k_htc: Allocate URBs properly
Linux Kernel Mailing List
sata_mv: drop unncessary EH callback resetting
Linux Kernel Mailing List
timer: Try to survive timer callback preempt_count leak
Linux Kernel Mailing List
powerpc/kexec: Add support for FSL-BookE
Linux Kernel Mailing List
ARM: 5670/1: bcmring: add default configuration for bcmring arch
linux-netdev
:
Arnaldo Carvalho de Melo
Re: [PATCH 06/37] dccp: Limit feature negotiation to connection setup phase
Gerrit Renker
[PATCH 1/5] dccp: Initialisation framework for feature negotiation
Daniel Lezcano
getsockopt(TCP_DEFER_ACCEPT) value change
David Miller
Re: 2.6.27.18: bnx2/tg3: BUG: "scheduling while atomic" trying to ifenslave a seco...
Gerrit Renker
[PATCH 37/37] dccp: Debugging functions for feature negotiation
openbsd-misc
:
Stephen J. Bevan
GRE over IPsec
Rene Maroufi
smtpd: Aliases only work with for local alias aliases
Christophe Rioux
Implementation example of snmp
Darrin Chandler
Re: strange output on openbsd C code
Nick Holland
Re: booting openbsd on eee without cd-rom
Colocation donated by:
Syndicate