From: mandy london <laborious.bee@gmail.com>
To: linux-kernel@vger.kernel.org
Subject: the rack condition will occur in below code ?
Date: Mon, 29 Aug 2005 00:13:59 +0800 [thread overview]
Message-ID: <907421f905082809135e7094ad@mail.gmail.com> (raw)
below is my script in brief, when it runs for several minutes , the
computer will reboot quickly without any information , so I can not
get knowledge form oops and something else .
I use timer and hook respectively, first , using hook to receive
packets from ICP/IP stack on wired interface, the store it in a queue
, then , when the timer arrive , the timer will invoke the
dev_queue_xmit() to send the whole packets from wireless interface.
void timer_ack(unsigned long no_used){
int i ;
struct sk_buff * skb;
struct net_device * wireless;
wireless = dev_get_by_name("eth1");//eth1 is wireless interface
while((skb=skb_dequeue(packet_queue))!=NULL){// get out a packet
from the queue
dev_queue_xmit(skb);
}
mod_timer(&timer,100);// change time for polling one time per second
}
unsigned int hook_func(unsigned int hooknum,struct sk_buff **skb,
const struct net_device *in,const struct net_device *out,int
(*okfn)(struct sk_buff *)){
// there , I omit some the code handling the packet for the purpose of
forwording like NAT , that means I will handle the packet firstly then
I will insert it to the packet_queue
struct sk_buff *sb = *skb;
skb_queue_tail(packet_queue,sb);
}
I test it , normally it can run for about five minutes , then died
without anyting info.
I analyze whether my improper handling on queue leads to it. maybe
there are some race conditions I can not find out.
the most important is whether the case below have the posibility to occur?
when the kernel run in timer then an interrupt comes , after
the interrupt return results in scheule or the hook_func()'s running ,
then the race condition will occur , I am not clear in this .
any help will be appreciated , thx~
:)
reply other threads:[~2005-08-28 16:16 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=907421f905082809135e7094ad@mail.gmail.com \
--to=laborious.bee@gmail.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox