Re: uptime increases during suspend

From: Peter T. Breuer
Date: Mon Mar 27 2006 - 14:51:06 EST


In article <1143484821.2168.16.camel@leatherman> you wrote:
>> Would it be possible to get the old behaviour back?

> Why exactly do you want this behavior? Maybe a better explanation would
> help stir this discussion.

I don't know why he wants it (uptime does not increase during
hibernation) but I want it so that I can tell if I should time out or
not on an alarm for inactivity in userspace! The alarm should fire if
there has been no activity for a while (30s) while activity is possible.
If the machine is suspended, no activity is possible, so the alarm
should not fire.

This is to counteract sysadamins playing with system time (e.g. syncing
with a net time server after bootup) which might cause artificial time
outs. Causing a timeout has nasty consequences when, for example, your
root fs is mounted over the net via daemons that do the network to-ing
and fro-ing from userspace. The only way they have of getting an
estimate of REAL time elapsed, without admin playing about messing
with them, is by surreptitiously snooping uptime, which more or less
represents kernel jiffies.

If you change uptime to not represente kernel jiffies, goodbye the last
hope for counting CPU time passed from userspace. False timeouts WILL
ensue, and root mounts will fail.

Peter
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/