All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH -rt] scheduling while atomic in fs/file.c
@ 2006-05-16 16:28 Daniel Walker
  2006-05-18  7:55 ` Ingo Molnar
  0 siblings, 1 reply; 14+ messages in thread
From: Daniel Walker @ 2006-05-16 16:28 UTC (permalink / raw)
  To: mingo; +Cc: rostedt, linux-kernel

Quite the smp_processor_id() warnings. The timer was pinned
before, but the spinlock protection is such that the timer
can migrate with out issues. Allowing the timers to 
migrate (although not often) will allow them to
move off busy cpu's , and potentially follow the
work queue that they wake up. 

Signed-Off-By: Daniel Walker <dwalker@mvista.com>

Index: linux-2.6.16/fs/file.c
===================================================================
--- linux-2.6.16.orig/fs/file.c
+++ linux-2.6.16/fs/file.c
@@ -137,7 +137,9 @@ static void free_fdtable_rcu(struct rcu_
 		kfree(fdt->fd);
 		kfree(fdt);
 	} else {
-		fddef = &get_cpu_var(fdtable_defer_list);
+
+		fddef = &per_cpu(fdtable_defer_list, raw_smp_processor_id());
+
 		spin_lock(&fddef->lock);
 		fdt->next = fddef->next;
 		fddef->next = fdt;
@@ -149,7 +151,6 @@ static void free_fdtable_rcu(struct rcu_
 		if (!schedule_work(&fddef->wq))
 			mod_timer(&fddef->timer, 5);
 		spin_unlock(&fddef->lock);
-		put_cpu_var(fdtable_defer_list);
 	}
 }
 

^ permalink raw reply	[flat|nested] 14+ messages in thread
* [PATCH -rt] scheduling while atomic in fs/file.c
@ 2006-05-14 15:45 Daniel Walker
  2006-05-14 16:44 ` Steven Rostedt
  0 siblings, 1 reply; 14+ messages in thread
From: Daniel Walker @ 2006-05-14 15:45 UTC (permalink / raw)
  To: mingo; +Cc: linux-kernel

Quite the smp_processor_id() wanrings. I don't see any SMP
concerns here . It just adds to a percpu list, so it shouldn't
matter if it switches after sampling fdtable_defer_list .

Signed-Off-By: Daniel Walker <dwalker@mvista.com>

Index: linux-2.6.16/fs/file.c
===================================================================
--- linux-2.6.16.orig/fs/file.c
+++ linux-2.6.16/fs/file.c
@@ -138,6 +138,8 @@ static void free_fdtable_rcu(struct rcu_
 		kfree(fdt);
 	} else {
 		fddef = &get_cpu_var(fdtable_defer_list);
+		put_cpu_var(fdtable_defer_list);
+
 		spin_lock(&fddef->lock);
 		fdt->next = fddef->next;
 		fddef->next = fdt;
@@ -149,7 +151,6 @@ static void free_fdtable_rcu(struct rcu_
 		if (!schedule_work(&fddef->wq))
 			mod_timer(&fddef->timer, 5);
 		spin_unlock(&fddef->lock);
-		put_cpu_var(fdtable_defer_list);
 	}
 }
 

^ permalink raw reply	[flat|nested] 14+ messages in thread
* [PATCH -rt] scheduling while atomic in fs/file.c
@ 2006-04-22 15:03 Daniel Walker
  2006-05-03 20:45 ` Ingo Molnar
  0 siblings, 1 reply; 14+ messages in thread
From: Daniel Walker @ 2006-04-22 15:03 UTC (permalink / raw)
  To: mingo; +Cc: linux-kernel

In free_fdtable_rcu() it does the following,

        } else {
                fddef = &get_cpu_var(fdtable_defer_list);
                spin_lock(&fddef->lock);
		...
                spin_unlock(&fddef->lock);
                put_cpu_var(fdtable_defer_list);
        }

I've never seen a scheduling while atomic, but seems like
it could happen . Not much contention on this lock though.

Signed-Off-By: Daniel Walker <dwalker@mvista.com>

Index: linux-2.6.16/fs/file.c
===================================================================
--- linux-2.6.16.orig/fs/file.c
+++ linux-2.6.16/fs/file.c
@@ -137,7 +137,7 @@ static void free_fdtable_rcu(struct rcu_
 		kfree(fdt->fd);
 		kfree(fdt);
 	} else {
-		fddef = &get_cpu_var(fdtable_defer_list);
+		fddef = &__get_cpu_var(fdtable_defer_list);
 		spin_lock(&fddef->lock);
 		fdt->next = fddef->next;
 		fddef->next = fdt;
@@ -149,7 +149,6 @@ static void free_fdtable_rcu(struct rcu_
 		if (!schedule_work(&fddef->wq))
 			mod_timer(&fddef->timer, 5);
 		spin_unlock(&fddef->lock);
-		put_cpu_var(fdtable_defer_list);
 	}
 }
 

^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2006-05-18  7:55 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-05-16 16:28 [PATCH -rt] scheduling while atomic in fs/file.c Daniel Walker
2006-05-18  7:55 ` Ingo Molnar
  -- strict thread matches above, loose matches on Subject: below --
2006-05-14 15:45 Daniel Walker
2006-05-14 16:44 ` Steven Rostedt
2006-05-14 17:32   ` Daniel Walker
2006-05-15  6:43     ` Steven Rostedt
2006-05-15  7:04       ` Steven Rostedt
2006-05-15 13:37         ` Daniel Walker
2006-05-15 14:03           ` Steven Rostedt
2006-05-15 13:51         ` Daniel Walker
2006-05-15 14:05           ` Steven Rostedt
2006-04-22 15:03 Daniel Walker
2006-05-03 20:45 ` Ingo Molnar
2006-05-03 20:43   ` Daniel Walker

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.