xfs
[Top] [All Lists]

Re: realtime section bugs still around

To: stan@xxxxxxxxxxxxxxxxx
Subject: Re: realtime section bugs still around
From: Jason Newton <nevion@xxxxxxxxx>
Date: Wed, 1 Aug 2012 19:38:41 -0700
Cc: xfs@xxxxxxxxxxx
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=DXk8um1r+juHka6km6y23IQh4VgZTdGAAYV5NJ0KrcA=; b=iCtSquSOz8e2mjgbLgXZP84o0kyVgxPEKKijkYdjH40FFj1TAzo3uFYD26K3s9um6A HpAYaleyIJJm+6v2jkre1MPyGZey4AMoo4Gw7EIzhy4Zf78nTWdFcIN0+hsI9CFwD3CL Smfk/xmAQMBCoJnftNuNKyM/AsRfj/KooFQdo7v9TvQqLdSiXO6EUfLElHdLXThHXvhn jJqNW2beGG8fwso0sYR8lIOlHtzYfWxUJf0uZ43SBWwq1DetKPO7Rik/yezFijEav98M SWmsZte2sZFHenzrwMFFvvz0pGKtw3FYXDqD1gLDNTvpQ0EW78nccpVaD0Xz8DBC6j3D ZTaQ==
In-reply-to: <5019CC34.5050003@xxxxxxxxxxxxxxxxx>
References: <CAGou9MgezsS=2+SngGWBJv5Npsuqacx1VPJwvMuf0FS+XnXt8A@xxxxxxxxxxxxxx> <20120730030333.GE2877@dastard> <CAGou9MheeBWxajd65szNfDB2L+VVoZ7SypEdUKj7np3L0H8fHA@xxxxxxxxxxxxxx> <CAGou9MgMHbTPebFUDXdyLvrUr4T9wo-geNtaPUft9uUmOaju6Q@xxxxxxxxxxxxxx> <50186E51.1020107@xxxxxxxxxxxxxxxxx> <CAGou9MhneejOuhX4c8G06c3Zh7dxF-OtZ+=mT-7fho_u1Q3zWw@xxxxxxxxxxxxxx> <5018A8C7.8050406@xxxxxxxxxxxxxxxxx> <CAGou9Mj=8xcF4YwaSQYp0_BbJW_Ms1sasDDRNxL1oh0oR7zupw@xxxxxxxxxxxxxx> <5019CC34.5050003@xxxxxxxxxxxxxxxxx>
On Wed, Aug 1, 2012 at 5:39 PM, Stan Hoeppner <stan@xxxxxxxxxxxxxxxxx> wrote:
On 8/1/2012 12:55 AM, Jason Newton wrote:

>> Just to figure out for sure what the bottlenecks are and whether they can
> be dealt with rather than looking at it as opaque system and assuming
> nothing can be done.  Also as a learning experience.

Jason, have you considered something like this to solve your problems?

RAM is cheap.  Far cheaper than attacking this problem with any other
hardware type.  And you can't easily solve it by rewriting to use AIO,
given the effort involved with that.

You should be able to fit 32GB of RAM on the board.  Create a 24GB RAM
disk and use that for writing your 5.7MB frame files in real time.  This
eliminates any latency and stutter issues during capture.  Treat the RAM
disk as a FIFO, taking each new file and copying it out to SSD after
it's been closed, then delete the original.  This gives you in essence a
very fast buffer.  If my math is correct, 24,000MB / 300MB/s = roughly
80 seconds of buffer at a 300MB/s streaming capture rate, 40 seconds at
600MB/s.
 
The system has a single slot of SODIMM. We have an 8GB DDR3 stick in it.  I've added a circular buffer for each frame and limit it to some number of frames (so far 2 seconds, I haven't had time to experiment with it yet).  The serialization thread is now separate and consumes the circular buffer so we're effectively talking about the same thing sans files.  This solves the problem but as I mentioned before... I do have a desire to seek out the sources of the latency and cpu usage... I'm not really sure of how to go about it though.

This should be very easy to implement, and cheaper than all other
alternatives.  It should eliminate all possible latency issues, though
it will increase CPU cycles due to the data movement to/from the RAM
disk, though how much I can't guess at this point.  8GB RAM disk will
give you 26 seconds of buffering at 300MB/s, and a 4GB RAM disk will
give you 13 seconds of buffering.  If 13 seconds is sufficient, you can
implement this on a machine with only 8GB RAM, assuming you need no more
than 4GB for kernel/user space/application.

Agreed that it's the easiest and cheapest solution. Average performance probably won't change but burst of cpu will as it compensates for the high latency writes in future cycles... this is undesirable but I think OK (the important stuff is at high priority on SCHED_RR, these serialization threads are high priority SCHED_OTHER).  Again, I haven't had time to test it as I've been putting out other fires.

-Jason
<Prev in Thread] Current Thread [Next in Thread>