All of lore.kernel.org
 help / color / mirror / Atom feed
* Writing a single buffer in kernel ring buffer take 6-8 ms
@ 2012-05-03 10:05 Chetan Nanda
  2012-05-03 12:21 ` Arun KS
  0 siblings, 1 reply; 3+ messages in thread
From: Chetan Nanda @ 2012-05-03 10:05 UTC (permalink / raw)
  To: kernelnewbies

Hi,

We are working on ARM based SOC.
Currently we are implementing a efficient tracing mechanism to logs
messages from a dedicated MCU.

For this, we share a circular buffer between ARM and MCU and messages
stored in the buffer will be put into kernel ring-buffer and then output
via dmesg call.
Strangely wringing a single log message in the kernel ring-buffer cost
around 6-8ms.

Please help to confirm this, or we are doing something wrong.

Thanks,
Chetan Nanda
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20120503/1f2cb104/attachment.html 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Writing a single buffer in kernel ring buffer take 6-8 ms
  2012-05-03 10:05 Writing a single buffer in kernel ring buffer take 6-8 ms Chetan Nanda
@ 2012-05-03 12:21 ` Arun KS
  2012-05-03 13:19   ` Subramaniam Appadodharana
  0 siblings, 1 reply; 3+ messages in thread
From: Arun KS @ 2012-05-03 12:21 UTC (permalink / raw)
  To: kernelnewbies

Hi Chetan,

On Thu, May 3, 2012 at 3:35 PM, Chetan Nanda <chetannanda@gmail.com> wrote:
> Hi,
>
> We are working on ARM based SOC.
> Currently we are implementing a efficient tracing mechanism to logs messages
> from a dedicated MCU.
>
> For this, we share a circular buffer between ARM and MCU and messages stored
> in the buffer will be put into kernel ring-buffer and then output via dmesg
> call.
> Strangely wringing a single log message in the kernel ring-buffer cost
> around 6-8ms.

Consider this situvation, if your do a printk message of 100
characters at a baud rate of 115200 bps on your UART console.
Now 1 bit it will take 8.68 us(ie.. 1/115200).

So 100 character ie.. 800 bits(exculuding parity, stop bits and all
other over heads) will take 8.68 us * 800 = 6.94 ms.

How are you writing to the kernel log buffer?
Are you using UART as console? If yes what is your baud rate?

If possible give more details about your design.

Thanks,
Arun

>
> Please help to confirm this, or we are doing something wrong.
>
> Thanks,
> Chetan Nanda
>
> _______________________________________________
> Kernelnewbies mailing list
> Kernelnewbies at kernelnewbies.org
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Writing a single buffer in kernel ring buffer take 6-8 ms
  2012-05-03 12:21 ` Arun KS
@ 2012-05-03 13:19   ` Subramaniam Appadodharana
  0 siblings, 0 replies; 3+ messages in thread
From: Subramaniam Appadodharana @ 2012-05-03 13:19 UTC (permalink / raw)
  To: kernelnewbies

On Thu, May 3, 2012 at 7:21 AM, Arun KS <getarunks@gmail.com> wrote:

> Hi Chetan,
>
> On Thu, May 3, 2012 at 3:35 PM, Chetan Nanda <chetannanda@gmail.com>
> wrote:
> > Hi,
> >
> > We are working on ARM based SOC.
> > Currently we are implementing a efficient tracing mechanism to logs
> messages
> > from a dedicated MCU.
> >
> > For this, we share a circular buffer between ARM and MCU and messages
> stored
> > in the buffer will be put into kernel ring-buffer and then output via
> dmesg
> > call.
> > Strangely wringing a single log message in the kernel ring-buffer cost
> > around 6-8ms.
>
> Consider this situvation, if your do a printk message of 100
> characters at a baud rate of 115200 bps on your UART console.
> Now 1 bit it will take 8.68 us(ie.. 1/115200).
>
> So 100 character ie.. 800 bits(exculuding parity, stop bits and all
> other over heads) will take 8.68 us * 800 = 6.94 ms.
>
> How are you writing to the kernel log buffer?
> Are you using UART as console? If yes what is your baud rate?
>
> If possible give more details about your design.
>
> I think Arun's assumptions are valid here. I am not aware of how the
kernel ring buffer is used, but I would think it is better to have the logs
printed out from a user space application. That way you are not blocking
the kernel to spend time printing each message that gets put into the
buffer. Does that make sense?

Thanks,
> Arun
>
> >
> > Please help to confirm this, or we are doing something wrong.
> >
> > Thanks,
> > Chetan Nanda
> >
> > _______________________________________________
> > Kernelnewbies mailing list
> > Kernelnewbies at kernelnewbies.org
> > http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
> >
>
> _______________________________________________
> Kernelnewbies mailing list
> Kernelnewbies at kernelnewbies.org
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20120503/a9fc75f7/attachment.html 

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-05-03 13:19 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-05-03 10:05 Writing a single buffer in kernel ring buffer take 6-8 ms Chetan Nanda
2012-05-03 12:21 ` Arun KS
2012-05-03 13:19   ` Subramaniam Appadodharana

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.