From: Daniel Gryniewicz <dang@fprintf.net>
To: selvakumar nagendran <kernelselva@yahoo.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: finding process blocking on a system call
Date: Thu, 06 Jan 2005 11:03:39 -0500 [thread overview]
Message-ID: <1105027419.17473.2.camel@athena.fprintf.net> (raw)
In-Reply-To: <20050106121830.44661.qmail@web60609.mail.yahoo.com>
On Thu, 2005-01-06 at 04:18 -0800, selvakumar nagendran wrote:
> Hello linux-experts,
> I want to find whether a process blocks in a system
> call due to the unavailability of the resource that is
> accessed in it. For eg, if a semaphore key is not
> available to the process while executing the system
> calls like read, write etc, it will wait in the
> TASK_INTERRUPTIBLE state.
> Now, I don't want the process to simply sleep,
> waiting for the semaphore. I want it to be added into
> the runqueue again. And also, I want to determine this
> in the kernel module. How can I do this? Can anyone
> help me regarding this?
> I am intercepting system calls in kernel 2.4.28.
>
> Thanks,
> selva
>
This is a very bad idea, as the process will expect the syscall to be
complete when it runs again. Just use the non-blocking versions of the
syscall (file/network IO all have non-blocking versions), and handle the
EWOULDBLOCK return value in your userspace application.
Daniel
next prev parent reply other threads:[~2005-01-06 16:04 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-01-06 12:18 selvakumar nagendran
2005-01-06 16:03 ` Daniel Gryniewicz [this message]
[not found] <e4cb1987050106133642b931ce@mail.gmail.com>
2005-01-07 4:13 ` selvakumar nagendran
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=1105027419.17473.2.camel@athena.fprintf.net \
--to=dang@fprintf.net \
--cc=kernelselva@yahoo.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
Powered by JetHome