Re: Time loss after calling netif_rx() in a kernel thread

2008-07-05 Thread Lukas Razik
Hello Mulyadi! Mulyadi Santosa wrote: Anyway, sched_yield() doesn't really work like it used to be in 2.4 or old O(1) in 2.6. Oh, I didn't know this fact... :-/ But on the other hand I use 2.6.22 and the new CFScheduler we've since v2.6.23... Why I use yield(): I've just read Robert Love's

Re: Time loss after calling netif_rx() in a kernel thread

2008-07-01 Thread Lukas Razik
Hello Mulyadi! Mulyadi Santosa wrote: So, I have these questions: 1. Why does the yield() call in my kernel thread not force the proceeding of the softirqs? AFAIK , jiffies is updated as a part of bottom halves too (softirqd IIRC). Thus, further suspicion should be directed to what's your

Time loss after calling netif_rx() in a kernel thread

2008-06-30 Thread Lukas Razik
Hello together! I'm developing an eth-interface module and I've the following issue... In my module I create a kernel thread with the thread handler 'rx_thread_action' (please see below). (It polls a message queue which is provided by the driver of a SCI card but that's unimportant.) static

Re: Time loss after calling netif_rx() in a kernel thread

2008-06-30 Thread Lukas Razik
Hello again! Lukas Razik wrote: In my module I create a kernel thread with the thread handler 'rx_thread_action' (please see below). (It polls a message queue which is provided by the driver of a SCI card but that's unimportant.) static inline void rx_action(struct net_device *dev, u8 *data

Re: Polling in kernel threads

2008-06-20 Thread Lukas Razik
Hello Hannes! Could the system instability appear (for example), because the events thread which runs on the same CPU like my kernel thread, doesn't process the works which are in its work queue? Or are all works of the default queue delivered to other events threads on the free CPUs? I am

Re: Polling in kernel threads

2008-06-19 Thread Lukas Razik
Hello Mulyadi! first of all, what do you poll there? some register status? could the device just yield an interrupt? I poll a message queue. The Dolphin SCI network card's kernel modules have a message queue implementation and I call their receive function:

Re: Polling in kernel threads

2008-06-19 Thread Lukas Razik
Hello Johannes! You don't give the scheduler a chance to run. If you sleep, the scheduler will run and be able to deliver the signal and this is why it works then. Spinning like this is bad. That should actually freeze a UP machine if I do not miss something. The driver is _only_ for

Polling in kernel threads

2008-06-18 Thread Lukas Razik
Hello! I develop a network interface driver and I've the following issue... I create a kernel thread which has the following thread handler: static int com_thread( void *data ) { daemonize( comthread ); allow_signal( SIGTERM ); while( !signal_pending(current) ) { if(receive(...)) {

Re: spin_lock_irqsave or spin_lock in work queue handlers?

2008-03-06 Thread Lukas Razik
Hello Peter! Sorry, I missed the question onf the CONFIG_TRACE_IRQFLAGS - I think that config option is meant for tracing the IRQ flow in the event of debugging. Correct? O.K. So it's only a help for debugging... I use semaphores now (down() and up()). And the interface doesn't seem to

Re: spin_lock_irqsave or spin_lock in work queue handlers?

2008-03-06 Thread Lukas Razik
Hello Peter! 2 diff things. semap are sync mechanism used - to sync among CPUs/processes/tasks etc. Just a counting mechanism. It DOES NOT lock the other CPU while another CPU is using the same resources.but this counting must be atomicdifferent arch has different instruction

Re: spin_lock_irqsave or spin_lock in work queue handlers?

2008-03-06 Thread Lukas Razik
Hello again! mutex does not lock in the sense of blocking the CPU - but in the sense that if the lock is not free, the task will be switch out and another task switch in, done by scheduler. O.K. I understand so I ask in another way: For example my work handler is running on CPU0 and holds

Re: spin_lock_irqsave or spin_lock in work queue handlers?

2008-03-05 Thread Lukas Razik
Hello! My first idea was to use spin_lock_irqsave in the work handler: ... spin_lock_irqsave(tx_d-lock, flags); sock_sendmsg(...); spin_unlock_irqrestore(tx_d-lock, flags); ... but if I do that, I get this message from the kernel: BUG: warning at kernel/softirq.c:137/local_bh_enable()

Ethernet over Kernel Sockets

2008-02-29 Thread Lukas Razik
Hello all! As you know, some network cards doesn't have a 'eth' interface under linux. Because of that I'm developing a net_device based driver which doesn't transmit and receive directly through a real network card but through UDP kernel sockets. That means: If my net_device-hard_start_xmit