[Click] Greedy Configuration Option - Specify CPU ?

Beyers Cronje bcronje at webmail.co.za
Wed Feb 9 20:45:02 EST 2005


Hi Eddie,

Thanks! Feel free to use the patch below. The patch adds
the option to specify on which CPU the click kernel module
should run. I'm not fimiliar with the click configure
script so for now I've just added a definition of
RUN_ON_CPU <cpu num> to linuxmodule/sched.cc

Beyers

--- sched.cc	2005-02-10 03:23:21.621327560 +0000
+++ sched.new	2005-02-10 03:40:08.765218416 +0000
@@ -57,6 +57,8 @@
 #define SOFT_SPIN_LOCK(l)	do { MDEBUG("soft_lock %s", #l);
soft_spin_lock((l)); } while (0)
 #define SPIN_UNLOCK(l)		do { MDEBUG("unlock %s", #l);
spin_unlock((l)); } while (0)
 
+#define RUN_ON_CPU 1
+
 static spinlock_t click_thread_lock;
 static int click_thread_priority = DEF_PRIO;
 static Vector<int> *click_thread_pids;
@@ -92,6 +94,15 @@
 #ifdef HAVE_ADAPTIVE_SCHEDULER
   rt->set_cpu_share(min_click_frac, max_click_frac);
 #endif
+
+#if __SMP__
+#ifdef RUN_ON_CPU
+  // set router's cpu 
+  if (RUN_ON_CPU < smp_num_cpus)
+    set_cpus_allowed(current, 1UL <<
cpu_logical_map(RUN_ON_CPU));
+#endif
+#endif
+
   printk("<1>click: starting router thread pid %d (%p)\n",
current->pid, rt);
 
   // add pid to thread list



On Wed, 9 Feb 2005 13:34:46 -0800
 Eddie Kohler <kohler at CS.UCLA.EDU> wrote:
> Hi Beyers,
> 
> It is not currently possible to do this, but it shouldn't
> be that hard.  You could add a new module parameter (like
> threads=), and have the 
> code in linuxmodule/sched.cc assign a CPU affinity before
> starting a thread.
> 
> E
> 
> 
> On Feb 8, 2005, at 5:52 PM, Beyers Cronje wrote:
> 
> > Hi all,
> >
> > Is there a way to specify on which CPU the kernel
> module
> > should run when using the enable-greedy configuration
> > option ? Would this be possible ?
> >
> > Cheers
> >
> > Beyers
> >
>
______________________________________________________________
> > http://www.webmail.co.za the South African FREE email
> service
> > _______________________________________________
> > click mailing list
> > click at amsterdam.lcs.mit.edu
> > https://amsterdam.lcs.mit.edu/mailman/listinfo/click
> 

______________________________________________________________
http://www.webmail.co.za the South African FREE email service


More information about the click mailing list