RE: working files from Interupt routine

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



 

 

Hi,

  Thanks for your reply.

I can’t use Tasklet or workqueues because I called this function from Netfilter hook function. Is there any way to solve this problem?

 

With Thanks & Regards,
K. Lekshmanan

 

 

 

 

 

-----Original Message-----
From: kernelnewbies-bounce@xxxxxxxxxxxx [mailto:kernelnewbies-bounce@xxxxxxxxxxxx] On Behalf Of Martin Candurra
Sent: Saturday, January 19, 2008 8:01 PM
To: Matthias Kaehlcke
Cc: kernelnewbies@xxxxxxxxxxxx
Subject: Re: working files from Interupt routine

 

On Jan 19, 2008 4:48 AM, Matthias Kaehlcke <matthias@xxxxxxxxxxxx> wrote:

> El Thu, Jan 17, 2008 at 03:04:08PM -0200 Martin Candurra ha dit:

> 

> >    Writing to a file probably puts the process to sleep. That is not possible

> >    if you are in an interrupt context,

> >    even if you could, the idea of an interrupt handler is to be as quick as

> >    possible.

> >

> >    You have to use Tasklets for what you want to do. You can check how to use

> >    it from Linux Device Drivers book.

> 

> tasklets also run in interrupt context (on top of

> softirqs). workqueues are the only bottom halve mechanism that allowes

> sleeping.

 

Yes, indeed. You are right about it.

 

Kathiresan, why don't you give us a big picture of your situation ? As

Matthias said, workqueues is the only bottom halve that allow your

code to sleep because they use their own threads.

 

If what you need is to write some kernel data to a file, the best

approach is using the /proc filesystem from your module. After doing

it, you can write the data to a file  reading that proc file from user

mode. If you don't know how to do this, take a look at Linux Device

Drivers, chapter 4. It is really easy.

 

Best Regards.

 

--

To unsubscribe from this list: send an email with

"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx

Please read the FAQ at http://kernelnewbies.org/FAQ

 


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux