Yes, I saw the helpers. That is not the issue. The issue is that an always regenerated response will potentially always change, hence the continuation offset the userspace will issue at the next read, will not read where it left. IMO the response should be cached, so that both the size of it, and the content, fit a rolling offset read model. Cached, but when? Once at device open()? Does it provide the right refresh semantics? Once every time offset==0?
On Sun, Dec 6, 2015 at 10:22 AM, Dan Cross <[email protected]> wrote: > There are some helper functions for this for various types of data; > readnum, readstring, etc. I can't remember if there is a 'readbytes' but it > would be useful to add.... > > On Sun, Dec 6, 2015 at 1:05 PM, 'Davide Libenzi' via Akaros < > [email protected]> wrote: > >> When userspace open a device for read, it typically reads the response in >> chunks, with rolling offsets for the reads. >> In the few devices I had my eyes on (kprof/mpstat for one), and in the >> new interrupts one, we build a new response at every read, and use the >> offset to return the proper section of it. >> This is clearly not right, as offsets mean different things at different >> times, as response contents are not the same. >> These kind of devices needs to have some notion of caching the content, >> otherwise userspace will read garbage on the seams. >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Akaros" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to [email protected]. >> To post to this group, send email to [email protected]. >> For more options, visit https://groups.google.com/d/optout. >> > > -- > You received this message because you are subscribed to the Google Groups > "Akaros" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "Akaros" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. For more options, visit https://groups.google.com/d/optout.
