Detecting system and/or process IDLE?

Hi everyone!

In my driver I need to perform a very low priority but potentially high
volume file operations that I would like to do when thw system is in
IDLE for some time so nobody suffers. How can I detect this IDLE state
and how can I monitor it so I can abort my file i/o when system wakes
up? I looked through DDK and this list’s archives but couldn’t find any
helpful info on that.

TIA,

Vladimir

Run your task in your own system thread at sufficiently low priority (as in

  1. to be effectively a background idle task.

=====================
Mark Roddy

-----Original Message-----
From: Vladimir Chtchetkine [mailto:xxxxx@borland.com]
Sent: Monday, February 23, 2004 10:20 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] Detecting system and/or process IDLE?

Hi everyone!

In my driver I need to perform a very low priority but
potentially high volume file operations that I would like to
do when thw system is in IDLE for some time so nobody
suffers. How can I detect this IDLE state and how can I
monitor it so I can abort my file i/o when system wakes up? I
looked through DDK and this list’s archives but couldn’t find
any helpful info on that.

TIA,

Vladimir


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as:
xxxxx@stratus.com To unsubscribe send a blank email to
xxxxx@lists.osr.com

Thanks, Mark.

Yes, I thought about having a lowest priority thread. But in my
particular case there is a problem with that approach. In particular, I
need to block creates on a file while my thread is working on this file.
And (for simplicity sake) I don’t want to abort that work until it’s
100% completed. So, if I can control IDLE state I can (at least I think
I can) significantly reduce probability of this type of conflict, thus
increase overall performance. So, I really would like to be able to
detect IDLEs.

Regards,

Vladimir

-----Original Message-----
From: Roddy, Mark [mailto:xxxxx@stratus.com]
Sent: Monday, February 23, 2004 8:00 AM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] Detecting system and/or process IDLE?

Run your task in your own system thread at sufficiently low priority (as
in

  1. to be effectively a background idle task.

=====================
Mark Roddy

-----Original Message-----
From: Vladimir Chtchetkine [mailto:xxxxx@borland.com]
Sent: Monday, February 23, 2004 10:20 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] Detecting system and/or process IDLE?

Hi everyone!

In my driver I need to perform a very low priority but
potentially high volume file operations that I would like to
do when thw system is in IDLE for some time so nobody
suffers. How can I detect this IDLE state and how can I
monitor it so I can abort my file i/o when system wakes up? I
looked through DDK and this list’s archives but couldn’t find
any helpful info on that.

TIA,

Vladimir


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as:
xxxxx@stratus.com To unsubscribe send a blank email to
xxxxx@lists.osr.com


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as:
xxxxx@borland.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

Let’s say that you could detect processor idle time (which I’m sure you can
through the performance monitoring system, but you may not be able to do it
from inside a kernel driver), it would be like saying “It’s not rained for
three days, so it’s not going to rain tomorrow”. The past is not a good
indicator of the future.

Of course, there’s nothing saying you can’t vary your priority according to
this:

Set very low priority.
for(;:wink:
{
Wait for work to come in.
Set high priority.
Do work.
Set very low priority.
}

Of course, the Set high priority could be keyed on some heuristics that you
may come up with. But it sounds like you want to get it done as quickly as
possible once you start, but you don’t want to start doing it until you get
the CPU time to spare. Varying the priority will help you doing that.
(Although I think MS may think they can do that much better themselves! :wink:


Mats

-----Original Message-----
From: Vladimir Chtchetkine [mailto:xxxxx@borland.com]
Sent: Monday, February 23, 2004 4:30 PM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] Detecting system and/or process IDLE?

Thanks, Mark.

Yes, I thought about having a lowest priority thread. But in my
particular case there is a problem with that approach. In
particular, I
need to block creates on a file while my thread is working on
this file.
And (for simplicity sake) I don’t want to abort that work until it’s
100% completed. So, if I can control IDLE state I can (at
least I think
I can) significantly reduce probability of this type of conflict, thus
increase overall performance. So, I really would like to be able to
detect IDLEs.

Regards,

Vladimir

-----Original Message-----
From: Roddy, Mark [mailto:xxxxx@stratus.com]
Sent: Monday, February 23, 2004 8:00 AM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] Detecting system and/or process IDLE?

Run your task in your own system thread at sufficiently low
priority (as
in

  1. to be effectively a background idle task.

=====================
Mark Roddy

> -----Original Message-----
> From: Vladimir Chtchetkine
[mailto:xxxxx@borland.com]
> Sent: Monday, February 23, 2004 10:20 AM
> To: Windows System Software Devs Interest List
> Subject: [ntdev] Detecting system and/or process IDLE?
>
> Hi everyone!
>
> In my driver I need to perform a very low priority but
> potentially high volume file operations that I would like to
> do when thw system is in IDLE for some time so nobody
> suffers. How can I detect this IDLE state and how can I
> monitor it so I can abort my file i/o when system wakes up? I
> looked through DDK and this list’s archives but couldn’t find
> any helpful info on that.
>
> TIA,
>
> Vladimir
>
> —
> Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as:
> xxxxx@stratus.com To unsubscribe send a blank email to
> xxxxx@lists.osr.com
>


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as:
xxxxx@borland.com
To unsubscribe send a blank email to xxxxx@lists.osr.com


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: xxxxx@3dlabs.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

Will you be filling a patent? We would not want anyone on this list to have
an idea that someone else patents.

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Vladimir Chtchetkine
Sent: Monday, February 23, 2004 7:20 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] Detecting system and/or process IDLE?

