LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Arjan van de Ven <arjan@infradead.org>
To: Ingo Molnar <mingo@elte.hu>
Cc: linux-kernel@vger.kernel.org, linux-rt-users@vger.kernel.org
Subject: Re: v2.6.20-rt1, yum/rpm
Date: Tue, 06 Feb 2007 11:10:44 +0100	[thread overview]
Message-ID: <1170756645.7324.8.camel@laptopd505.fenrus.org> (raw)
In-Reply-To: <20070205065636.GA1652@elte.hu>

On Mon, 2007-02-05 at 07:56 +0100, Ingo Molnar wrote:
> i have released the v2.6.20-rt1 kernel, which can be downloaded from the 
> usual place:
> 
>   http://redhat.com/~mingo/realtime-preempt/
> 
> more info about the -rt patchset can be found in the RT wiki:
> 
>   http://rt.wiki.kernel.org
> 
> This is a fixes-only release. Since the -rt tree has been closely 
> tracking Linus' upstream kernel since -rc1, no new issues are expected - 
> please re-report if anything is still unfixed.


patch below has 2 tweaks
1) the new RCU feature wakes up once per second, make sure this is using
the new round_jiffies() infrastructure
2) the slab background reap code is waking up once per 2 seconds per
cpu. The patch makes this more dynamic; if no work was done (no activity
on the cpu happened) then this is made to be 4 seconds

Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>


Index: linux-2.6.20-rt2/kernel/rcupreempt.c
===================================================================
--- linux-2.6.20-rt2.orig/kernel/rcupreempt.c
+++ linux-2.6.20-rt2/kernel/rcupreempt.c
@@ -465,7 +465,7 @@ static int rcu_booster(void *arg)
 		 * adjust, or eliminate in case of OOM.
 		 */
 
-		schedule_timeout_interruptible(HZ);
+		schedule_timeout_interruptible(round_jiffies_relative(HZ));
 
 		/* Print stats if enough time has passed. */
 
Index: linux-2.6.20-rt2/kernel/rcutorture.c
===================================================================
--- linux-2.6.20-rt2.orig/kernel/rcutorture.c
+++ linux-2.6.20-rt2/kernel/rcutorture.c
@@ -288,7 +288,7 @@ static int rcu_torture_preempt(void *arg
 			cond_resched();
 		if (rcu_torture_completed() == completedstart)
 			rcu_torture_preempt_errors++;
-		schedule_timeout_interruptible(HZ);
+		schedule_timeout_interruptible(round_jiffies_relative(HZ));
 	} while (!kthread_should_stop());
 	return 0;
 }
@@ -660,7 +660,7 @@ rcu_torture_reader(void *arg)
 		if (p == NULL) {
 			/* Wait for rcu_torture_writer to get underway */
 			cur_ops->readunlock(idx);
-			schedule_timeout_interruptible(HZ);
+			schedule_timeout_interruptible(round_jiffies_relative(HZ));
 			continue;
 		}
 		if (p->rtort_mbtest == 0)
Index: linux-2.6.20-rt2/mm/slab.c
===================================================================
--- linux-2.6.20-rt2.orig/mm/slab.c
+++ linux-2.6.20-rt2/mm/slab.c
@@ -1062,7 +1062,7 @@ static int transfer_objects(struct array
 #ifndef CONFIG_NUMA
 
 #define drain_alien_cache(cachep, alien) do { } while (0)
-#define reap_alien(cachep, l3, this_cpu) do { } while (0)
+#define reap_alien(cachep, l3, this_cpu) 0
 
 static inline struct array_cache **alloc_alien_cache(int node, int limit)
 {
@@ -1160,7 +1160,7 @@ static void __drain_alien_cache(struct k
 /*
  * Called from cache_reap() to regularly drain alien caches round robin.
  */
-static void
+static int
 reap_alien(struct kmem_cache *cachep, struct kmem_list3 *l3, int *this_cpu)
 {
 	int node = per_cpu(reap_node, *this_cpu);
@@ -1171,8 +1171,10 @@ reap_alien(struct kmem_cache *cachep, st
 		if (ac && ac->avail && spin_trylock_irq(&ac->lock)) {
 			__drain_alien_cache(cachep, ac, node, this_cpu);
 			spin_unlock_irq(&ac->lock);
+			return 1;
 		}
 	}
+	return 0;
 }
 
 static void drain_alien_cache(struct kmem_cache *cachep,
@@ -2473,7 +2475,7 @@ static void check_spinlock_acquired_node
 #define check_spinlock_acquired_node(x, y) do { } while(0)
 #endif
 
-static void drain_array(struct kmem_cache *cachep, struct kmem_list3 *l3,
+static int drain_array(struct kmem_cache *cachep, struct kmem_list3 *l3,
 			struct array_cache *ac,
 			int force, int node);
 
@@ -4114,15 +4116,16 @@ static int enable_cpucache(struct kmem_c
  * Drain an array if it contains any elements taking the l3 lock only if
  * necessary. Note that the l3 listlock also protects the array_cache
  * if drain_array() is used on the shared array.
+ * returns non-zero if some work is done
  */
-void drain_array(struct kmem_cache *cachep, struct kmem_list3 *l3,
+int drain_array(struct kmem_cache *cachep, struct kmem_list3 *l3,
 		 struct array_cache *ac, int force, int node)
 {
 	int this_cpu = smp_processor_id();
 	int tofree;
 
 	if (!ac || !ac->avail)
-		return;
+		return 0;
 	if (ac->touched && !force) {
 		ac->touched = 0;
 	} else {
@@ -4138,6 +4141,7 @@ void drain_array(struct kmem_cache *cach
 		}
 		slab_spin_unlock_irq(&l3->list_lock, this_cpu);
 	}
+	return 1;
 }
 
 /**
@@ -4157,6 +4161,7 @@ static void cache_reap(struct work_struc
 	int this_cpu = raw_smp_processor_id(), node = cpu_to_node(this_cpu);
 	struct kmem_cache *searchp;
 	struct kmem_list3 *l3;
+	int work_done = 0;
 
 	if (!mutex_trylock(&cache_chain_mutex)) {
 		/* Give up. Setup the next iteration. */
@@ -4175,10 +4180,10 @@ static void cache_reap(struct work_struc
 		 */
 		l3 = searchp->nodelists[node];
 
-		reap_alien(searchp, l3, &this_cpu);
+		work_done += reap_alien(searchp, l3, &this_cpu);
 
-		drain_array(searchp, l3, cpu_cache_get(searchp, this_cpu),
-			    0, node);
+		work_done += drain_array(searchp, l3,
+			    cpu_cache_get(searchp, this_cpu), 0, node);
 
 		/*
 		 * These are racy checks but it does not matter
@@ -4189,7 +4194,7 @@ static void cache_reap(struct work_struc
 
 		l3->next_reap = jiffies + REAPTIMEOUT_LIST3;
 
-		drain_array(searchp, l3, l3->shared, 0, node);
+		work_done += drain_array(searchp, l3, l3->shared, 0, node);
 
 		if (l3->free_touched)
 			l3->free_touched = 0;
@@ -4207,9 +4212,10 @@ next:
 	mutex_unlock(&cache_chain_mutex);
 	next_reap_node();
 	refresh_cpu_vm_stats(smp_processor_id());
+
 	/* Set up the next iteration */
 	schedule_delayed_work(&__get_cpu_var(reap_work),
-		round_jiffies_relative(REAPTIMEOUT_CPUC));
+		round_jiffies_relative((1+!work_done) * REAPTIMEOUT_CPUC));
 }
 
 #ifdef CONFIG_PROC_FS



  parent reply	other threads:[~2007-02-06 10:10 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-02-05  6:56 Ingo Molnar
2007-02-05  9:18 ` Serge Belyshev
2007-02-05  9:02   ` Ingo Molnar
2007-02-05 10:36 ` Sunil Naidu
2007-02-05 10:42   ` Peter Zijlstra
2007-02-05 10:22     ` Ingo Molnar
2007-02-05 11:15     ` Sunil Naidu
2007-02-05 12:59 ` Michal Piotrowski
2007-02-05 13:47   ` Ingo Molnar
2007-02-05 21:29     ` Michal Piotrowski
2007-02-05 14:25 ` Karsten Wiese
2007-02-05 15:17 ` Parag Warudkar
2007-02-05 21:50 ` Michal Piotrowski
2007-02-06  0:11 ` Michal Piotrowski
2007-02-06  1:14 ` Daniel Walker
2007-02-06 10:10 ` Arjan van de Ven [this message]
2007-02-07 12:32   ` Ingo Molnar
2007-02-06 10:30 ` Sunil Naidu
2007-02-27 17:39 ` K.R. Foley
2007-02-28  8:11   ` Ingo Molnar
2007-02-28 10:16     ` K.R. Foley
2007-04-26 13:57 ` v2.6.21-rt1 Ingo Molnar
2007-04-26 20:53   ` v2.6.21-rt1 Free Ekanayaka
2007-05-03 19:16   ` v2.6.21-rt1 - bug in asm-mips/atomic.h Tim Bird
2007-05-03 19:35     ` v2.6.21-rt1 - mips compile bugs Tim Bird
2007-05-17 18:46   ` v2.6.21-rt1 emin ak
2007-02-05 15:06 v2.6.20-rt1, yum/rpm Milan Svoboda

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=1170756645.7324.8.camel@laptopd505.fenrus.org \
    --to=arjan@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rt-users@vger.kernel.org \
    --cc=mingo@elte.hu \
    --subject='Re: v2.6.20-rt1, yum/rpm' \
    /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

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).