gpsd-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [gpsd-dev] gpsd using excessive cpu


From: Gary E. Miller
Subject: Re: [gpsd-dev] gpsd using excessive cpu
Date: Mon, 16 Nov 2015 13:43:16 -0800

Yo Sean!

On Sun, 15 Nov 2015 10:45:19 +0200
"sean d'epagnier" <address@hidden> wrote:

> I have found that with a 1hz binary gps that gpsd is using up to 6%
> cpu on my haswell processor.

Ouch.

> I found a solution to the problem:

or not.

> +    usleep(100000);

That would be too much for all but the slowest GPS.

>      status = pselect(maxfd + 1, rfds, NULL, NULL, NULL, NULL);

Notice the pselect is only supposed to return when there is data
available.  So either gpsd is not setting up the pselect properly
or your pselect is broken.

> From what I can tell, the pselect returns after every single byte
> received,

Which is what we want.  can you confirm it is only waking up on 
a byte received?

> and there is a lot of overhead between it returning until it
> is called again.   If it could buffer to return only when a complete
> message is sent then it wouldn't use much cpu.

We don't want that, we want timeing info from the start of the message.

And we can't get taht if we wanted since there is no way the kernel can
detect message boundaries.

> Adding the sleep may not be the best solution, but it surely makes the
> cpu usage drop to 0%

There must be something else going on as your result is unusual.

RGDS
GARY
---------------------------------------------------------------------------
Gary E. Miller Rellim 109 NW Wilmington Ave., Suite E, Bend, OR 97703
        address@hidden  Tel:+1 541 382 8588

Attachment: pgpIIhbDVzwo4.pgp
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]