From: xpankajbx@gmail.com (Pankaj B)
To: kernelnewbies@lists.kernelnewbies.org
Subject: work_struct not getting scheduled
Date: Sat, 23 Apr 2011 09:16:00 +0530 [thread overview]
Message-ID: <BANLkTikEm4aYXpV1TZsK6oG2BjLLs8V0RA@mail.gmail.com> (raw)
In-Reply-To: <20110421153251.GA2260@michaelblizek.twilightparadox.com>
On Thu, Apr 21, 2011 at 9:02 PM, Michael Blizek <
michi1@michaelblizek.twilightparadox.com> wrote:
> Hi!
>
> On 17:44 Thu 21 Apr , Pankaj B wrote:
> ...
> > INIT_WORK(&event->work, do_handling_work);
> > schedule_work(&event->work);
> > flush_scheduled_work();
> >
> > But the work never gets scheduled. I have put some printks in the
> > do_handling_work() function. Creating workqueue and queueing
> > the work to that workqueue doen't work either. I find this a
> > very strange problem. Does anybody knows about this?
> >
> > FYI: my system has heavy IO load when I schedule the work.
>
> 1) Why call flush_scheduled_work? This function will wait until
> do_handling_work is finished. You could just call do_handling_work
> directly...
do_handling_work is to be called/scheduled from the interrupt context.
Actually I was not calling flush_scheduled_work() initially(it sleeps), I
tried it because
work was not getting scheduled. I can not call do_handling_work() directly
because it sleeps.
>
> 2) If you have heavy IO load, it might will up the workqueues. It should
> not
> cause total starvation. But if (1) did not solve your problem, try
> reproducing
> it while the system is idle.
>
Work get scheduled when the system is idle.
Somehow the work is getting scheduled now. I doubt another thread which was
causing
system to become non-responsive for most of the time.
@Dave: I am using linux kernel 2.6.30.2
@Himanshu: Good point. I checked return value of schedule_work(),
I am getting non-zero value which is expected.
Thank you all.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20110423/02e813d0/attachment.html
next prev parent reply other threads:[~2011-04-23 3:46 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-04-21 12:14 work_struct not getting scheduled Pankaj B
2011-04-21 15:32 ` Michael Blizek
2011-04-23 3:46 ` Pankaj B [this message]
2011-04-21 15:59 ` Dave Hylands
2011-04-21 16:42 ` Himanshu Chauhan
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=BANLkTikEm4aYXpV1TZsK6oG2BjLLs8V0RA@mail.gmail.com \
--to=xpankajbx@gmail.com \
--cc=kernelnewbies@lists.kernelnewbies.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;
as well as URLs for NNTP newsgroup(s).