The HyperNews Linux KHG Discussion Pages

Question: What does mark_bh() do?

Forum: Device Drivers
Keywords: network drivers interrupt mark_bh
Date: Wed, 12 Mar 1997 01:42:49 GMT
From: Erik Petersen <>

Can someone expain when and how I use mark_bh(). I am assuming from general knowledge that it mark the end of the interrupt service routine and allows a context switch in following code.

Here is why I want to know. I have a network driver in which it would be advantagous to be able to sleep during code initiated by an interrupt. For example a piece of data is received by the device which is passed to a kernel daemon via a character device inode and a select call. I then want to wait for the daemon to respond or timeout.

The question is, if I call mark_bh(NET_BH) IMMEDIATE_BH?? before I sleep, can I sleep or do I Aiee...Killing Interrupt handler, Idle task may not sleep?

mark_bh doesn't seem to be explained anywhere but is used by many net drivers for reasons I don't understand. Is there somewhere I can look for this information?

My only obvious alternative at this point is to create a request queue of some sort and respond to activity on the character device. The problem is that I can't really continue transferring data until I get a response from the daemon.

Any thoughts?

Erik Petersen.


1. None: Untitled by Praveen Dwivedi