Re: Wake up and sleep procedures for a function in a module

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

 



Hi,

On 4/30/05, Chandrakanth Chereddi <chereddi@xxxxxxxxx> wrote:
> On 4/29/05, Martin Jambor <jamborm@xxxxxxxxx> wrote:
> > My first thought would be to use a semaphore, myTx would be upping it
> > after it has added an element to the work queue and myDeliver would
> > use down to wait for another item to arrive. Please note that you need
> > to protect queue manipulation with a separate lock as well so take
> > care of a potential deadlock.
> 
> Thanks for the reply. Yeah, I think as far as formulation goes, it
> fits in nicely as a producer consumer problem, but there might be more
> to it. As far as queue locking goes,  since I am talking about
> packets, I can just use the skb_(de)queue and other functions in the
> kernel API, which take care of locking?
> 
> I am not sure if semaphore is the right way, especially when you are
> talking about having to use the function to process something like
> 2000+ packets per second. So, I was thinking a tasklet might be the
> best way, also since I expect to have not more than one instance of
> myDeliver() at any time? Once again, I have no experience here, so
> could be very wrong. Would appreciate any kind of advice, even if not
> directly relavant.

I don't know ether since I don't know what you want to accomplish. If
myDeliver can be a tasklet, it _probably_ should be a tasklet. I
originaly thought you were talking about processes. Nevertheless,
maybe someone else can help you better if you explain what your
functions do, I'm currently involved in tackling a different part of
the kernel (vfs).

HTH

Martin Jambor

--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           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