Help with measuring sleep delay.

3 views
Skip to first unread message

Jens

unread,
Oct 21, 2010, 6:36:17 AM10/21/10
to Beagle Board
Hi!

I'm trying to measure the time it takes for the BeagleBoard to be put
into suspend to RAM -sleep. The problem is that the time seems to vary
a lot from time to time. If I run my sleeping script several times in
a row it only takes a fraction of the time that it takes if I run a
command (any command) in between. On the other hand, if I modify the
script so that it runs some commands before putting it to sleep it
will still fall to sleep extremely fast.

I started looking at the Linux ACPI code, but I have not really got a
clear view of what causes the variation. I came across a "sys_sync();"
call, which sounds like something that could cause this. The only
thing I've been able to find out about this function is that it "syncs
the file systems".

Does anyone know more about this? What could cause my problem? What
does the ACPI really do to suspend to RAM? What does sys_sync do?

I'm very thankful for any response.

- Jens

Rich Hyde

unread,
Oct 21, 2010, 10:45:53 PM10/21/10
to beagl...@googlegroups.com

There are a number of write behind caches associated with the file system, and some other subsystems. These vary by the amount of changes, the type of changes, and the time since previous sync, most systems are configured to sync at minute intervals, but that is configured differently based on the distro.  Certain types of writes are cached until a little bit later to try to combine sequential writes and other things.  It makes a huge difference on system performance.  Anyway it is a write behind cache that needs to be written at such times.  On larger systems it can take minutes to complete these items.

On Oct 21, 2010 5:40 AM, "Jens" <jens.g...@gmail.com> wrote:

Jens

unread,
Oct 22, 2010, 8:27:57 AM10/22/10
to Beagle Board
> On Oct 21, 2010 5:40 AM, "Jens" <jens.g.sm...@gmail.com> wrote:

Yes, the tests I've done seem to support what you are writing. The
syncing has a huge impact on the results and is the reason for the
huge variance.

Thanks a lot for your help!
Reply all
Reply to author
Forward
0 new messages