All of lore.kernel.org
 help / color / mirror / Atom feed
* Exporting cpu instruction set to kernel .config file
@ 2022-03-02 16:57 Guddla Rupesh
  2022-03-03  1:05 ` FMDF
  0 siblings, 1 reply; 11+ messages in thread
From: Guddla Rupesh @ 2022-03-02 16:57 UTC (permalink / raw)
  To: kernelnewbies


[-- Attachment #1.1: Type: text/plain, Size: 1327 bytes --]

I have seen the config from /proc/config.gz and found that processor family
as generic x86 64.

Actually my system consists of i3 10th gen comet lake 10100 which has
integrated graphics and pci express 4.0 and also lots of new instructions
like avx2, sse4 etc.,.

The main reason of compiling source code of kernel is it detects all my
hardware and provide support for opencl, video acceleration etc.,. But I
can't find any option to select my processor especially comet lake or
atleast skylake and instead there is an option called core2 in the section
processor family.

Finally I have disabled secure boot mode in bios and compiled source code
successfully and now I am able to boot into the latest build kernel but
there is no difference in performance between old and new kernels.

I think that normal kernel shipped by the distro is generic and it doesn't
have support for latest instructions like avx2, sse4 etc.,. To get support
we must compile kernel with lots of tuning.

I have exported the modules running on system and disable others by running
the command

make localmodconfig

What I want is " is there any way to export my cpu instruction set to
kernel .config file and compile kernel and install the modules.".

If I can compile kernel source code then my Linux system will run at
extreme speeds never before.

[-- Attachment #1.2: Type: text/html, Size: 1433 bytes --]

[-- Attachment #2: Type: text/plain, Size: 170 bytes --]

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

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

* Re: Exporting cpu instruction set to kernel .config file
  2022-03-02 16:57 Exporting cpu instruction set to kernel .config file Guddla Rupesh
@ 2022-03-03  1:05 ` FMDF
  2022-03-03  1:20   ` FMDF
                     ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: FMDF @ 2022-03-03  1:05 UTC (permalink / raw)
  To: Guddla Rupesh; +Cc: kernelnewbies


[-- Attachment #1.1: Type: text/plain, Size: 3007 bytes --]

On Wed, 2 Mar 2022, 17:57 Guddla Rupesh, <rupeshforu3@gmail.com> wrote:

> I have seen the config from /proc/config.gz and found that processor
> family as generic x86 64.
>
> Actually my system consists of i3 10th gen comet lake 10100 which has
> integrated graphics and pci express 4.0 and also lots of new instructions
> like avx2, sse4 etc.,.
>
Therefore, in .config, you should enable x86-64. That's it. Simple.

> The main reason of compiling source code of kernel is it detects all my
> hardware and provide support for opencl, video acceleration etc.,. But I
> can't find any option to select my processor especially comet lake or
> atleast skylake and instead there is an option called core2 in the section
> processor family.
>
There are no Cometlake or Skylake options for kernel compilation. Your
recent CPU is already supported and the whole ISA is available. Compilers
know your system and they know which instructions are better suited for
your applications and kernel code.

> Finally I have disabled secure boot mode in bios and compiled source code
> successfully and now I am able to boot into the latest build kernel but
> there is no difference in performance between old and new kernels.
>
Why have you disabled secure boot mode? If performance concerns you, don't
worry about it: there is no loss of performance with secure boot.

> I think that normal kernel shipped by the distro is generic and it doesn't
> have support for latest instructions like avx2, sse4 etc.,. To get support
> we must compile kernel with lots of tuning.
>
No, you're wrong :)

Just select the highest available processor family (I can't recall now if
it is "core2" or "generic x86_64", it's the last of the list in the
"processor family" section if you use "make menuconfig") and the entire
instruction set of Intel x86-64 will be enabled and available.

There is neither a "CONFIG_GENERATION_11" nor similar options.

> I have exported the modules running on system and disable others by
> running the command
>
> make localmodconfig
>
Beware that using "localmodconfig" disables the build of lots of modules
you may need in the future. It relies on the current system configuration.
When you'll add new devices you'll have to enable their drivers and
recompile the modules.

> What I want is " is there any way to export my cpu instruction set to
> kernel .config file and compile kernel and install the modules.".
>
> If I can compile kernel source code then my Linux system will run at
> extreme speeds never before.
>
You might tune the optimization flags of (e.g., GCC's "-On", for n=0,1,2,
and  others) but I strongly advise you to not do this because (1) it is
clear that you don't understand how the code is compiled and (2) you
probably won't get the results you think you should get.

Regards,

Fabio M. De Francesco

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

[-- Attachment #1.2: Type: text/html, Size: 5131 bytes --]

[-- Attachment #2: Type: text/plain, Size: 170 bytes --]

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

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

* Re: Exporting cpu instruction set to kernel .config file
  2022-03-03  1:05 ` FMDF
@ 2022-03-03  1:20   ` FMDF
  2022-03-03 15:21     ` Guddla Rupesh
       [not found]   ` <CALgyNi2MGdmjGzVnBQ+cnCg94-k3ZTeHpCik2D7HwBVtFbLLjA@mail.gmail.com>
  2022-03-04  0:52   ` Rogério Valentim Feitoza da Silva
  2 siblings, 1 reply; 11+ messages in thread
From: FMDF @ 2022-03-03  1:20 UTC (permalink / raw)
  To: Guddla Rupesh; +Cc: torin, kernelnewbies


[-- Attachment #1.1: Type: text/plain, Size: 3339 bytes --]

On Thu, 3 Mar 2022, 02:05 FMDF, <fmdefrancesco@gmail.com> wrote:

> On Wed, 2 Mar 2022, 17:57 Guddla Rupesh, <rupeshforu3@gmail.com> wrote:
>
>> I have seen the config from /proc/config.gz and found that processor
>> family as generic x86 64.
>>
>> Actually my system consists of i3 10th gen comet lake 10100 which has
>> integrated graphics and pci express 4.0 and also lots of new instructions
>> like avx2, sse4 etc.,.
>>
> Therefore, in .config, you should enable x86-64. That's it. Simple.
>
>> The main reason of compiling source code of kernel is it detects all my
>> hardware and provide support for opencl, video acceleration etc.,. But I
>> can't find any option to select my processor especially comet lake or
>> atleast skylake and instead there is an option called core2 in the section
>> processor family.
>>
> There are no Cometlake or Skylake options for kernel compilation. Your
> recent CPU is already supported and the whole ISA is available. Compilers
> know your system and they know which instructions are better suited for
> your applications and kernel code.
>
>> Finally I have disabled secure boot mode in bios and compiled source code
>> successfully and now I am able to boot into the latest build kernel but
>> there is no difference in performance between old and new kernels.
>>
> Why have you disabled secure boot mode? If performance concerns you, don't
> worry about it: there is no loss of performance with secure boot.
>
>> I think that normal kernel shipped by the distro is generic and it
>> doesn't have support for latest instructions like avx2, sse4 etc.,. To get
>> support we must compile kernel with lots of tuning.
>>
> No, you're wrong :)
>
> Just select the highest available processor family (I can't recall now if
> it is "core2" or "generic x86_64", it's the last of the list in the
> "processor family" section if you use "make menuconfig") and the entire
> instruction set of Intel x86-64 will be enabled and available.
>
> There is neither a "CONFIG_GENERATION_11" nor similar options.
>
>> I have exported the modules running on system and disable others by
>> running the command
>>
>> make localmodconfig
>>
> Beware that using "localmodconfig" disables the build of lots of modules
> you may need in the future. It relies on the current system configuration.
> When you'll add new devices you'll have to enable their drivers and
> recompile the modules.
>
>> What I want is " is there any way to export my cpu instruction set to
>> kernel .config file and compile kernel and install the modules.".
>>
>> If I can compile kernel source code then my Linux system will run at
>> extreme speeds never before.
>>
> You might tune the optimization flags of (e.g., GCC's "-On", for n=0,1,2,
> and  others) but I strongly advise you to not do this because (1) it is
> clear that you don't understand how the code is compiled and (2) you
> probably won't get the results you think you should get.
>
> Regards,
>
> Fabio M. De Francesco
>

I was about to forget three more things:

1) Read Torin's answer because he is right.
2) Don't touch configuration's options that you don't know. For instance,
do you know if you should enable "CONFIG_CORE_SCHED"? Just think that you
can inadvertently disable Intel Hyperthreading with that option.
3) Just copy your distro's .config and re-compile :)

[-- Attachment #1.2: Type: text/html, Size: 5624 bytes --]

[-- Attachment #2: Type: text/plain, Size: 170 bytes --]

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

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

* Re: Exporting cpu instruction set to kernel .config file
  2022-03-03  1:20   ` FMDF
@ 2022-03-03 15:21     ` Guddla Rupesh
       [not found]       ` <CAPj211vBPjs-rAHtjkQetzoOChHhaaPATBFfXNTmmnG0sGovVQ@mail.gmail.com>
  2022-03-03 23:06       ` Valdis Klētnieks
  0 siblings, 2 replies; 11+ messages in thread
From: Guddla Rupesh @ 2022-03-03 15:21 UTC (permalink / raw)
  To: kernelnewbies


[-- Attachment #1.1: Type: text/plain, Size: 6288 bytes --]

Pentium MMX was launched about 30 years ago and at that time video
processing was new and there was no proper hardware just to play any video
file I mean if you play any video file video playback stops sometimes and
resume after some time.

At present there is lot of development in video hardware and at the same
time new technologies in both hardware and software has been evolved.
Coming into hardware CPUs with integrated graphics came and coming into
software many video and audio codecs have been developed like h265, vpx,
av1, aac, opus etc.,.Of these aac and opus are audio codecs which produces
lowest disk size at reasonable quality and h265, av1 are video codecs which
provides lowest disk size at reasonable quality.

Most of the time I download videos from youtube and other sources which are
of large size. When you record a video in android smartphone it takes
around 600 mb for 3 minutes 50 seconds and it uses h265 codec. It is
difficult to store such files in my android smartphone.

Mostly I use Linux and ffmpeg tool to compress these video files. Of h265
and av1 aom encoders. av1 aom encoder provide lowest disk size at lowest
video bitrate. H265 encoding and decoding are supported in all hardware
including pc and smartphone but unfortunately av1 files are not supported
in none but definitely I think that it will become defacto standard in
future.

If h265 encoding takes 1 minute then aom av1 encoding takes about 10
minutes. If video acceleration is present the encoding takes about 7
minutes. Video acceleration come into action only if GPU is detected
properly and the necessary drivers are installed. If the system can detect
opecl version of GPU then av1 encoding takes about 5 minutes through ffmpeg.

As MMX was trending about 30 years ago I think that latest processors have
vector instructions for video transcoding or encoding like avx2 or avx 512,
simd etc.,. These new instructions are not present in 15 years back
processors.

As 64 bit processor came into action around 20 years back nowadays
processors are 10 times are greater in performance than old.

I think that all the kernels shipped by distros are not considering latest
processors instruction set. I think that even windows is doing the same.

If opencl is detected properly any application can have improvement in
performance about 10 percent.

I can't find any option to set opencl in the Linux kernel config file or in
any of the kernel source files.

Atleast I am lucky to select option core 2 in the main .config file of
kernel.

Finally my request is there any way to export instruct set of my cpu to the
kernel configuration and so after compilation my video encoding takes less
time than previous.

If it's a difficult task leave it and if it's possible try to suggest how
to do so.

On Thu, 3 Mar 2022, 6:56 am FMDF, <fmdefrancesco@gmail.com> wrote:

> On Thu, 3 Mar 2022, 02:05 FMDF, <fmdefrancesco@gmail.com> wrote:
>
>> On Wed, 2 Mar 2022, 17:57 Guddla Rupesh, <rupeshforu3@gmail.com> wrote:
>>
>>> I have seen the config from /proc/config.gz and found that processor
>>> family as generic x86 64.
>>>
>>> Actually my system consists of i3 10th gen comet lake 10100 which has
>>> integrated graphics and pci express 4.0 and also lots of new instructions
>>> like avx2, sse4 etc.,.
>>>
>> Therefore, in .config, you should enable x86-64. That's it. Simple.
>>
>>> The main reason of compiling source code of kernel is it detects all my
>>> hardware and provide support for opencl, video acceleration etc.,. But I
>>> can't find any option to select my processor especially comet lake or
>>> atleast skylake and instead there is an option called core2 in the section
>>> processor family.
>>>
>> There are no Cometlake or Skylake options for kernel compilation. Your
>> recent CPU is already supported and the whole ISA is available. Compilers
>> know your system and they know which instructions are better suited for
>> your applications and kernel code.
>>
>>> Finally I have disabled secure boot mode in bios and compiled source
>>> code successfully and now I am able to boot into the latest build kernel
>>> but there is no difference in performance between old and new kernels.
>>>
>> Why have you disabled secure boot mode? If performance concerns you,
>> don't worry about it: there is no loss of performance with secure boot.
>>
>>> I think that normal kernel shipped by the distro is generic and it
>>> doesn't have support for latest instructions like avx2, sse4 etc.,. To get
>>> support we must compile kernel with lots of tuning.
>>>
>> No, you're wrong :)
>>
>> Just select the highest available processor family (I can't recall now if
>> it is "core2" or "generic x86_64", it's the last of the list in the
>> "processor family" section if you use "make menuconfig") and the entire
>> instruction set of Intel x86-64 will be enabled and available.
>>
>> There is neither a "CONFIG_GENERATION_11" nor similar options.
>>
>>> I have exported the modules running on system and disable others by
>>> running the command
>>>
>>> make localmodconfig
>>>
>> Beware that using "localmodconfig" disables the build of lots of modules
>> you may need in the future. It relies on the current system configuration.
>> When you'll add new devices you'll have to enable their drivers and
>> recompile the modules.
>>
>>> What I want is " is there any way to export my cpu instruction set to
>>> kernel .config file and compile kernel and install the modules.".
>>>
>>> If I can compile kernel source code then my Linux system will run at
>>> extreme speeds never before.
>>>
>> You might tune the optimization flags of (e.g., GCC's "-On", for n=0,1,2,
>> and  others) but I strongly advise you to not do this because (1) it is
>> clear that you don't understand how the code is compiled and (2) you
>> probably won't get the results you think you should get.
>>
>> Regards,
>>
>> Fabio M. De Francesco
>>
>
> I was about to forget three more things:
>
> 1) Read Torin's answer because he is right.
> 2) Don't touch configuration's options that you don't know. For instance,
> do you know if you should enable "CONFIG_CORE_SCHED"? Just think that you
> can inadvertently disable Intel Hyperthreading with that option.
> 3) Just copy your distro's .config and re-compile :)
>
>

[-- Attachment #1.2: Type: text/html, Size: 9360 bytes --]

[-- Attachment #2: Type: text/plain, Size: 170 bytes --]

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

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

* Re: Exporting cpu instruction set to kernel .config file
       [not found]       ` <CAPj211vBPjs-rAHtjkQetzoOChHhaaPATBFfXNTmmnG0sGovVQ@mail.gmail.com>
@ 2022-03-03 18:44         ` FMDF
  2022-03-03 18:46         ` Fwd: " FMDF
  1 sibling, 0 replies; 11+ messages in thread
From: FMDF @ 2022-03-03 18:44 UTC (permalink / raw)
  To: Guddla Rupesh; +Cc: kernelnewbies


[-- Attachment #1.1: Type: text/plain, Size: 1577 bytes --]

On Thu, 3 Mar 2022, 19:43 FMDF, <fmdefrancesco@gmail.com> wrote:

> On Thu, 3 Mar 2022, 16:21 Guddla Rupesh, <rupeshforu3@gmail.com> wrote:
>
> I think that all the kernels shipped by distros are not considering latest
>> processors instruction set. I think that even windows is doing the same.
>>
>> If opencl is detected properly any application can have improvement in
>> performance about 10 percent.
>>
>> I can't find any option to set opencl in the Linux kernel config file or
>> in any of the kernel source files.
>>
>> Atleast I am lucky to select option core 2 in the main .config file of
>> kernel.
>>
>> Finally my request is there any way to export instruct set of my cpu to
>> the kernel configuration and so after compilation my video encoding takes
>> less time than previous.
>>
>> If it's a difficult task leave it and if it's possible try to suggest how
>> to do so.
>>
>
> You have not read Torin's and my replies. I can assure you that Linux uses
> ALL the latest extensions of Intel and AMD instruction sets.
>
> And you didn't even read the code that Torin pointed out to you.
>
> Personally I have written documentation for various x86-64 newer
> subsystem. There is nothing of those ISA that Linux kernel and OS don't
> support. The fact that the configuration option is simply called
> CONFIG_CORE2 (or whatever) has no meaning at all.
>
> If you can, please attach GDB to executing code or read the Assembly
> output by GCC and see yourself what instructions Linux uses in the
> subsystems of your choice.
>
> Regards,
>
> Fabio M. De Francesco
>
>>

[-- Attachment #1.2: Type: text/html, Size: 2803 bytes --]

[-- Attachment #2: Type: text/plain, Size: 170 bytes --]

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

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

* Fwd: Exporting cpu instruction set to kernel .config file
       [not found]       ` <CAPj211vBPjs-rAHtjkQetzoOChHhaaPATBFfXNTmmnG0sGovVQ@mail.gmail.com>
  2022-03-03 18:44         ` FMDF
@ 2022-03-03 18:46         ` FMDF
  1 sibling, 0 replies; 11+ messages in thread
From: FMDF @ 2022-03-03 18:46 UTC (permalink / raw)
  To: Guddla Rupesh, kernelnewbies


[-- Attachment #1.1: Type: text/plain, Size: 1731 bytes --]

Sorry, I forgot to add kernelnewbies in the email below...

---------- Forwarded message ---------
From: FMDF <fmdefrancesco@gmail.com>
Date: Thu, 3 Mar 2022, 19:43
Subject: Re: Exporting cpu instruction set to kernel .config file
To: Guddla Rupesh <rupeshforu3@gmail.com>


On Thu, 3 Mar 2022, 16:21 Guddla Rupesh, <rupeshforu3@gmail.com> wrote:

I think that all the kernels shipped by distros are not considering latest
> processors instruction set. I think that even windows is doing the same.
>
> If opencl is detected properly any application can have improvement in
> performance about 10 percent.
>
> I can't find any option to set opencl in the Linux kernel config file or
> in any of the kernel source files.
>
> Atleast I am lucky to select option core 2 in the main .config file of
> kernel.
>
> Finally my request is there any way to export instruct set of my cpu to
> the kernel configuration and so after compilation my video encoding takes
> less time than previous.
>
> If it's a difficult task leave it and if it's possible try to suggest how
> to do so.
>

You have not read Torin's and my replies. I can assure you that Linux uses
ALL the latest extensions of Intel and AMD instruction sets.

And you didn't even read the code that Torin pointed out to you.

Personally I have written documentation for various x86-64 newer subsystem.
There is nothing of those ISA that Linux kernel and OS don't support. The
fact that the configuration option is simply called CONFIG_CORE2 (or
whatever) has no meaning at all.

If you can, please attach GDB to executing code or read the Assembly output
by GCC and see yourself what instructions Linux uses in the subsystems of
your choice.

Regards,

Fabio M. De Francesco

>

[-- Attachment #1.2: Type: text/html, Size: 3091 bytes --]

[-- Attachment #2: Type: text/plain, Size: 170 bytes --]

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

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

* Re: Exporting cpu instruction set to kernel .config file
       [not found]   ` <CALgyNi2MGdmjGzVnBQ+cnCg94-k3ZTeHpCik2D7HwBVtFbLLjA@mail.gmail.com>
@ 2022-03-03 19:39     ` FMDF
  0 siblings, 0 replies; 11+ messages in thread
From: FMDF @ 2022-03-03 19:39 UTC (permalink / raw)
  To: Rogério Valentim Feitoza da Silva
  Cc: Guddla Rupesh, torin, kernelnewbies


[-- Attachment #1.1: Type: text/plain, Size: 1111 bytes --]

On Thu, 3 Mar 2022, 20:01 Rogério Valentim Feitoza da Silva, <
rogerio.silva3920@gmail.com> wrote:

Rupesh has disabled Secure Boot because the kernel that Rupesh
> compiled couldn't boot with Secure Boot enabled.
> GRUB failed to load the kernel with the message "bad shim signature"
> and the "boot" command failed with
> "you need to load the kernel first" error (because the kernel failed to
> load).
>

Ah, I understand.

This is one more reason why he shouldn't change his .config file: he has no
knowledge of how kernels are built and of how the boot process in modern PC
works :)

I mean that he shouldn't had disabled secure boot for his custom kernel.

Developers / Administrators generate their own machine owner key and enroll
them in UEFI. Then they build custom signed kernels and loadable modules,
install and boot.

Disabling secure boot just because one doesn't know how to enroll their
keys and sign kernel objects is a very dangerous thing to do.

It's easy and lots of tutorials are in the web.

Regards,

Fabio M. De Francesco



> -Rogério Valentim
>

[-- Attachment #1.2: Type: text/html, Size: 2058 bytes --]

[-- Attachment #2: Type: text/plain, Size: 170 bytes --]

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

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

* Re: Exporting cpu instruction set to kernel .config file
  2022-03-03 15:21     ` Guddla Rupesh
       [not found]       ` <CAPj211vBPjs-rAHtjkQetzoOChHhaaPATBFfXNTmmnG0sGovVQ@mail.gmail.com>
@ 2022-03-03 23:06       ` Valdis Klētnieks
  1 sibling, 0 replies; 11+ messages in thread
From: Valdis Klētnieks @ 2022-03-03 23:06 UTC (permalink / raw)
  To: Guddla Rupesh; +Cc: kernelnewbies


[-- Attachment #1.1: Type: text/plain, Size: 595 bytes --]

On Thu, 03 Mar 2022 20:51:09 +0530, Guddla Rupesh said:

> Finally my request is there any way to export instruct set of my cpu to the
> kernel configuration and so after compilation my video encoding takes less
> time than previous.

Why would the instruction set used by the kernel matter, when video encoding
is done in userspace?  You would get more improvement if you recompiled
the software that does the video encoding - and as I mentioned, it won't help
unless the compiler knows about the opcodes *and* can recognize the spots
in the userspace code where those opcodes would be useful.

[-- Attachment #1.2: Type: application/pgp-signature, Size: 494 bytes --]

[-- Attachment #2: Type: text/plain, Size: 170 bytes --]

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

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

* Re: Exporting cpu instruction set to kernel .config file
  2022-03-03  1:05 ` FMDF
  2022-03-03  1:20   ` FMDF
       [not found]   ` <CALgyNi2MGdmjGzVnBQ+cnCg94-k3ZTeHpCik2D7HwBVtFbLLjA@mail.gmail.com>
@ 2022-03-04  0:52   ` Rogério Valentim Feitoza da Silva
  2022-03-04 11:18     ` Torin Carey
  2 siblings, 1 reply; 11+ messages in thread
From: Rogério Valentim Feitoza da Silva @ 2022-03-04  0:52 UTC (permalink / raw)
  To: FMDF; +Cc: kernelnewbies


[-- Attachment #1.1: Type: text/plain, Size: 3347 bytes --]

On Wednesday, 2 March 2022, FMDF <fmdefrancesco@gmail.com> wrote:

> On Wed, 2 Mar 2022, 17:57 Guddla Rupesh, <rupeshforu3@gmail.com> wrote:
>
>> I have seen the config from /proc/config.gz and found that processor
>> family as generic x86 64.
>>
>> Actually my system consists of i3 10th gen comet lake 10100 which has
>> integrated graphics and pci express 4.0 and also lots of new instructions
>> like avx2, sse4 etc.,.
>>
> Therefore, in .config, you should enable x86-64. That's it. Simple.
>
>> The main reason of compiling source code of kernel is it detects all my
>> hardware and provide support for opencl, video acceleration etc.,. But I
>> can't find any option to select my processor especially comet lake or
>> atleast skylake and instead there is an option called core2 in the section
>> processor family.
>>
> There are no Cometlake or Skylake options for kernel compilation. Your
> recent CPU is already supported and the whole ISA is available. Compilers
> know your system and they know which instructions are better suited for
> your applications and kernel code.
>
>> Finally I have disabled secure boot mode in bios and compiled source code
>> successfully and now I am able to boot into the latest build kernel but
>> there is no difference in performance between old and new kernels.
>>
> Why have you disabled secure boot mode? If performance concerns you, don't
> worry about it: there is no loss of performance with secure boot.
>
>> I think that normal kernel shipped by the distro is generic and it
>> doesn't have support for latest instructions like avx2, sse4 etc.,. To get
>> support we must compile kernel with lots of tuning.
>>
> No, you're wrong :)
>
> Just select the highest available processor family (I can't recall now if
> it is "core2" or "generic x86_64", it's the last of the list in the
> "processor family" section if you use "make menuconfig") and the entire
> instruction set of Intel x86-64 will be enabled and available.
>
> There is neither a "CONFIG_GENERATION_11" nor similar options.
>
>> I have exported the modules running on system and disable others by
>> running the command
>>
>> make localmodconfig
>>
> Beware that using "localmodconfig" disables the build of lots of modules
> you may need in the future. It relies on the current system configuration.
> When you'll add new devices you'll have to enable their drivers and
> recompile the modules.
>
>> What I want is " is there any way to export my cpu instruction set to
>> kernel .config file and compile kernel and install the modules.".
>>
>> If I can compile kernel source code then my Linux system will run at
>> extreme speeds never before.
>>
> You might tune the optimization flags of (e.g., GCC's "-On", for n=0,1,2,
> and  others) but I strongly advise you to not do this because (1) it is
> clear that you don't understand how the code is compiled and (2) you
> probably won't get the results you think you should get.
>
> Regards,
>
> Fabio M. De Francesco
>
> _______________________________________________
>> Kernelnewbies mailing list
>> Kernelnewbies@kernelnewbies.org
>> https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>>
> 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.

[-- Attachment #1.2: Type: text/html, Size: 5604 bytes --]

[-- Attachment #2: Type: text/plain, Size: 170 bytes --]

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

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

* Re: Exporting cpu instruction set to kernel .config file
  2022-03-04  0:52   ` Rogério Valentim Feitoza da Silva
@ 2022-03-04 11:18     ` Torin Carey
  0 siblings, 0 replies; 11+ messages in thread
From: Torin Carey @ 2022-03-04 11:18 UTC (permalink / raw)
  To: Rogério Valentim Feitoza da Silva; +Cc: FMDF, kernelnewbies

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=wj0ijkYZ3WoPVkZ9Fq1U2bLnQ66nk425B5kW0Cw@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

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

* Re: Exporting cpu instruction set to kernel .config file
@ 2022-03-02 17:11 Torin Carey
  0 siblings, 0 replies; 11+ messages in thread
From: Torin Carey @ 2022-03-02 17:11 UTC (permalink / raw)
  To: Guddla Rupesh; +Cc: kernelnewbies

Hi Guddla,

On Wed, Mar 02, 2022 at 10:27:15PM +0530, Guddla Rupesh wrote:
> I think that normal kernel shipped by the distro is generic and it
> doesn't have support for latest instructions like avx2, sse4 etc.,. To
> get support we must compile kernel with lots of tuning.

I believe most of these features are indicated by CPUID and are tested
at runtime/boottime, rather than being compiled in.
See https://elixir.bootlin.com/linux/latest/source/arch/x86/include/asm/cpufeatures.h

Torin


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

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

end of thread, other threads:[~2022-03-04 11:18 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-02 16:57 Exporting cpu instruction set to kernel .config file Guddla Rupesh
2022-03-03  1:05 ` FMDF
2022-03-03  1:20   ` FMDF
2022-03-03 15:21     ` Guddla Rupesh
     [not found]       ` <CAPj211vBPjs-rAHtjkQetzoOChHhaaPATBFfXNTmmnG0sGovVQ@mail.gmail.com>
2022-03-03 18:44         ` FMDF
2022-03-03 18:46         ` Fwd: " FMDF
2022-03-03 23:06       ` Valdis Klētnieks
     [not found]   ` <CALgyNi2MGdmjGzVnBQ+cnCg94-k3ZTeHpCik2D7HwBVtFbLLjA@mail.gmail.com>
2022-03-03 19:39     ` FMDF
2022-03-04  0:52   ` Rogério Valentim Feitoza da Silva
2022-03-04 11:18     ` Torin Carey
2022-03-02 17:11 Torin Carey

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.