Content-Type: multipart/related; start=; boundary=----------PoEth15OrN5KIwzn19Im8k Content-Location: http://marc.info/?l=linux-rt-users&m=121744932311062&w=2 Subject: =?utf-8?Q?'Re:=20[PATCH]=20Fix=20Bug=20messages'=20-=20MARC?= MIME-Version: 1.0 ------------PoEth15OrN5KIwzn19Im8k Content-Disposition: inline; filename=default.htm Content-Type: text/html; name=default.htm Content-Id: Content-Location: http://marc.info/?l=linux-rt-users&m=121744932311062&w=2 Content-Transfer-Encoding: 8bit 'Re: [PATCH] Fix Bug messages' - MARC
[prev in list] [next in list] [prev in thread] [next in thread] 

List:       linux-rt-users
Subject:    Re: [PATCH] Fix Bug messages
From:       Jürgen_Mell <j.mell () t-online ! de>
Date:       2008-07-30 20:16:50
Message-ID: 200807302216.51211.j.mell () t-online ! de
[Download message RAW]

On Mittwoch, 30. Juli 2008, Chirag Jog wrote:
> * J?rgen Mell <j.mell@email-addr-hidden-online.de> [2008-07-30 11:01:32]:
> > On Wednesday, 30. July 2008, Thomas Gleixner wrote:
> > > We are pleased to announce the 2.6.26-rt1 tree, which can be
> > > downloaded from the location:
> >
> > The bad news: It produces continuously lots of bug messages in the
> > error logs (cf. attached dmesg.tgz). The error at rtmutex.c:743 was
> > already present in 2.6.25-rt* when ACPI was enabled. The 'using
> > smp_processor_id ()  in preemptible code' is new here with 2.6.26.
> >
>
> This patch should solve some of the bug messages.
> It does two things:
> 1. Change rt_runtime_lock to be a raw spinlock as the comment above it
> says: it is nested inside the rq lock.
>
> 2. Change mnt_writers to be a per_cpu locked variable.
> This eliminates the need for the codepath to disable preemption and
> then potentially sleep, leading to the BUG messages
>
> Signed-Off-By: Chirag <chirag@email-addr-hidden>
>
>
>
> Index: linux-2.6.26-rt1/kernel/sched.c
> ===================================================================
> --- linux-2.6.26-rt1.orig/kernel/sched.c	2008-07-30 22:37:19.000000000
> +0530 +++ linux-2.6.26-rt1/kernel/sched.c	2008-07-30 22:37:24.000000000
> +0530 @@ -208,7 +208,7 @@
>
>  struct rt_bandwidth {
>  	/* nests inside the rq lock: */
> -	spinlock_t		rt_runtime_lock;
> +	raw_spinlock_t		rt_runtime_lock;
>  	ktime_t			rt_period;
>  	u64			rt_runtime;
>  	struct hrtimer		rt_period_timer;
> @@ -472,7 +472,7 @@
>  	u64 rt_time;
>  	u64 rt_runtime;
>  	/* Nests inside the rq lock: */
> -	spinlock_t rt_runtime_lock;
> +	raw_spinlock_t rt_runtime_lock;
>
>  #ifdef CONFIG_RT_GROUP_SCHED
>  	unsigned long rt_nr_boosted;
> Index: linux-2.6.26-rt1/fs/namespace.c
> ===================================================================
> --- linux-2.6.26-rt1.orig/fs/namespace.c	2008-07-30 22:39:30.000000000
> +0530 +++ linux-2.6.26-rt1/fs/namespace.c	2008-07-30 22:39:36.000000000
> +0530 @@ -178,13 +178,13 @@
>  	unsigned long count;
>  	struct vfsmount *mnt;
>  } ____cacheline_aligned_in_smp;
> -static DEFINE_PER_CPU(struct mnt_writer, mnt_writers);
> +static DEFINE_PER_CPU_LOCKED(struct mnt_writer, mnt_writers);
>
>  static int __init init_mnt_writers(void)
>  {
>  	int cpu;
>  	for_each_possible_cpu(cpu) {
> -		struct mnt_writer *writer = &per_cpu(mnt_writers, cpu);
> +		struct mnt_writer *writer = &per_cpu_var_locked(mnt_writers, cpu);
>  		spin_lock_init(&writer->lock);
>  		lockdep_set_class(&writer->lock, &writer->lock_class);
>  		writer->count = 0;
> @@ -199,7 +199,7 @@
>  	struct mnt_writer *cpu_writer;
>
>  	for_each_possible_cpu(cpu) {
> -		cpu_writer = &per_cpu(mnt_writers, cpu);
> +		cpu_writer = &per_cpu_var_locked(mnt_writers, cpu);
>  		spin_unlock(&cpu_writer->lock);
>  	}
>  }
> @@ -251,8 +251,8 @@
>  {
>  	int ret = 0;
>  	struct mnt_writer *cpu_writer;
> -
> -	cpu_writer = &get_cpu_var(mnt_writers);
> +	int cpu = 0;
> +	cpu_writer = &get_cpu_var_locked(mnt_writers, &cpu);
>  	spin_lock(&cpu_writer->lock);
>  	if (__mnt_is_readonly(mnt)) {
>  		ret = -EROFS;
> @@ -262,7 +262,7 @@
>  	cpu_writer->count++;
>  out:
>  	spin_unlock(&cpu_writer->lock);
> -	put_cpu_var(mnt_writers);
> +	put_cpu_var_locked(mnt_writers, cpu);
>  	return ret;
>  }
>  EXPORT_SYMBOL_GPL(mnt_want_write);
> @@ -273,7 +273,7 @@
>  	struct mnt_writer *cpu_writer;
>
>  	for_each_possible_cpu(cpu) {
> -		cpu_writer = &per_cpu(mnt_writers, cpu);
> +		cpu_writer = &per_cpu_var_locked(mnt_writers, cpu);
>  		spin_lock(&cpu_writer->lock);
>  		__clear_mnt_count(cpu_writer);
>  		cpu_writer->mnt = NULL;
> @@ -332,8 +332,8 @@
>  {
>  	int must_check_underflow = 0;
>  	struct mnt_writer *cpu_writer;
> -
> -	cpu_writer = &get_cpu_var(mnt_writers);
> +	int cpu = 0;
> +	cpu_writer = &get_cpu_var_locked(mnt_writers, &cpu);
>  	spin_lock(&cpu_writer->lock);
>
>  	use_cpu_writer_for_mount(cpu_writer, mnt);
> @@ -360,7 +360,7 @@
>  	 * __mnt_writers can underflow.  Without it,
>  	 * we could theoretically wrap __mnt_writers.
>  	 */
> -	put_cpu_var(mnt_writers);
> +	put_cpu_var_locked(mnt_writers, cpu);
>  }
>  EXPORT_SYMBOL_GPL(mnt_drop_write);
>
> @@ -612,7 +612,7 @@
>  	 * can come in.
>  	 */
>  	for_each_possible_cpu(cpu) {
> -		struct mnt_writer *cpu_writer = &per_cpu(mnt_writers, cpu);
> +		struct mnt_writer *cpu_writer = &per_cpu_var_locked(mnt_writers,
> cpu); if (cpu_writer->mnt != mnt)
>  			continue;
>  		spin_lock(&cpu_writer->lock);
>
>
> --
> To unsubscribe from this list: send the line "unsubscribe
> linux-rt-users" in the body of a message to majordomo@email-addr-hidden
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

Yes, the number of bug messages is reduced very much by this patch, 
although both messages are still present in the log (cf. attached dmesg). 
But with the patch they only occur sporadically after the system has 
completed start-up and no longer continuously. Thanks a lot!

Bye,
           Jürgen

["dmesg.tgz" (application/x-tgz)]
--
To unsubscribe from this list: send the line "unsubscribe linux-rt-users" in
the body of a message to majordomo@email-addr-hidden
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Donate | Add a list | Sponsors: 10EastKoreLogicTerra-InternationalChakpak.com
------------PoEth15OrN5KIwzn19Im8k--