• [gentoo-dev] [PATCH 1/8] kernel-2.eclass: decompress xz in parallel

    From Sam James@21:1/5 to All on Wed Oct 12 01:00:02 2022
    No-op until >=app-arch/xz-utils-5.3.3_alpha. Recently added support
    for this in Portage and pkgcore too for unpacking.

    Signed-off-by: Sam James <sam@gentoo.org>
    ---
    eclass/kernel-2.eclass | 4 ++--
    1 file changed, 2 insertions(+), 2 deletions(-)

    diff --git a/eclass/kernel-2.eclass b/eclass/kernel-2.eclass
    index 50464470a9bb..c18ef21099d1 100644
    --- a/eclass/kernel-2.eclass
    +++ b/eclass/kernel-2.eclass
    @@ -281,7 +281,7 @@
    # If you do change them, there is a chance that we will not fix resulting bugs;
    # that of course does not mean we're not willing to help.

    -inherit estack toolchain-funcs
    +inherit estack multiprocessing toolchain-funcs

    case ${EAPI} in
    7|8) ;;
    @@ -1065,7 +1065,7 @@ unipatch() {
    extention=${extention/:*/}
    PIPE_CMD=""
    case ${extention} in
    - xz) PIPE_CMD="xz -dc";;
    + xz) PIPE_CMD="xz -T$(makeopts_jobs) -dc";;
    lzma) PIPE_CMD="lzma -dc";;
    bz2) PIPE_CMD="bzip2 -dc";;
    patch*) PIPE_CMD="cat";;
    --
    2.38.0

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Sam James@21:1/5 to All on Wed Oct 12 01:00:02 2022
    Signed-off-by: Sam James <sam@gentoo.org>
    ---
    eclass/linux-mod.eclass | 8 ++++----
    1 file changed, 4 insertions(+), 4 deletions(-)

    diff --git a/eclass/linux-mod.eclass b/eclass/linux-mod.eclass
    index b7c13cbf7e76..8f511ba8ff05 100644
    --- a/eclass/linux-mod.eclass
    +++ b/eclass/linux-mod.eclass
    @@ -163,7 +163,7 @@ _LINUX_MOD_ECLASS=1

    # TODO: When adding support for future EAPIs, please audit this list
    # for unused inherits and conditionalise them.
    -inherit linux-info multilib toolchain-funcs
    +inherit linux-info multilib multiprocessing toolchain-funcs

    case ${MODULES_OPTIONAL_USE_IUSE_DEFAULT:-n} in
    [nNfF]*|[oO][fF]*|0|-) _modules_optional_use_iuse_default='' ;;
    @@ -712,17 +712,17 @@ linux-mod_src_install() {
    cd "${objdir}" || die "${objdir} does not exist"
    insinto "${INSTALL_MOD_PATH}"/lib/modules/${KV_FULL}/${libdir}

    - # check here for CONFIG_MODULE_COMPRESS_<compression option> (NONE, GZIP, XZ, ZSTD)
    + # check here for CONFIG_MODULE_COMPRESS_<compression option> (NONE, GZIP, XZ, ZSTD)
    # and similarily com
  • From Sam James@21:1/5 to All on Wed Oct 12 01:00:02 2022
    Note that this will only take effect if compressing modules with gzip (COMPRESS_MODULE_GZIP is set) or compressing the kernel with gzip (CONFIG_KERNEL_GZIP is set).

    Signed-off-by: Sam James <sam@gentoo.org>
    ---
    eclass/kernel-build.eclass | 7 +++++++
    1 file changed, 7 insertions(+)

    diff --git a/eclass/kernel-build.eclass b/eclass/kernel-build.eclass
    index 936258e9e8af..faf36d763d08 100644
    --- a/eclass/kernel-build.eclass
    +++ b/eclass/kernel-build.eclass
    @@ -98,6 +98,13 @@ kernel-build_src_configure() {
    export ZSTD_NBTHREADS="$(makeopts_jobs)"
    fi

    + # pigz needs to take an argument, not an env var,
    + # for its options, which won't work because of how the kernel build system
    + # uses the variables (e.g. passes directly to tar as an executable).
    + if type -P pigz ; then
    + MAKEARGS+=( KGZIP="pigz" )
    + fi
    +
    restore_config .config
    [[ -f .config ]] || die "Ebuild error: please copy default config into .config"

    --
    2.38.0

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Sam James@21:1/5 to All on Wed Oct 12 01:00:02 2022
    Note that this will only take effect if compressing
    modules with bzip2 (COMPRESS_MODULE_BZIP2 is set) or
    compressing the kernel with bzip2 (CONFIG_KERNEL_BZIP2 is set).

    Signed-off-by: Sam James <sam@gentoo.org>
    ---
    eclass/kernel-build.eclass | 10 ++++++++--
    1 file changed, 8 insertions(+), 2 deletions(-)

    diff --git a/eclass/kernel-build.eclass b/eclass/kernel-build.eclass
    index faf36d763d08..cc99298811bc 100644
    --- a/eclass/kernel-build.eclass
    +++ b/eclass/kernel-build.eclass
    @@ -98,13 +98,19 @@ kernel-build_src_configure() {
    export ZSTD_NBTHREADS="$(makeopts_jobs)"
    fi

    - # pigz needs to take an argument, not an env var,
    - # for its options, which won't work because of how the kernel build system
    + # pigz/pbzip2/lbzip2 all need to take an argument, not an env var,
    + # for their options, which won't work because of how the kernel build system
    # uses the variables (e.g. passes directly to tar as an executable).
    if type -P pigz ; then
    MAKEARGS+=( KGZIP="pigz" )
    fi

    + if type -P pbzip2 ; then
    + MAKEARGS+=( KBZIP2="pbzip2" )
    + elif type -P lbzip2 ; then
    + MAKEARGS+=( KBZIP2="lbzip2" )
    + fi
    +
    restore_config .config
    [[ -f .config ]] || die "Ebuild error: please copy defaul
  • From Sam James@21:1/5 to All on Wed Oct 12 02:30:01 2022
    On 11 Oct 2022, at 23:55, Sam James <sam@gentoo.org> wrote:

    Note that this will only take effect if compressing
    modules with bzip2 (COMPRESS_MODULE_BZIP2 is set) or
    compressing the kernel with bzip2 (CONFIG_KERNEL_BZIP2 is set).

    Signed-off-by: Sam James <sam@gentoo.org>
    ---
    eclass/kernel-build.eclass | 10 ++++++++--
    1 file changed, 8 insertions(+), 2 deletions(-)

    diff --git a/eclass/kernel-build.eclass b/eclass/kernel-build.eclass
    index faf36d763d08..cc99298811bc 100644
    --- a/eclass/kernel-build.eclass
    +++ b/eclass/kernel-build.eclass
    @@ -98,13 +98,19 @@ kernel-build_src_configure() {
    export ZSTD_NBTHREADS="$(makeopts_jobs)"
    fi

    - # pigz needs to take an argument, not an env var,
    - # for its options, which won't work because of how the kernel build system
    + # pigz/pbzip2/lbzip2 all need to take an argument, not an env var,
    + # for their options, which won't work because of how the kernel build system
    # uses the variables (e.g. passes directly to tar as an executable).
    if type -P pigz ; then
    MAKEARGS+=( KGZIP="pigz" )
    fi

    + if type -P pbzip2 ; then

    Oh, all of these need a redirection to silence them, which I'll fix locally.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Ulrich Mueller@21:1/5 to All on Wed Oct 12 10:30:01 2022
    What is the motivation for this? The typical kernel module on my system
    has a size of about 20 KiB uncompressed, with the largest about 2 MiB. Compression times are negligible for these, so is there a need to
    optimize?

    Ulrich

    -----BEGIN PGP SIGNATURE-----

    iQFDBAEBCAAtFiEEtDnZ1O9xIP68rzDbUYgzUIhBXi4FAmNGemYPHHVsbUBnZW50 b28ub3JnAAoJEFGIM1CIQV4usaMIAI0aBAhFHl2s03r3GriLh5UsW+7wzED9BcB1 B1TReYvziagY9JNjsOVZGYFDHabGImYNzelb2Z6dMVe3Qyo4CNlEWpFWmIIhy2Qe nvhHv+3tjXoS9Ox/gur5EuD9gyW15yodHUG6mLPcE9qB8f4/iZ0DfXdoctLGLKvr Ol+4yIfqoa7BQzTmPxbi+44Lb3lrygDmpexIPuIjskE/tLSQqvubM/oCaUAoEBgI GBatb5s4IUfQ21nefygARJa/QYxs2skHxMRQ0fA+27P5n1u6MCsYcwQOuM6g3VDF YVoHg1XDVxsWt0a4ftMPKVtgP22nMXnzhg0tk+Nmf8d0Gxvwe5k=
    =Lr53
    -----END PGP SIGNATURE-----

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Sam James@21:1/5 to Ulrich Mueller on Wed Oct 12 18:50:01 2022
    Ulrich Mueller <ulm@gentoo.org> writes:

    [[PGP Signed Part:Undecided]]
    What is the motivation for this? The typical kernel module on my system
    has a size of about 20 KiB uncompressed, with the largest about 2 MiB. Compression times are negligible for these, so is there a need to
    optimize?

    Note that this is only for external kernel modules. The motivation
    for these is mostly for slower systems with many cores, but
    slower per-core speeds (I have a bunch of ARM64 devices
    like that).


    Ulrich

    [[End of PGP Signed Part]]

    thanks,
    sam

    -----BEGIN PGP SIGNATURE-----

    iOUEARYKAI0WIQQlpruI3Zt2TGtVQcJzhAn1IN+RkAUCY0bumF8UgAAAAAAuAChp c3N1ZXItZnByQG5vdGF0aW9ucy5vcGVucGdwLmZpZnRoaG9yc2VtYW4ubmV0MjVB NkJCODhERDlCNzY0QzZCNTU0MUMyNzM4NDA5RjUyMERGOTE5MA8cc2FtQGdlbnRv by5vcmcACgkQc4QJ9SDfkZAR+wD/fO/srHCS1hKsmK5GNa19tcpe0YSwSqRIosTI xP4VK/ABAMkPtGn57m6In0naWciyktWC8S0/eI9+Smq9w7sHqT4K
    =MrYL
    -----END PGP SIGNATURE-----

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)