A blog for kernel development

2022-03-04 Thread Amit Kumar
Hi,
I have started this mail thread to interact with other kernel
learners. I am also running a blog for stuff related to Linux kernel
development.
https://blog.freeark1.tv
When a new post will appear on this blog I'll mail it on this thread.
Soon I'll start posting about kernel development.

Regards,
Amit Kumar

___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: USB CDC performance test

2022-03-04 Thread Jeffrey Walton
On Fri, Mar 4, 2022 at 9:37 AM Mithran B  wrote:
>
> On Fri, 4 Mar 2022 at 19:48, Greg KH  wrote:
>>
>> On Fri, Mar 04, 2022 at 04:27:50PM +0530, Mithran B wrote:
>> > Hello,
>> >
>> > In Host and Gadget systems, enabled the USB CDC drivers.
>> > Then nodes are created as /dev/ttyAcm0 and /dev/ttyGs0.
>> > Then opened the nodes and write and read back the data.
>> > It is working.
>> >
>> > I want to test the performance of this interface and drivers.
>> > Do we have any utility for this?
>> > How to do the performance test?
>>
>> What exactly do you want to measure?  Determine that first before trying
>> to find a test for that.  Without knowing what you want to measure, it's
>> hard to tell you how to measure it :)
>>
> I want to send the data at the rate of 5mbps from Host device to target 
> device using USB CDC - ACM.
> In termios functions, how to configure this 5mbps as baud rate and USB 
> payload size, i.e. packet
> size to be in 2K bytes.
>
> How to achieve this?

It seems like dd with a sync could be a good choice. You need the sync
to ensure the writes are flushed.

Maybe something like:

$ su -

# dd if=/dev/zero of= bs=512 count=1M && sync

Also see the dd(1) man page.

Jeff

___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: USB CDC performance test

2022-03-04 Thread Greg KH
On Fri, Mar 04, 2022 at 08:06:55PM +0530, Mithran B wrote:
> On Fri, 4 Mar 2022 at 19:48, Greg KH  wrote:
> 
> > On Fri, Mar 04, 2022 at 04:27:50PM +0530, Mithran B wrote:
> > > Hello,
> > >
> > > In Host and Gadget systems, enabled the USB CDC drivers.
> > > Then nodes are created as /dev/ttyAcm0 and /dev/ttyGs0.
> > > Then opened the nodes and write and read back the data.
> > > It is working.
> > >
> > > I want to test the performance of this interface and drivers.
> > > Do we have any utility for this?
> > > How to do the performance test?
> >
> > What exactly do you want to measure?  Determine that first before trying
> > to find a test for that.  Without knowing what you want to measure, it's
> > hard to tell you how to measure it :)
> >
> > good luck!
> >
> > greg k-h
> >
> 
> Thank you.
> I want to send the data at the rate of 5mbps from Host device to target
> device using USB CDC - ACM.
> In termios functions, how to configure this 5mbps as baud rate and USB
> payload size, i.e. packet
> size to be in 2K bytes.

There is no "baud rate" for usb cdc devices, really, as you have tried
this already, right?

Just send the data as fast as you can, with the largest chunks of data
that you have (do not send it byte by byte to the kernel), and you
should be fine.

Are you sure that your device can handle that type of data rate?  That's
almost always the limiting factor.

good luck!

greg k-h

___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: USB CDC performance test

2022-03-04 Thread Mithran B
On Fri, 4 Mar 2022 at 19:48, Greg KH  wrote:

> On Fri, Mar 04, 2022 at 04:27:50PM +0530, Mithran B wrote:
> > Hello,
> >
> > In Host and Gadget systems, enabled the USB CDC drivers.
> > Then nodes are created as /dev/ttyAcm0 and /dev/ttyGs0.
> > Then opened the nodes and write and read back the data.
> > It is working.
> >
> > I want to test the performance of this interface and drivers.
> > Do we have any utility for this?
> > How to do the performance test?
>
> What exactly do you want to measure?  Determine that first before trying
> to find a test for that.  Without knowing what you want to measure, it's
> hard to tell you how to measure it :)
>
> good luck!
>
> greg k-h
>

Thank you.
I want to send the data at the rate of 5mbps from Host device to target
device using USB CDC - ACM.
In termios functions, how to configure this 5mbps as baud rate and USB
payload size, i.e. packet
size to be in 2K bytes.

How to achieve this?

-Thanks.
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: USB CDC performance test

2022-03-04 Thread Greg KH
On Fri, Mar 04, 2022 at 04:27:50PM +0530, Mithran B wrote:
> Hello,
> 
> In Host and Gadget systems, enabled the USB CDC drivers.
> Then nodes are created as /dev/ttyAcm0 and /dev/ttyGs0.
> Then opened the nodes and write and read back the data.
> It is working.
> 
> I want to test the performance of this interface and drivers.
> Do we have any utility for this?
> How to do the performance test?

What exactly do you want to measure?  Determine that first before trying
to find a test for that.  Without knowing what you want to measure, it's
hard to tell you how to measure it :)

good luck!

greg k-h

___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


Re: Exporting cpu instruction set to kernel .config file

2022-03-04 Thread Torin Carey
On Thu, Mar 03, 2022 at 09:52:50PM -0300, Rogério Valentim Feitoza da Silva 
wrote:
> No kernel should be compiled with compiler optimization, because the compiler
> might remove CPU instructions and code that might look "unnecessary" but
> are actually required.

IIRC a lot of the kernel is compiled with -O2.  You could increase it,
but it's not necessarily a good idea:

On Mon, May 11, 2020 at 05:04:56PM -0700, Linus Torvalds wrote:
> I'm not convinced this is sensible.
>
> -O3 historically does bad things with gcc. Including bad things for
> performance. It traditionally makes code larger and often SLOWER.
>
> And I don't mean slower to compile (although that's an issue). I mean
> actually generating slower code.
>
> Things like trying to unroll loops etc makes very little sense in the
> kernel, where we very seldom have high loop counts for pretty much
> anything.
>
> There's a reason -O3 isn't even offered as an option.
>
> Maybe things have changed, and maybe they've improved. But I'd like to
> see actual numbers for something like this.
>
> Not inlining as aggressively is not necessarily a bad thing. It can
> be, of course. But I've actually also done gcc bugreports about gcc
> inlining too much, and generating _worse_ code as a result (ie
> inlinging things that were behind an "if (unlikely())" test, and
> causing the likely path to grow a stack fram and stack spills as a
> result).
>
> So just "O3 inlines more" is not a valid argument.
--
https://lore.kernel.org/lkml/CAHk-=wi87j=wj0ijkyz3wopvkz9fq1u2blnq66nk425b5kw...@mail.gmail.com/

On the other hand, decreasing it is also probably not a good idea.

Torin


___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies


USB CDC performance test

2022-03-04 Thread Mithran B
Hello,

In Host and Gadget systems, enabled the USB CDC drivers.
Then nodes are created as /dev/ttyAcm0 and /dev/ttyGs0.
Then opened the nodes and write and read back the data.
It is working.

I want to test the performance of this interface and drivers.
Do we have any utility for this?
How to do the performance test?

-Thanks.
___
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies