Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
gentoo-sources-5.1.0 ebuild question
View unanswered posts
View posts from last 24 hours

Goto page Previous  1, 2  
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
Tony0945
Advocate
Advocate


Joined: 25 Jul 2006
Posts: 4739
Location: Illinois, USA

PostPosted: Sun May 12, 2019 1:34 pm    Post subject: Reply with quote

kajzer wrote:
IMHO that USE flag should be removed and the additional CPU optimizations patch should be included with the rest of the patches.

Absolutely! Would it help to file an improvement bug? Against gentoo-sources generally?
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 47961
Location: 56N 3W

PostPosted: Sun May 12, 2019 4:18 pm    Post subject: Reply with quote

Tony0945,

File the bug against the upstream kernel.
There is probably a reason why its not been adopted. Like it increases the test burden on kernel devs.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
wrc1944
Advocate
Advocate


Joined: 15 Aug 2002
Posts: 3378
Location: Gainesville, Florida

PostPosted: Sun May 12, 2019 4:47 pm    Post subject: Reply with quote

Well, it's now in the 5.1.1 ebuild (but NOT in the 5.1.0 ebuild),

Code:
# Copyright 1999-2019 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI="6"
ETYPE="sources"
K_WANT_GENPATCHES="base extras"
K_GENPATCHES_VER="2"

inherit kernel-2
detect_version
detect_arch

KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86"
HOMEPAGE="https://dev.gentoo.org/~mpagano/genpatches"
IUSE="experimental"

DESCRIPTION="Full sources including the Gentoo patchset for the ${KV_MAJOR}.${KV_MINOR} kernel tree"
SRC_URI="${KERNEL_URI} ${GENPATCHES_URI} ${ARCH_URI}"

pkg_postinst() {
   kernel-2_pkg_postinst
   einfo "For more info on this patchset, and how to report problems, see:"
   einfo "${HOMEPAGE}"
}

pkg_postrm() {
   kernel-2_pkg_postrm
}


and, I get:
Code:
amd64 ~ # emerge gentoo-sources -pv

These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild   R    ] sys-kernel/gentoo-sources-5.1.1:5.1.1::gentoo  USE="experimental -build -symlink" 103,755 KiB

So I thought it was good to go, but I still get:
Code:
2019-05-12 12:28:34 (2.06 MB/s) - ‘/usr/portage/distfiles/linux-5.1.tar.xz.__download__’ saved [106244476/106244476]

 * linux-5.1.tar.xz BLAKE2B SHA512 size ;-) ...                                                                                             [ ok ]
 * genpatches-5.1-2.base.tar.xz BLAKE2B SHA512 size ;-) ...                                                                                 [ ok ]
 * genpatches-5.1-2.extras.tar.xz BLAKE2B SHA512 size ;-) ...                                                                               [ ok ]
>>> Preparing to unpack ...
>>> Unpacking source...
>>> Unpacking linux-5.1.tar.xz to /var/tmp/portage/sys-kernel/gentoo-sources-5.1.1/work
>>> Unpacking genpatches-5.1-2.base.tar.xz to /var/tmp/portage/sys-kernel/gentoo-sources-5.1.1/work/patches
>>> Unpacking genpatches-5.1-2.extras.tar.xz to /var/tmp/portage/sys-kernel/gentoo-sources-5.1.1/work/patches
 * Excluding Patch #5010_enable-additional-cpu-optimizations-for-gcc.patch ...                                                              [ ok ]
 * Excluding Patch #5010_enable-additional-cpu-optimizations-for-gcc-4.9.patch ...                                                          [ ok ]
 * Excluding Patch #5010_enable-additional-cpu-optimizations-for-gcc.patch ...                                                              [ ok ]
 * Excluding Patch #5010_enable-additional-cpu-optimizations-for-gcc-4.9.patch ...                                                          [ ok ]
 * Applying 1000_linux-5.1.1.patch (-p1) ...                                                                                                [ ok ]
 * Applying 1500_XATTR_USER_PREFIX.patch (-p1) ...                                                                                          [ ok ]
 * Applying 1510_fs-enable-link-security-restrictions-by-default.patch (-p1) ...                                                            [ ok ]
 * Applying 2500_usb-storage-Disable-UAS-on-JMicron-SATA-enclosure.patch (-p1) ...                                                          [ ok ]
 * Applying 2600_enable-key-swapping-for-apple-mac.patch (-p1) ...                                                                          [ ok ]
 * Applying 4567_distro-Gentoo-Kconfig.patch (-p1) ...                                                                                      [ ok ]
>>> Source unpacked in /var/tmp/portage/sys-kernel/gentoo-sources-5.1.1/work
>>> Preparing source in /var/tmp/portage/sys-kernel/gentoo-sources-5.1.1/work/linux-5.1.1-gentoo ...
>>> Source prepared.
>>> Configuring source in /var/tmp/portage/sys-kernel/gentoo-sources-5.1.1/work/linux-5.1.1-gentoo ...
>>> Source configured.
>>> Compiling source in /var/tmp/portage/sys-kernel/gentoo-sources-5.1.1/work/linux-5.1.1-gentoo ...
>>> Source compiled.
>>> Test phase [not enabled]: sys-kernel/gentoo-sources-5.1.1

>>> Install gentoo-sources-5.1.1 into /var/tmp/portage/sys-kernel/gentoo-sources-5.1.1/image/ category sys-kernel
>>> Copying sources ...
>>> Completed installing gentoo-sources-5.1.1 into /var/tmp/portage/sys-kernel/gentoo-sources-5.1.1/image/

 * Final size of build directory:      4 KiB
 * Final size of installed tree:  965256 KiB (942.6 MiB)

Checked on https://dev.gentoo.org/~mpagano/genpatches/patches-5.1-1.html and the 5.1.1 expermental.tar.xz patch still isn't on the server. :(
Maybe soon. If not, in a day or two I'll try patching 5.1.1 with the last 5011 gen-opts patch, which does apply cleanly to 5.1.0, and apparently works normally.
_________________
Main box- AsRock x370 Gaming K4
Ryzen 7 3700x, 3.6GHz, 16GB GSkill Flare DDR4 3200mhz
Samsung SATA 1000GB, Radeon HD R7 350 2GB DDR5
Gentoo ~amd64 plasma, glibc-2.36.1, gcc-10.3.0, kernel-5.11.15 USE=experimental
Back to top
View user's profile Send private message
Anon-E-moose
Watchman
Watchman


Joined: 23 May 2008
Posts: 5225
Location: Dallas area

PostPosted: Sun May 12, 2019 5:08 pm    Post subject: Reply with quote

5010/5011 (the last ones provided) should patch against newer kernels, with perhaps some fuzz factor involved.

They just basically add optimizations (for other cpus) against a few files.

I've been using zen kernels for years now (even after gentoo quit messing with them) and I think they just use their mods.
_________________
PRIME x570-pro, 3700x, RX 550 - 5.8 zen kernel
Acer E5-575 (laptop), i3-7100u - i965 - 5.5 zen kernel
---both---
gcc 9.3.0, profile 17.1 (no-pie) amd64-no-multilib, eudev, openrc, openbox

The New OTW
Back to top
View user's profile Send private message
wrc1944
Advocate
Advocate


Joined: 15 Aug 2002
Posts: 3378
Location: Gainesville, Florida

PostPosted: Sun May 12, 2019 7:15 pm    Post subject: Reply with quote

Hmmm... IIRC, those "zen" kernels of past years were a custom so-called "performance" kernel just using zen as a fancy name, and has nothing to do with the gcc kernel option "zen, zen1" which is short for the AMD Ryzen family of processors. At least that was my understanding- could be wrong. :roll:

On the other hand, did the old zen patch set evolve into the zen-sources package now found in portage, and did it actually new adopt code for the current Ryzen family of cpus?
_________________
Main box- AsRock x370 Gaming K4
Ryzen 7 3700x, 3.6GHz, 16GB GSkill Flare DDR4 3200mhz
Samsung SATA 1000GB, Radeon HD R7 350 2GB DDR5
Gentoo ~amd64 plasma, glibc-2.36.1, gcc-10.3.0, kernel-5.11.15 USE=experimental
Back to top
View user's profile Send private message
Anon-E-moose
Watchman
Watchman


Joined: 23 May 2008
Posts: 5225
Location: Dallas area

PostPosted: Sun May 12, 2019 7:22 pm    Post subject: Reply with quote

The zen kernels allow lots of performance tuning, but one of the things they've done for a long time, is allow cpu optimization of the code, up to and including the zen processors, coffee lake processors, etc. My guess is that gentoo sources borrows the code for the cpu optimizations. It's not that much in the scheme of things.

Code:
+config MZEN
+   bool "AMD Zen"
+   ---help---
+     Select this for AMD Family 17h Zen processors.
+
+     Enables -march=znver1
...
+        cflags-$(CONFIG_MZEN) += $(call cc-option,-march=znver1)


The cpu opts just basically pass on march and sometime mtune flags.

anyway, my original point was that the ones from 4.19/4.20/5.0 should work on 5.1 (with possibly fuzz)
_________________
PRIME x570-pro, 3700x, RX 550 - 5.8 zen kernel
Acer E5-575 (laptop), i3-7100u - i965 - 5.5 zen kernel
---both---
gcc 9.3.0, profile 17.1 (no-pie) amd64-no-multilib, eudev, openrc, openbox

The New OTW
Back to top
View user's profile Send private message
wrc1944
Advocate
Advocate


Joined: 15 Aug 2002
Posts: 3378
Location: Gainesville, Florida

PostPosted: Sun May 12, 2019 8:30 pm    Post subject: Reply with quote

Thanks much Anon-E-moose,
Interesting info. Wasn't aware that gentoo-sources might be borrowing the code for the cpu optimizations. I have used the 5011 patch on gentoo-sources-5.1.0 with success- applied cleanly.

Are the zen-sources in portage expected to move to more current kernels? Latest ebuilds are from April 2018.
_________________
Main box- AsRock x370 Gaming K4
Ryzen 7 3700x, 3.6GHz, 16GB GSkill Flare DDR4 3200mhz
Samsung SATA 1000GB, Radeon HD R7 350 2GB DDR5
Gentoo ~amd64 plasma, glibc-2.36.1, gcc-10.3.0, kernel-5.11.15 USE=experimental
Back to top
View user's profile Send private message
Anon-E-moose
Watchman
Watchman


Joined: 23 May 2008
Posts: 5225
Location: Dallas area

PostPosted: Sun May 12, 2019 8:48 pm    Post subject: Reply with quote

I doubt that gentoo is going to keep up with zen kernel.

I just use the website keep a git copy on my system https://github.com/zen-kernel/zen-kernel

Note: with zen kernel, they do keep up with the latest (stable) kernels, up to a certain point.
They basically just make sure that the different parts they add are up to date in whatever kernel version they have.
But they don't follow the kernels completely, right now it's 4.19 - 5.1, which is why I keep git up to date, I can pull old kernels (if I had too).

Edit to add: I don't use the ebuilds anyway. I do it the old fashioned way, go to the src directory and do make bzImage modules modules_install install, or some part of the make depending on what I'm doing. I add an entry for a kernel source to packages.provided to satisfy portage and it's all good.
_________________
PRIME x570-pro, 3700x, RX 550 - 5.8 zen kernel
Acer E5-575 (laptop), i3-7100u - i965 - 5.5 zen kernel
---both---
gcc 9.3.0, profile 17.1 (no-pie) amd64-no-multilib, eudev, openrc, openbox

The New OTW
Back to top
View user's profile Send private message
wrc1944
Advocate
Advocate


Joined: 15 Aug 2002
Posts: 3378
Location: Gainesville, Florida

PostPosted: Sun May 12, 2019 11:57 pm    Post subject: Reply with quote

Patched 5.1.1 with the 5011 patch- applied cleanly:
Code:
amd64 ~ # cd /usr/src/linux-5.1.1-gentoo
amd64 /usr/src/linux-5.1.1-gentoo # patch -p1 < 5011_enable-cpu-optimizations-for-gcc8.patch
patching file arch/x86/Makefile_32.cpu
patching file arch/x86/Kconfig.cpu
patching file arch/x86/Makefile
patching file arch/x86/include/asm/module.h


gcc-opts were then in my make xconfig window listings.
One oddity, not in the patch or kernel compile, but in make xconfig. The Kernel compiled normally.

After you load your config file into your kernel source from the main window (I have all mine in /usr/src and get there in a drop-down menu dialog box), make edits and/add/remove settings as needed, you then select save (or save as) in the main make xconfig window and for years it has auto saved the new .config file directly to your new kernel source directory, correctly.

Now, since 5.1.0, it doesn't do that, and now forces you to rename the file to .config and select the proper location in a multi-level directory search. This use to be automatic, but now it's very inconvenient, and defeating the main purpose of make xconfig. :roll:

Is it now this way on purpose, or possibly a qt/kde version change that broke the previous behavior of make xconfig? Sorry if this last point is off topic- will edit out and open a different thread if needed.
_________________
Main box- AsRock x370 Gaming K4
Ryzen 7 3700x, 3.6GHz, 16GB GSkill Flare DDR4 3200mhz
Samsung SATA 1000GB, Radeon HD R7 350 2GB DDR5
Gentoo ~amd64 plasma, glibc-2.36.1, gcc-10.3.0, kernel-5.11.15 USE=experimental
Back to top
View user's profile Send private message
wrc1944
Advocate
Advocate


Joined: 15 Aug 2002
Posts: 3378
Location: Gainesville, Florida

PostPosted: Fri May 17, 2019 11:56 pm    Post subject: Reply with quote

The gcc-opts patch (5011) is now back in gentoo-sources 5.1.3. :D

Thanks very much to mpagano!
_________________
Main box- AsRock x370 Gaming K4
Ryzen 7 3700x, 3.6GHz, 16GB GSkill Flare DDR4 3200mhz
Samsung SATA 1000GB, Radeon HD R7 350 2GB DDR5
Gentoo ~amd64 plasma, glibc-2.36.1, gcc-10.3.0, kernel-5.11.15 USE=experimental
Back to top
View user's profile Send private message
Goverp
Veteran
Veteran


Joined: 07 Mar 2007
Posts: 1066

PostPosted: Sat May 18, 2019 10:04 am    Post subject: Reply with quote

Out of interest, anyone know if the old KCFLAGS="-march=native" technique would have worked?
_________________
Greybeard
Back to top
View user's profile Send private message
wrc1944
Advocate
Advocate


Joined: 15 Aug 2002
Posts: 3378
Location: Gainesville, Florida

PostPosted: Sat May 18, 2019 1:34 pm    Post subject: Reply with quote

I think you're talking about what's discussed here. https://stackoverflow.com/questions/40442218/how-to-pass-compiler-options-during-linux-kernel-compilation

Back just after kernel 3.0.0 was released (or even before that) I tried the makefile edits and/or a few other files on my amd k6 systems, looking for any performance improvement possible.

Running Gentoo back then was a really good way to develop extreme patience. As I recall, kernel source editing was kind of tricky, and results weren't exactly reliable.

As hardware improved, and I learned more I decided it wasn't worth the time and effort as with each kernel version you never felt confident what worked before would
continue to be effective. Sometimes it worked, or at least I thought it did. In those days, what we have now would have seemed like science fiction or even unimaginable.
_________________
Main box- AsRock x370 Gaming K4
Ryzen 7 3700x, 3.6GHz, 16GB GSkill Flare DDR4 3200mhz
Samsung SATA 1000GB, Radeon HD R7 350 2GB DDR5
Gentoo ~amd64 plasma, glibc-2.36.1, gcc-10.3.0, kernel-5.11.15 USE=experimental
Back to top
View user's profile Send private message
Goverp
Veteran
Veteran


Joined: 07 Mar 2007
Posts: 1066

PostPosted: Sat May 18, 2019 7:39 pm    Post subject: Reply with quote

That's right, but AFAIR a few years ago they "fixed" the kernel build so it no longer worked - possibly ordering the parameters so that the kernel setting overrode the KCFLAG settings.
_________________
Greybeard
Back to top
View user's profile Send private message
Goverp
Veteran
Veteran


Joined: 07 Mar 2007
Posts: 1066

PostPosted: Sun May 19, 2019 12:29 pm    Post subject: Reply with quote

I did a test: reinstall gentoo-sources without the experimental patches, change the kernel configuration to specify Opteron/Athlon64/Hammer/K8 processor type (right for me), then
Code:
export KCLAGS='-march=native'
make
make install
extract the kernel, disassemble the results, and compare the output with the same for a kernel compiled with the experimental patches and Native processor type.

The results were identical apart from timestamp. so setting KCFLAGS still works.

This also answered a niggling question, that whether configuring processor type for Opteron actually changed what was compiled (i.e.conditional source code) rather than how it was compiled (i.e. gcc parameters).
The answer appears to be No.
_________________
Greybeard
Back to top
View user's profile Send private message
Anon-E-moose
Watchman
Watchman


Joined: 23 May 2008
Posts: 5225
Location: Dallas area

PostPosted: Sun May 19, 2019 12:40 pm    Post subject: Reply with quote

Code:
# Add any arch overrides and user supplied CPPFLAGS, AFLAGS and CFLAGS as the
# last assignments
KBUILD_CPPFLAGS += $(ARCH_CPPFLAGS) $(KCPPFLAGS)
KBUILD_AFLAGS   += $(ARCH_AFLAGS)   $(KAFLAGS)
KBUILD_CFLAGS   += $(ARCH_CFLAGS)   $(KCFLAGS)

_________________
PRIME x570-pro, 3700x, RX 550 - 5.8 zen kernel
Acer E5-575 (laptop), i3-7100u - i965 - 5.5 zen kernel
---both---
gcc 9.3.0, profile 17.1 (no-pie) amd64-no-multilib, eudev, openrc, openbox

The New OTW
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Goto page Previous  1, 2
Page 2 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum