Re: [4.9-rc1] Build-time 2x slower

From: Linus Torvalds
Date: Mon Oct 17 2016 - 12:46:15 EST


On Mon, Oct 17, 2016 at 9:04 AM, Sedat Dilek <sedat.dilek@xxxxxxxxx> wrote:
>
> not sure whom to address on this issue.
>
> I have built Linux v4.9-rc1, v4.8.2 and v4.4.25 kernels (in this
> order) this morning.
>
> Building a Linux v4.8.2 under Linux v4.9-rc1 took two times longer.
>
> As usually I build with 2 parallel-make-jobs.
> This takes approx. 30mins.
> Under Linux v4.9-rc1 it took approx. an hour.

Hmm. Would you mind just bisecting it? I've not noticed the same thing
on my setup, but to be honest I generally don't time things very
closely because the variation for me tends to be much more along the
lines of "damn, that pull request touched <linux./fs.h> now it's
rebuilding everything" vs "40 seconds to build just the driver that
changed". Most of my builds are the "allmodconfig" builds I do in
between pulls..

You can even automate it, since it's going to take some time, using
"git bisect run" and writing a small script that looks at how long it
takes to build the kernel from scratch each time. I'd suggest trying
to write the script using a smaller repository (maybe git itself). The
script would just needs to do a clean rebuild, time it, and have
return success or error based on how long it took.

The script *might* look something like

#!/bin/sh
git clean -dqfx
make oldconfig
time -o time-file -f '%e' sh -c "make -j8 > ../output"
# remove fractional seconds
time=$(cat time-file | sed 's/\..*//')
# less than 35 minutes is good?
[ $time -lt $((35*60)) ]

but I didn't really test that very much. Anyway, you *should* be able
to do something like

git bisect good v4.8
git bisect bad v4.9-rc1
git bisect run ../timing-script

(put the "timing-script" somewhere _else_ than the kernel sources so
that the "git clean" doesn't remove it - that's what my first silly
test did ;)

You may have to tweak that script a bit, but I think you get the idea..

Linus