Hi everyone!

In my driver I need to perform a very low priority but potentially high
volume file operations that I would like to do when thw system is in
IDLE for some time so nobody suffers. How can I detect this IDLE state
and how can I monitor it so I can abort my file i/o when system wakes
up? I looked through DDK and this list’s archives but couldn’t find any
helpful info on that.

TIA,

Vladimir


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: xxxxx@storagecraft.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

Thanks, Mats!

Looks like I have no other choice but to have a UM agent for solely
purpose of detecting IDLE. I just hopped that I could do it from the KM.
Playing with thread priorities is an option but it’s a “last resort”
option because the major idea is not to be as quick as possible but
rather as unobtrusive as possible. And that’s why I prefer “IDLE
prediction” approach over “idle-priority thread”.

Regards,

Vladimir

-----Original Message-----
From: xxxxx@3Dlabs.com [mailto:xxxxx@3Dlabs.com]
Sent: Monday, February 23, 2004 10:18 AM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] Detecting system and/or process IDLE?

Let’s say that you could detect processor idle time (which I’m sure you
can
through the performance monitoring system, but you may not be able to do
it
from inside a kernel driver), it would be like saying “It’s not rained
for
three days, so it’s not going to rain tomorrow”. The past is not a good
indicator of the future.

Of course, there’s nothing saying you can’t vary your priority according
to
this:

Set very low priority.
for(;:wink:
{
Wait for work to come in.
Set high priority.
Do work.
Set very low priority.
}

Of course, the Set high priority could be keyed on some heuristics that
you
may come up with. But it sounds like you want to get it done as quickly
as
possible once you start, but you don’t want to start doing it until you
get
the CPU time to spare. Varying the priority will help you doing that.
(Although I think MS may think they can do that much better themselves!
:wink:


Mats

-----Original Message-----
From: Vladimir Chtchetkine [mailto:xxxxx@borland.com]
Sent: Monday, February 23, 2004 4:30 PM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] Detecting system and/or process IDLE?

Thanks, Mark.

Yes, I thought about having a lowest priority thread. But in my
particular case there is a problem with that approach. In
particular, I
need to block creates on a file while my thread is working on
this file.
And (for simplicity sake) I don’t want to abort that work until it’s
100% completed. So, if I can control IDLE state I can (at
least I think
I can) significantly reduce probability of this type of conflict, thus
increase overall performance. So, I really would like to be able to
detect IDLEs.

Regards,

Vladimir

-----Original Message-----
From: Roddy, Mark [mailto:xxxxx@stratus.com]
Sent: Monday, February 23, 2004 8:00 AM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] Detecting system and/or process IDLE?

Run your task in your own system thread at sufficiently low
priority (as
in

  1. to be effectively a background idle task.

=====================
Mark Roddy

> -----Original Message-----
> From: Vladimir Chtchetkine
[mailto:xxxxx@borland.com]
> Sent: Monday, February 23, 2004 10:20 AM
> To: Windows System Software Devs Interest List
> Subject: [ntdev] Detecting system and/or process IDLE?
>
> Hi everyone!
>
> In my driver I need to perform a very low priority but
> potentially high volume file operations that I would like to
> do when thw system is in IDLE for some time so nobody
> suffers. How can I detect this IDLE state and how can I
> monitor it so I can abort my file i/o when system wakes up? I
> looked through DDK and this list’s archives but couldn’t find
> any helpful info on that.
>
> TIA,
>
> Vladimir
>
> —
> Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as:
> xxxxx@stratus.com To unsubscribe send a blank email to
> xxxxx@lists.osr.com
>


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as:
xxxxx@borland.com
To unsubscribe send a blank email to xxxxx@lists.osr.com


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: xxxxx@3dlabs.com
To unsubscribe send a blank email to xxxxx@lists.osr.com


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as:
xxxxx@borland.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

Will you believe me? :wink:

-----Original Message-----
From: Jamey Kirby [mailto:xxxxx@storagecraft.com]
Sent: Monday, February 23, 2004 10:42 AM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] Detecting system and/or process IDLE?

Will you be filling a patent? We would not want anyone on this list to
have
an idea that someone else patents.

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Vladimir
Chtchetkine
Sent: Monday, February 23, 2004 7:20 AM
To: Windows System Software Devs Interest List
Subject: [ntdev] Detecting system and/or process IDLE?

Hi everyone!

In my driver I need to perform a very low priority but potentially high
volume file operations that I would like to do when thw system is in
IDLE for some time so nobody suffers. How can I detect this IDLE state
and how can I monitor it so I can abort my file i/o when system wakes
up? I looked through DDK and this list’s archives but couldn’t find any
helpful info on that.

TIA,

Vladimir


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: xxxxx@storagecraft.com
To unsubscribe send a blank email to xxxxx@lists.osr.com


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as:
xxxxx@borland.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

On Mon, 2004-02-23 at 12:42, Jamey Kirby wrote:

Will you be filling a patent? We would not want anyone on this list to have
an idea that someone else patents.

Well, he probably has to file a patent, because if he doesn’t, someone
else on this list surely will, and will sue him, and he will lose the
right to use his “invention” .

Patent law sucks.

-sd