2012-03-30 11:10:18

by Johannes Berg

[permalink] [raw]
Subject: [PATCH 0/2] compat: fix extreme build slowdowns

Somehow exporting too many variables completely confuses the kernel's
Makefiles into trying to calculate the size of every file in a very slow
shell script ... this is causing EXTREME build slowdowns for me.

These two patches fix it.

johannes



2012-03-30 20:31:10

by Luis R. Rodriguez

[permalink] [raw]
Subject: Re: [PATCH 2/2] compat: explicitly export generated variables

On Fri, Mar 30, 2012 at 4:11 AM, Johannes Berg
<[email protected]> wrote:
> From: Johannes Berg <[email protected]>
>
> Doing the blanket "export" statement at the beginning
> of the generated file confuses the kernel's Makefiles
> and causes extreme build slowdowns.
>
> Signed-off-by: Johannes Berg <[email protected]>
> ---

Nice, how did you figure this out BTW!?

Luis

2012-03-30 20:38:26

by Luis R. Rodriguez

[permalink] [raw]
Subject: Re: [PATCH 2/2] compat: explicitly export generated variables

On Fri, Mar 30, 2012 at 1:34 PM, Johannes Berg
<[email protected]> wrote:
> On Fri, 2012-03-30 at 13:30 -0700, Luis R. Rodriguez wrote:
>> On Fri, Mar 30, 2012 at 4:11 AM, Johannes Berg
>> <[email protected]> wrote:
>> > From: Johannes Berg <[email protected]>
>> >
>> > Doing the blanket "export" statement at the beginning
>> > of the generated file confuses the kernel's Makefiles
>> > and causes extreme build slowdowns.
>> >
>> > Signed-off-by: Johannes Berg <[email protected]>
>> > ---
>>
>> Nice, how did you figure this out BTW!?
>
> Random monkey approach ;-)
>
> I noticed it was slow and saw that it was due to some weird shit from
> the kernel Makefile.lib being executed when it shouldn't be.
>
> Since I have the compat *result* in git, I could easily see the diff
> between the old compat.git/compat-wireless.git and the new versions. And
> then I basically tried to identify the changes that caused this problem,
> my best guess was that it had to be the Makefile so I gradually changed
> that back to the previous version until the problem went away ... and
> then identified which changes were responsible.

Wow, nice find.. so we should be able to make compat-wireless builds
just as fast too there. There config.mk does the same wide export
hackery. Looks like the 3.4 stable releases will have huge
improvements, now to just address 2.6.31 and below for
compat-wireless:

Trying kernel 2.6.31-02063113-generic [FAILED]
Trying kernel 2.6.30-02063010-generic [FAILED]
Trying kernel 2.6.29-02062906-generic [FAILED]
Trying kernel 2.6.28-02062810-generic [FAILED]
Trying kernel 2.6.27-020627-generic [FAILED]
Trying kernel 2.6.26-020626-generic [FAILED]
Trying kernel 2.6.25-020625-generic [FAILED]
Trying kernel 2.6.24-020624-generic [FAILED]

PS. Please Cc: [email protected] on future patches.

Luis

2012-03-30 11:11:05

by Johannes Berg

[permalink] [raw]
Subject: [PATCH 1/2] compat-wireless: include config.mk early

From: Johannes Berg <[email protected]>

Not doing so can cause extreme build slowdowns,
somehow that confuses the kernel's Makefiles into
calculating the size of every single file all the
time (the calculation code is part of compressing
the kernel with bzip2 etc. so that's very strange.)

Signed-off-by: Johannes Berg <[email protected]>
---
Makefile | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/Makefile b/Makefile
index 67f8e84..bbd77f7 100644
--- a/Makefile
+++ b/Makefile
@@ -12,7 +12,6 @@ DESTDIR?=

ifneq ($(KERNELRELEASE),)

-include $(COMPAT_CONFIG_CW)
include $(COMPAT_CONFIG)

NOSTDINC_FLAGS := -I$(M)/include/ \
@@ -68,6 +67,8 @@ export COMPAT_AUTOCONF=include/linux/compat_autoconf.h
export CREL_PRE:=.compat_autoconf_
export CREL_CHECK:=$(PWD)/$(CREL_PRE)$(CREL)

+include $(COMPAT_CONFIG_CW)
+
all: modules

$(COMPAT_CONFIG): ;
--
1.7.9.1




2012-03-30 14:40:51

by Sid Hayn

[permalink] [raw]
Subject: Re: [PATCH 0/2] compat: fix extreme build slowdowns

On 03/30/12 07:30, Johannes Berg wrote:
> On Fri, 2012-03-30 at 16:56 +0530, Sujith Manoharan wrote:
>> Johannes Berg wrote:
>>> Somehow exporting too many variables completely confuses the kernel's
>>> Makefiles into trying to calculate the size of every file in a very slow
>>> shell script ... this is causing EXTREME build slowdowns for me.
>>>
>>> These two patches fix it.
>> Nice.
>>
>> Trying to build ath9k..
>>
>> Before:
>>
>> real 1m18.689s
>> user 3m1.382s
>> sys 0m6.833s
>>
>> After:
>>
>> real 0m42.091s
>> user 1m30.024s
>> sys 0m5.700s
Please put this in stable as well, seems like a good thing ;-)

Thanks,
Rick
> Yeah, I also see about 50% build time now with everything in cache, if
> the files it's sizing up aren't in cache then it can be much slower with
> the old version.
>
> johannes
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
> the body of a message to [email protected]
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>


2012-03-30 11:27:35

by Sujith Manoharan

[permalink] [raw]
Subject: [PATCH 0/2] compat: fix extreme build slowdowns

Johannes Berg wrote:
> Somehow exporting too many variables completely confuses the kernel's
> Makefiles into trying to calculate the size of every file in a very slow
> shell script ... this is causing EXTREME build slowdowns for me.
>
> These two patches fix it.

Nice.

Trying to build ath9k..

Before:

real 1m18.689s
user 3m1.382s
sys 0m6.833s

After:

real 0m42.091s
user 1m30.024s
sys 0m5.700s

Sujith

2012-03-30 21:24:51

by Luis Chamberlain

[permalink] [raw]
Subject: Re: [PATCH 0/2] compat: fix extreme build slowdowns

On Fri, Mar 30, 2012 at 01:43:20PM -0700, Luis R. Rodriguez wrote:
> On Fri, Mar 30, 2012 at 7:41 AM, Richard Farina <[email protected]> wrote:
> > On 03/30/12 07:30, Johannes Berg wrote:
> >> On Fri, 2012-03-30 at 16:56 +0530, Sujith Manoharan wrote:
> >>> Johannes Berg wrote:
> >>>> Somehow exporting too many variables completely confuses the kernel's
> >>>> Makefiles into trying to calculate the size of every file in a very slow
> >>>> shell script ... this is causing EXTREME build slowdowns for me.
> >>>>
> >>>> These two patches fix it.
> >>> Nice.
> >>>
> >>> Trying to build ath9k..
> >>>
> >>> Before:
> >>>
> >>> real ? ?1m18.689s
> >>> user ? ?3m1.382s
> >>> sys ? ? 0m6.833s
> >>>
> >>> After:
> >>>
> >>> real ? ?0m42.091s
> >>> user ? ?1m30.024s
> >>> sys ? ? 0m5.700s
> > Please put this in stable as well, seems like a good thing ;-)
>
> Johannes, kick ass patches, thanks!!! Richard, I will propagate to
> stable, but first gotta figure why the patch, "compat: explicitly
> export generated variables" broke builds for older kernels:
>
> mcgrof@tux ~/compat (git::master)$ ckmake
> Trying kernel 3.3.0-030300rc2-generic [OK]
> Trying kernel 3.2.2-030202-generic [OK]
> Trying kernel 3.1.10-030110-generic [OK]
> Trying kernel 3.0.18-030018-generic [OK]
> Trying kernel 2.6.39-02063904-generic [OK]
> Trying kernel 2.6.38-13-generic [OK]
> Trying kernel 2.6.38-02063808-generic [OK]
> Trying kernel 2.6.37-02063706-generic [OK]
> Trying kernel 2.6.36-02063604-generic [OK]
> Trying kernel 2.6.35-02063512-generic [OK]
> Trying kernel 2.6.34-02063410-generic [OK]
> Trying kernel 2.6.33-02063305-generic [OK]
> Trying kernel 2.6.32-02063255-generic [FAILED]
> Trying kernel 2.6.31-22-generic [FAILED]
> Trying kernel 2.6.31-02063113-generic [FAILED]
> Trying kernel 2.6.30-02063010-generic [FAILED]
> Trying kernel 2.6.29-02062906-generic [FAILED]
> Trying kernel 2.6.28-02062810-generic [FAILED]
> Trying kernel 2.6.27-020627-generic [FAILED]
> Trying kernel 2.6.26-020626-generic [FAILED]
> Trying kernel 2.6.25-020625-generic [FAILED]
> Trying kernel 2.6.24-020624-generic [FAILED]

Applying this patch prior to yours fixes it:

diff --git a/compat/compat_firmware_class.c b/compat/compat_firmware_class.c
index 01eda40..69b442b 100644
--- a/compat/compat_firmware_class.c
+++ b/compat/compat_firmware_class.c
@@ -635,7 +635,7 @@ out:
* firmware image for this or any other device.
**/
int
-request_firmware(const struct firmware **firmware_p, const char *name,
+compat_request_firmware(const struct firmware **firmware_p, const char *name,
struct device *device)
{
int uevent = 1;
@@ -646,7 +646,7 @@ request_firmware(const struct firmware **firmware_p, const char *name,
* release_firmware: - release the resource associated with a firmware image
* @fw: firmware resource to release
**/
-void release_firmware(const struct firmware *fw)
+void compat_release_firmware(const struct firmware *fw)
{
if (fw) {
if (!fw_is_builtin_firmware(fw))
@@ -705,7 +705,7 @@ static int request_firmware_work_func(void *arg)
* in atomic contexts.
**/
int
-request_firmware_nowait(
+compat_request_firmware_nowait(
struct module *module, int uevent,
const char *name, struct device *device, gfp_t gfp, void *context,
void (*cont)(const struct firmware *fw, void *context))
diff --git a/include/linux/compat-2.6.33.h b/include/linux/compat-2.6.33.h
index c900a6f..a11d80f 100644
--- a/include/linux/compat-2.6.33.h
+++ b/include/linux/compat-2.6.33.h
@@ -37,7 +37,7 @@ static inline int compat_request_firmware(const struct firmware **fw,
{
return -EINVAL;
}
-static inline int request_firmware_nowait(
+static inline int compat_request_firmware_nowait(
struct module *module, int uevent,
const char *name, struct device *device, gfp_t gfp, void *context,
void (*cont)(const struct firmware *fw, void *context))

2012-03-30 11:11:46

by Johannes Berg

[permalink] [raw]
Subject: [PATCH 2/2] compat: explicitly export generated variables

From: Johannes Berg <[email protected]>

Doing the blanket "export" statement at the beginning
of the generated file confuses the kernel's Makefiles
and causes extreme build slowdowns.

Signed-off-by: Johannes Berg <[email protected]>
---
scripts/gen-compat-config.sh | 17 +++++++++--------
1 files changed, 9 insertions(+), 8 deletions(-)

diff --git a/scripts/gen-compat-config.sh b/scripts/gen-compat-config.sh
index 5d6e34c..6cdac12 100755
--- a/scripts/gen-compat-config.sh
+++ b/scripts/gen-compat-config.sh
@@ -20,9 +20,10 @@ KERNEL_VERSION=$(${MAKE} -C ${KLIB_BUILD} kernelversion | sed -n 's/^\([0-9]\)\.
COMPAT_LATEST_VERSION="3"
KERNEL_SUBLEVEL="-1"

-# This allows all these variables to be propagated through
-# all of our Makefiles
-echo export
+# Note that this script will export all variables explicitly,
+# trying to export all with a blanket "export" statement at
+# the top of the generated file causes the build to slow down
+# by an order of magnitude.

if [[ ${KERNEL_VERSION} -eq "3" ]]; then
KERNEL_SUBLEVEL=$(${MAKE} -C ${KLIB_BUILD} kernelversion | sed -n 's/^3\.\([0-9]\+\).*/\1/p')
@@ -33,14 +34,14 @@ else

for i in $(seq ${KERNEL_26SUBLEVEL} ${COMPAT_26LATEST_VERSION}); do
eval CONFIG_COMPAT_KERNEL_2_6_${i}=y
- echo "CONFIG_COMPAT_KERNEL_2_6_${i}=y"
+ echo "export CONFIG_COMPAT_KERNEL_2_6_${i}=y"
done
fi

let KERNEL_SUBLEVEL=${KERNEL_SUBLEVEL}+1
for i in $(seq ${KERNEL_SUBLEVEL} ${COMPAT_LATEST_VERSION}); do
eval CONFIG_COMPAT_KERNEL_3_${i}=y
- echo "CONFIG_COMPAT_KERNEL_3_${i}=y"
+ echo "export CONFIG_COMPAT_KERNEL_3_${i}=y"
done

# The purpose of these seem to be the inverse of the above other varibales.
@@ -50,14 +51,14 @@ if [[ ! -z ${RHEL_MAJOR} ]]; then
RHEL_MINOR=$(grep ^RHEL_MINOR $(KLIB_BUILD)/Makefile | sed -n 's/.*= *\(.*\)/\1/p')
for i in $(seq 0 ${RHEL_MINOR}); do
eval CONFIG_COMPAT_${RHEL_MAJOR}_${i}=y
- echo "CONFIG_COMPAT_${RHEL_MAJOR}_${i}=y"
+ echo "export CONFIG_COMPAT_${RHEL_MAJOR}_${i}=y"
done
fi

if [[ ${CONFIG_COMPAT_KERNEL_2_6_33} = "y" ]]; then
- echo "CONFIG_COMPAT_FIRMWARE_CLASS=m"
+ echo "export CONFIG_COMPAT_FIRMWARE_CLASS=m"
fi

if [[ ${CONFIG_COMPAT_KERNEL_2_6_36} = "y" ]]; then
- echo "CONFIG_COMPAT_KFIFO=y"
+ echo "export CONFIG_COMPAT_KFIFO=y"
fi
--
1.7.9.1




2012-03-30 11:30:28

by Johannes Berg

[permalink] [raw]
Subject: Re: [PATCH 0/2] compat: fix extreme build slowdowns

On Fri, 2012-03-30 at 16:56 +0530, Sujith Manoharan wrote:
> Johannes Berg wrote:
> > Somehow exporting too many variables completely confuses the kernel's
> > Makefiles into trying to calculate the size of every file in a very slow
> > shell script ... this is causing EXTREME build slowdowns for me.
> >
> > These two patches fix it.
>
> Nice.
>
> Trying to build ath9k..
>
> Before:
>
> real 1m18.689s
> user 3m1.382s
> sys 0m6.833s
>
> After:
>
> real 0m42.091s
> user 1m30.024s
> sys 0m5.700s

Yeah, I also see about 50% build time now with everything in cache, if
the files it's sizing up aren't in cache then it can be much slower with
the old version.

johannes


2012-03-30 20:43:41

by Luis R. Rodriguez

[permalink] [raw]
Subject: Re: [PATCH 0/2] compat: fix extreme build slowdowns

On Fri, Mar 30, 2012 at 7:41 AM, Richard Farina <[email protected]> wrote:
> On 03/30/12 07:30, Johannes Berg wrote:
>> On Fri, 2012-03-30 at 16:56 +0530, Sujith Manoharan wrote:
>>> Johannes Berg wrote:
>>>> Somehow exporting too many variables completely confuses the kernel's
>>>> Makefiles into trying to calculate the size of every file in a very slow
>>>> shell script ... this is causing EXTREME build slowdowns for me.
>>>>
>>>> These two patches fix it.
>>> Nice.
>>>
>>> Trying to build ath9k..
>>>
>>> Before:
>>>
>>> real    1m18.689s
>>> user    3m1.382s
>>> sys     0m6.833s
>>>
>>> After:
>>>
>>> real    0m42.091s
>>> user    1m30.024s
>>> sys     0m5.700s
> Please put this in stable as well, seems like a good thing ;-)

Johannes, kick ass patches, thanks!!! Richard, I will propagate to
stable, but first gotta figure why the patch, "compat: explicitly
export generated variables" broke builds for older kernels:

mcgrof@tux ~/compat (git::master)$ ckmake
Trying kernel 3.3.0-030300rc2-generic [OK]
Trying kernel 3.2.2-030202-generic [OK]
Trying kernel 3.1.10-030110-generic [OK]
Trying kernel 3.0.18-030018-generic [OK]
Trying kernel 2.6.39-02063904-generic [OK]
Trying kernel 2.6.38-13-generic [OK]
Trying kernel 2.6.38-02063808-generic [OK]
Trying kernel 2.6.37-02063706-generic [OK]
Trying kernel 2.6.36-02063604-generic [OK]
Trying kernel 2.6.35-02063512-generic [OK]
Trying kernel 2.6.34-02063410-generic [OK]
Trying kernel 2.6.33-02063305-generic [OK]
Trying kernel 2.6.32-02063255-generic [FAILED]
Trying kernel 2.6.31-22-generic [FAILED]
Trying kernel 2.6.31-02063113-generic [FAILED]
Trying kernel 2.6.30-02063010-generic [FAILED]
Trying kernel 2.6.29-02062906-generic [FAILED]
Trying kernel 2.6.28-02062810-generic [FAILED]
Trying kernel 2.6.27-020627-generic [FAILED]
Trying kernel 2.6.26-020626-generic [FAILED]
Trying kernel 2.6.25-020625-generic [FAILED]
Trying kernel 2.6.24-020624-generic [FAILED]

Luis

2012-03-31 09:24:51

by Luis Chamberlain

[permalink] [raw]
Subject: Re: [PATCH 0/2] compat: fix extreme build slowdowns

> > > >>> Before:
> > > >>>
> > > >>> real ? ?1m18.689s
> > > >>> user ? ?3m1.382s
> > > >>> sys ? ? 0m6.833s
> > > >>>
> > > >>> After:
> > > >>>
> > > >>> real ? ?0m42.091s
> > > >>> user ? ?1m30.024s
> > > >>> sys ? ? 0m5.700s

So for compat-wireless we with similar patch we shafe off more
than half of the compile time :)

>From db133a867d4c0ee31211c62205b5c5287acb30a9 Mon Sep 17 00:00:00 2001
From: "Luis R. Rodriguez" <[email protected]>
Date: Fri, 30 Mar 2012 19:53:32 -0700
Subject: [PATCH] compat-wireless: do not use broad export on makefiles

This inspired by Johannes' patch on compat which does the
same thing.

perl -pi -ne 's|^(\s*)CONFIG|$1export CONFIG|' config.mk

And then we also address the autoconf generation.

We shave off compile time by more than 1/2:

Before:
real 0m34.034s
user 0m33.760s
sys 0m10.580s

After:
real 0m16.617s
user 0m22.290s
sys 0m6.180s

This was against 2.6.38.

Signed-off-by: Luis R. Rodriguez <[email protected]>
---
config.mk | 450 ++++++++++++++++++++--------------------
scripts/gen-compat-autoconf.sh | 4 +-
2 files changed, 225 insertions(+), 229 deletions(-)

diff --git a/config.mk b/config.mk
index 965dc56..f02d52b 100644
--- a/config.mk
+++ b/config.mk
@@ -1,15 +1,9 @@
-export
-
-## NOTE
-## Make sure to have each variable declaration start
-## in the first column, no whitespace allowed.
-
ifeq ($(wildcard $(KLIB_BUILD)/.config),)
# These will be ignored by compat autoconf
- CONFIG_PCI=y
- CONFIG_USB=y
- CONFIG_PCMCIA=y
- CONFIG_SSB=m
+ export CONFIG_PCI=y
+ export CONFIG_USB=y
+ export CONFIG_PCMCIA=y
+ export CONFIG_SSB=m
else
include $(KLIB_BUILD)/.config
endif
@@ -83,21 +77,21 @@ endif # build check
endif # kernel Makefile check

# These both are needed by compat-wireless || compat-bluetooth so enable them
- CONFIG_COMPAT_RFKILL=y
+ export CONFIG_COMPAT_RFKILL=y

ifeq ($(CONFIG_MAC80211),y)
$(error "ERROR: you have MAC80211 compiled into the kernel, CONFIG_MAC80211=y, as such you cannot replace its mac80211 driver. You need this set to CONFIG_MAC80211=m. If you are using Fedora upgrade your kernel as later version should this set as modular. For further information on Fedora see https://bugzilla.redhat.com/show_bug.cgi?id=470143. If you are using your own kernel recompile it and make mac80211 modular")
else
- CONFIG_COMPAT_WIRELESS=y
- CONFIG_COMPAT_WIRELESS_MODULES=m
- CONFIG_COMPAT_VAR_MODULES=m
+ export CONFIG_COMPAT_WIRELESS=y
+ export CONFIG_COMPAT_WIRELESS_MODULES=m
+ export CONFIG_COMPAT_VAR_MODULES=m
# We could technically separate these but not yet, we only have b44
# Note that we don't intend on backporting network drivers that
# use Multiqueue as that was a pain to backport to kernels older than
# 2.6.27. But -- we could just disable those drivers from kernels
# older than 2.6.27
- CONFIG_COMPAT_NETWORK_MODULES=m
- CONFIG_COMPAT_NET_USB_MODULES=m
+ export CONFIG_COMPAT_NETWORK_MODULES=m
+ export CONFIG_COMPAT_NET_USB_MODULES=m
endif

# The Bluetooth compatibility only builds on kernels >= 2.6.27 for now
@@ -105,8 +99,8 @@ ifndef CONFIG_COMPAT_KERNEL_2_6_27
ifeq ($(CONFIG_BT),y)
# we'll ignore compiling bluetooth
else
- CONFIG_COMPAT_BLUETOOTH=y
- CONFIG_COMPAT_BLUETOOTH_MODULES=m
+ export CONFIG_COMPAT_BLUETOOTH=y
+ export CONFIG_COMPAT_BLUETOOTH_MODULES=m
endif
endif #CONFIG_COMPAT_KERNEL_2_6_27

@@ -117,14 +111,14 @@ endif #CONFIG_COMPAT_KERNEL_2_6_27
ifdef CONFIG_COMPAT_KERNEL_2_6_33
ifndef CONFIG_COMPAT_RHEL_6_1
ifdef CONFIG_FW_LOADER
-CONFIG_COMPAT_FIRMWARE_CLASS=m
+export CONFIG_COMPAT_FIRMWARE_CLASS=m
endif #CONFIG_FW_LOADER
endif #CONFIG_COMPAT_RHEL_6_1
endif #CONFIG_COMPAT_KERNEL_2_6_33

ifdef CONFIG_COMPAT_KERNEL_2_6_36
ifndef CONFIG_COMPAT_RHEL_6_1
- CONFIG_COMPAT_KFIFO=y
+ export CONFIG_COMPAT_KFIFO=y
endif #CONFIG_COMPAT_RHEL_6_1
endif #CONFIG_COMPAT_KERNEL_2_6_36

@@ -133,10 +127,10 @@ endif #CONFIG_COMPAT_KERNEL_2_6_36
# whitespace, because they get passed-on through compat_autoconf.h.
#
ifndef CONFIG_COMPAT_KERNEL_2_6_33
-CONFIG_COMPAT_BT_SOCK_CREATE_NEEDS_KERN=y
+export CONFIG_COMPAT_BT_SOCK_CREATE_NEEDS_KERN=y
endif #CONFIG_COMPAT_KERNEL_2_6_33
ifdef CONFIG_COMPAT_RHEL_6_0
-CONFIG_COMPAT_BT_SOCK_CREATE_NEEDS_KERN=y
+export CONFIG_COMPAT_BT_SOCK_CREATE_NEEDS_KERN=y
endif #CONFIG_COMPAT_RHEL_6_0

#
@@ -144,14 +138,14 @@ endif #CONFIG_COMPAT_RHEL_6_0
# whitespace, because it gets passed-on through compat_autoconf.h.
#
ifdef CONFIG_COMPAT_RHEL_6_0
-CONFIG_COMPAT_FIRMWARE_DATA_RW_NEEDS_FILP=y
+export CONFIG_COMPAT_FIRMWARE_DATA_RW_NEEDS_FILP=y
endif #CONFIG_COMPAT_RHEL_6_0

# Wireless subsystem stuff
-CONFIG_MAC80211=m
+export CONFIG_MAC80211=m

ifndef CONFIG_COMPAT_KERNEL_2_6_33
-CONFIG_COMPAT_MAC80211_DRIVER_API_TRACER=y
+export CONFIG_COMPAT_MAC80211_DRIVER_API_TRACER=y
endif #CONFIG_COMPAT_KERNEL_2_6_33

# CONFIG_MAC80211_DEBUGFS=y
@@ -167,24 +161,24 @@ endif #CONFIG_COMPAT_KERNEL_2_6_33
# CONFIG_MAC80211_DEBUG_COUNTERS=y

# choose between pid and minstrel as default rate control algorithm
-CONFIG_MAC80211_RC_DEFAULT=minstrel_ht
-CONFIG_MAC80211_RC_DEFAULT_MINSTREL=y
+export CONFIG_MAC80211_RC_DEFAULT=minstrel_ht
+export CONFIG_MAC80211_RC_DEFAULT_MINSTREL=y
# CONFIG_MAC80211_RC_DEFAULT_PID=y
# This is the one used by our compat-wireless net/mac80211/rate.c
# in case you have and old kernel which is overriding this to pid.
-CONFIG_COMPAT_MAC80211_RC_DEFAULT=minstrel_ht
-CONFIG_MAC80211_RC_PID=y
-CONFIG_MAC80211_RC_MINSTREL=y
-CONFIG_MAC80211_RC_MINSTREL_HT=y
+export CONFIG_COMPAT_MAC80211_RC_DEFAULT=minstrel_ht
+export CONFIG_MAC80211_RC_PID=y
+export CONFIG_MAC80211_RC_MINSTREL=y
+export CONFIG_MAC80211_RC_MINSTREL_HT=y
ifdef CONFIG_LEDS_TRIGGERS
-CONFIG_MAC80211_LEDS=y
+export CONFIG_MAC80211_LEDS=y
endif #CONFIG_LEDS_TRIGGERS

# enable mesh networking too
-CONFIG_MAC80211_MESH=y
+export CONFIG_MAC80211_MESH=y

-CONFIG_CFG80211=m
-CONFIG_CFG80211_DEFAULT_PS=y
+export CONFIG_CFG80211=m
+export CONFIG_CFG80211_DEFAULT_PS=y
# CONFIG_CFG80211_DEBUGFS=y
# CONFIG_NL80211_TESTMODE=y
# CONFIG_CFG80211_DEVELOPER_WARNINGS=y
@@ -192,40 +186,40 @@ CONFIG_CFG80211_DEFAULT_PS=y
# CONFIG_CFG80211_INTERNAL_REGDB=y
# See below for wext stuff

-CONFIG_LIB80211=m
-CONFIG_LIB80211_CRYPT_WEP=m
-CONFIG_LIB80211_CRYPT_CCMP=m
-CONFIG_LIB80211_CRYPT_TKIP=m
+export CONFIG_LIB80211=m
+export CONFIG_LIB80211_CRYPT_WEP=m
+export CONFIG_LIB80211_CRYPT_CCMP=m
+export CONFIG_LIB80211_CRYPT_TKIP=m
# CONFIG_LIB80211_DEBUG=y

-CONFIG_BT=m
-CONFIG_BT_RFCOMM=m
-CONFIG_BT_RFCOMM_TTY=y
-CONFIG_BT_BNEP=m
-CONFIG_BT_BNEP_MC_FILTER=y
-CONFIG_BT_BNEP_PROTO_FILTER=y
+export CONFIG_BT=m
+export CONFIG_BT_RFCOMM=m
+export CONFIG_BT_RFCOMM_TTY=y
+export CONFIG_BT_BNEP=m
+export CONFIG_BT_BNEP_MC_FILTER=y
+export CONFIG_BT_BNEP_PROTO_FILTER=y
# CONFIG_BT_CMTP depends on ISDN_CAPI
ifdef CONFIG_ISDN_CAPI
-CONFIG_BT_CMTP=m
+export CONFIG_BT_CMTP=m
endif #CONFIG_ISDN_CAPI
ifndef CONFIG_COMPAT_KERNEL_2_6_28
-CONFIG_COMPAT_BT_HIDP=m
+export CONFIG_COMPAT_BT_HIDP=m
endif #CONFIG_COMPAT_KERNEL_2_6_28

-CONFIG_BT_HCIUART=M
-CONFIG_BT_HCIUART_H4=y
-CONFIG_BT_HCIUART_BCSP=y
-CONFIG_BT_HCIUART_ATH3K=y
-CONFIG_BT_HCIUART_LL=y
+export CONFIG_BT_HCIUART=M
+export CONFIG_BT_HCIUART_H4=y
+export CONFIG_BT_HCIUART_BCSP=y
+export CONFIG_BT_HCIUART_ATH3K=y
+export CONFIG_BT_HCIUART_LL=y

-CONFIG_BT_HCIVHCI=m
-CONFIG_BT_MRVL=m
+export CONFIG_BT_HCIVHCI=m
+export CONFIG_BT_MRVL=m

ifdef CONFIG_PCMCIA
-CONFIG_BT_HCIDTL1=m
-CONFIG_BT_HCIBT3C=m
-CONFIG_BT_HCIBLUECARD=m
-CONFIG_BT_HCIBTUART=m
+export CONFIG_BT_HCIDTL1=m
+export CONFIG_BT_HCIBT3C=m
+export CONFIG_BT_HCIBLUECARD=m
+export CONFIG_BT_HCIBTUART=m
endif #CONFIG_PCMCIA


@@ -237,26 +231,26 @@ endif #CONFIG_PCMCIA
# wireless_handlers attribute which will be activated by
# CONFIG_WIRELESS_EXT.
ifdef CONFIG_WIRELESS_EXT
-CONFIG_CFG80211_WEXT=y
+export CONFIG_CFG80211_WEXT=y
else #CONFIG_CFG80211_WEXT
$(warning "WARNING: CONFIG_CFG80211_WEXT will be deactivated or not working because kernel was compiled with CONFIG_WIRELESS_EXT=n. Tools using wext interface like iwconfig will not work. To activate it build your kernel e.g. with CONFIG_LIBIPW=m.")
endif #CONFIG_WIRELESS_EXT

ifdef CONFIG_STAGING
-CONFIG_COMPAT_STAGING=m
+export CONFIG_COMPAT_STAGING=m
endif #CONFIG_STAGING

# mac80211 test driver
-CONFIG_MAC80211_HWSIM=m
+export CONFIG_MAC80211_HWSIM=m

-CONFIG_ATH5K=m
+export CONFIG_ATH5K=m
# CONFIG_ATH5K_DEBUG=y
# CONFIG_ATH5K_TRACER=y
# CONFIG_ATH5K_AHB=y

-CONFIG_ATH9K=m
-CONFIG_ATH9K_HW=m
-CONFIG_ATH9K_COMMON=m
+export CONFIG_ATH9K=m
+export CONFIG_ATH9K_HW=m
+export CONFIG_ATH9K_COMMON=m
# CONFIG_ATH9K_DEBUGFS=y
# CONFIG_ATH9K_AHB=y
# CONFIG_ATH9K_PKTLOG=y
@@ -267,68 +261,68 @@ CONFIG_ATH9K_COMMON=m
# as default once we get minstrel properly tested and blessed by
# our systems engineering team. CCK rates also need to be used
# for long range considerations.
-CONFIG_COMPAT_ATH9K_RATE_CONTROL=y
+export CONFIG_COMPAT_ATH9K_RATE_CONTROL=y

-CONFIG_ATH9K_BTCOEX_SUPPORT=y
+export CONFIG_ATH9K_BTCOEX_SUPPORT=y

# PCI Drivers
ifdef CONFIG_PCI

-CONFIG_ATH5K_PCI=y
-CONFIG_ATH9K_PCI=y
+export CONFIG_ATH5K_PCI=y
+export CONFIG_ATH9K_PCI=y

-CONFIG_IWLWIFI=m
-CONFIG_IWLWIFI_P2P=y
+export CONFIG_IWLWIFI=m
+export CONFIG_IWLWIFI_P2P=y
# CONFIG_IWLWIFI_DEBUG=y
# CONFIG_IWLWIFI_DEBUGFS=y
# CONFIG_IWLWIFI_DEVICE_TRACING=y
# CONFIG_IWLWIFI_DEBUG_EXPERIMENTAL_UCODE=y

-CONFIG_IWLEGACY=m
-CONFIG_COMPAT_IWL4965=m
-CONFIG_IWL3945=m
+export CONFIG_IWLEGACY=m
+export CONFIG_COMPAT_IWL4965=m
+export CONFIG_IWL3945=m
# CONFIG_IWLEGACY_DEBUG=y
# CONFIG_IWLEGACY_DEBUGFS=y


-CONFIG_B43=m
-CONFIG_B43_HWRNG=y
-CONFIG_B43_PCI_AUTOSELECT=y
+export CONFIG_B43=m
+export CONFIG_B43_HWRNG=y
+export CONFIG_B43_PCI_AUTOSELECT=y
ifdef CONFIG_PCMCIA
-CONFIG_B43_PCMCIA=y
+export CONFIG_B43_PCMCIA=y
endif #CONFIG_PCMCIA
ifdef CONFIG_MAC80211_LEDS
-CONFIG_B43_LEDS=y
+export CONFIG_B43_LEDS=y
endif #CONFIG_MAC80211_LEDS
-CONFIG_B43_PHY_LP=y
-CONFIG_B43_PHY_N=y
-CONFIG_B43_PHY_HT=y
+export CONFIG_B43_PHY_LP=y
+export CONFIG_B43_PHY_N=y
+export CONFIG_B43_PHY_HT=y
# CONFIG_B43_PHY_LCN=y
# CONFIG_B43_DEBUG=y

-CONFIG_B43LEGACY=m
-CONFIG_B43LEGACY_HWRNG=y
-CONFIG_B43LEGACY_PCI_AUTOSELECT=y
+export CONFIG_B43LEGACY=m
+export CONFIG_B43LEGACY_HWRNG=y
+export CONFIG_B43LEGACY_PCI_AUTOSELECT=y
ifdef CONFIG_MAC80211_LEDS
-CONFIG_B43LEGACY_LEDS=y
+export CONFIG_B43LEGACY_LEDS=y
endif #CONFIG_MAC80211_LEDS
# CONFIG_B43LEGACY_DEBUG=y
-CONFIG_B43LEGACY_DMA=y
-CONFIG_B43LEGACY_PIO=y
+export CONFIG_B43LEGACY_DMA=y
+export CONFIG_B43LEGACY_PIO=y

ifdef CONFIG_WIRELESS_EXT
# The Intel ipws
-CONFIG_LIBIPW=m
+export CONFIG_LIBIPW=m
# CONFIG_LIBIPW_DEBUG=y

-CONFIG_IPW2100=m
-CONFIG_IPW2100_MONITOR=y
+export CONFIG_IPW2100=m
+export CONFIG_IPW2100_MONITOR=y
# CONFIG_IPW2100_DEBUG=y
-CONFIG_IPW2200=m
-CONFIG_IPW2200_MONITOR=y
-CONFIG_IPW2200_RADIOTAP=y
-CONFIG_IPW2200_PROMISCUOUS=y
-CONFIG_IPW2200_QOS=y
+export CONFIG_IPW2200=m
+export CONFIG_IPW2200_MONITOR=y
+export CONFIG_IPW2200_RADIOTAP=y
+export CONFIG_IPW2200_PROMISCUOUS=y
+export CONFIG_IPW2200_QOS=y
# CONFIG_IPW2200_DEBUG=y
# The above enables use a second interface prefixed 'rtap'.
# Example usage:
@@ -346,43 +340,43 @@ endif #CONFIG_WIRELESS_EXT

ifdef CONFIG_SSB
# Sonics Silicon Backplane
-CONFIG_SSB_SPROM=y
+export CONFIG_SSB_SPROM=y

-CONFIG_SSB_BLOCKIO=y
-CONFIG_SSB_PCIHOST=y
-CONFIG_SSB_B43_PCI_BRIDGE=y
+export CONFIG_SSB_BLOCKIO=y
+export CONFIG_SSB_PCIHOST=y
+export CONFIG_SSB_B43_PCI_BRIDGE=y
ifdef CONFIG_PCMCIA
-CONFIG_SSB_PCMCIAHOST=y
+export CONFIG_SSB_PCMCIAHOST=y
endif #CONFIG_PCMCIA
# CONFIG_SSB_DEBUG=y
-CONFIG_SSB_DRIVER_PCICORE=y
-CONFIG_B43_SSB=y
+export CONFIG_SSB_DRIVER_PCICORE=y
+export CONFIG_B43_SSB=y
endif #CONFIG_SSB

-CONFIG_BCMA=m
-CONFIG_BCMA_BLOCKIO=y
-CONFIG_BCMA_HOST_PCI=y
+export CONFIG_BCMA=m
+export CONFIG_BCMA_BLOCKIO=y
+export CONFIG_BCMA_HOST_PCI=y
# CONFIG_BCMA_DEBUG=y
-CONFIG_B43_BCMA=y
-CONFIG_B43_BCMA_EXTRA=y
+export CONFIG_B43_BCMA=y
+export CONFIG_B43_BCMA_EXTRA=y

-CONFIG_P54_PCI=m
+export CONFIG_P54_PCI=m

-CONFIG_B44=m
-CONFIG_B44_PCI=y
+export CONFIG_B44=m
+export CONFIG_B44_PCI=y

-CONFIG_RTL8180=m
+export CONFIG_RTL8180=m

-CONFIG_ADM8211=m
+export CONFIG_ADM8211=m

-CONFIG_RT2X00_LIB_PCI=m
-CONFIG_RT2400PCI=m
-CONFIG_RT2500PCI=m
+export CONFIG_RT2X00_LIB_PCI=m
+export CONFIG_RT2400PCI=m
+export CONFIG_RT2500PCI=m
ifdef CONFIG_CRC_CCITT
-CONFIG_RT2800PCI=m
-CONFIG_RT2800PCI_RT33XX=y
-CONFIG_RT2800PCI_RT35XX=y
-CONFIG_RT2800PCI_RT53XX=y
+export CONFIG_RT2800PCI=m
+export CONFIG_RT2800PCI_RT33XX=y
+export CONFIG_RT2800PCI_RT35XX=y
+export CONFIG_RT2800PCI_RT53XX=y
endif #CONFIG_CRC_CCITT
NEED_RT2X00=y

@@ -390,46 +384,46 @@ NEED_RT2X00=y
# CRC to check the firmware. We check here first for the PCI
# driver as we're in the PCI section.
ifdef CONFIG_CRC_ITU_T
-CONFIG_RT61PCI=m
+export CONFIG_RT61PCI=m
endif #CONFIG_CRC_ITU_T

-CONFIG_MWL8K=m
+export CONFIG_MWL8K=m

# Ethernet drivers go here
-CONFIG_ATL1=m
-CONFIG_ATL2=m
-CONFIG_ATL1E=m
+export CONFIG_ATL1=m
+export CONFIG_ATL2=m
+export CONFIG_ATL1E=m
ifdef CONFIG_COMPAT_KERNEL_2_6_27
-CONFIG_ATL1C=n
-CONFIG_ALX=m
+export CONFIG_ATL1C=n
+export CONFIG_ALX=m
else #CONFIG_COMPAT_KERNEL_2_6_27
-CONFIG_ATL1C=n
-CONFIG_ALX=m
+export CONFIG_ATL1C=n
+export CONFIG_ALX=m
endif #CONFIG_COMPAT_KERNEL_2_6_27

ifdef CONFIG_WIRELESS_EXT
-CONFIG_HERMES=m
-CONFIG_HERMES_CACHE_FW_ON_INIT=y
+export CONFIG_HERMES=m
+export CONFIG_HERMES_CACHE_FW_ON_INIT=y
ifdef CONFIG_PPC_PMAC
-CONFIG_APPLE_AIRPORT=m
+export CONFIG_APPLE_AIRPORT=m
endif #CONFIG_PPC_PMAC
-CONFIG_PLX_HERMES=m
-CONFIG_TMD_HERMES=m
-CONFIG_NORTEL_HERMES=m
-CONFIG_PCI_HERMES=m
+export CONFIG_PLX_HERMES=m
+export CONFIG_TMD_HERMES=m
+export CONFIG_NORTEL_HERMES=m
+export CONFIG_PCI_HERMES=m
ifdef CONFIG_PCMCIA
-CONFIG_PCMCIA_HERMES=m
-CONFIG_PCMCIA_SPECTRUM=m
+export CONFIG_PCMCIA_HERMES=m
+export CONFIG_PCMCIA_SPECTRUM=m
endif #CONFIG_PCMCIA
endif #CONFIG_WIRELESS_EXT

-CONFIG_RTL8192CE=m
-CONFIG_RTL8192SE=m
-CONFIG_RTL8192DE=m
+export CONFIG_RTL8192CE=m
+export CONFIG_RTL8192SE=m
+export CONFIG_RTL8192DE=m

-CONFIG_BRCMSMAC=m
+export CONFIG_BRCMSMAC=m

-CONFIG_MWIFIEX_PCIE=m
+export CONFIG_MWIFIEX_PCIE=m

endif #CONFIG_PCI
## end of PCI
@@ -437,10 +431,10 @@ endif #CONFIG_PCI
ifdef CONFIG_PCMCIA

ifdef CONFIG_COMPAT_KERNEL_2_6_27
-CONFIG_LIBERTAS=n
-CONFIG_LIBERTAS_CS=n
+export CONFIG_LIBERTAS=n
+export CONFIG_LIBERTAS_CS=n
else #CONFIG_COMPAT_KERNEL_2_6_27
-CONFIG_LIBERTAS_CS=m
+export CONFIG_LIBERTAS_CS=m
NEED_LIBERTAS=y
endif #CONFIG_COMPAT_KERNEL_2_6_27

@@ -448,12 +442,12 @@ endif #CONFIG_PCMCIA
## end of PCMCIA

# This is required for some cards
-CONFIG_EEPROM_93CX6=m
+export CONFIG_EEPROM_93CX6=m

# USB Drivers
ifdef CONFIG_USB
ifndef CONFIG_COMPAT_KERNEL_2_6_29
-CONFIG_COMPAT_ZD1211RW=m
+export CONFIG_COMPAT_ZD1211RW=m
# CONFIG_ZD1211RW_DEBUG=y
endif #CONFIG_COMPAT_KERNEL_2_6_29

@@ -465,84 +459,84 @@ endif #CONFIG_COMPAT_KERNEL_2_6_29
# Note: this depends on CONFIG_USB_NET_RNDIS_HOST and CONFIG_USB_NET_CDCETHER
# it also requires new RNDIS_HOST and CDC_ETHER modules which we add
ifdef CONFIG_COMPAT_KERNEL_2_6_29
-CONFIG_USB_COMPAT_USBNET=n
-CONFIG_USB_NET_COMPAT_RNDIS_HOST=n
-CONFIG_USB_NET_COMPAT_RNDIS_WLAN=n
-CONFIG_USB_NET_COMPAT_CDCETHER=n
+export CONFIG_USB_COMPAT_USBNET=n
+export CONFIG_USB_NET_COMPAT_RNDIS_HOST=n
+export CONFIG_USB_NET_COMPAT_RNDIS_WLAN=n
+export CONFIG_USB_NET_COMPAT_CDCETHER=n
else #CONFIG_COMPAT_KERNEL_2_6_29
-CONFIG_USB_COMPAT_USBNET=m
+export CONFIG_USB_COMPAT_USBNET=m
ifdef CONFIG_USB_NET_CDCETHER
-CONFIG_USB_NET_COMPAT_RNDIS_HOST=m
-CONFIG_USB_NET_COMPAT_RNDIS_WLAN=m
+export CONFIG_USB_NET_COMPAT_RNDIS_HOST=m
+export CONFIG_USB_NET_COMPAT_RNDIS_WLAN=m
endif #CONFIG_USB_NET_CDCETHER
ifdef CONFIG_USB_NET_CDCETHER_MODULE
-CONFIG_USB_NET_COMPAT_RNDIS_HOST=m
-CONFIG_USB_NET_COMPAT_RNDIS_WLAN=m
+export CONFIG_USB_NET_COMPAT_RNDIS_HOST=m
+export CONFIG_USB_NET_COMPAT_RNDIS_WLAN=m
endif #CONFIG_USB_NET_CDCETHER
-CONFIG_USB_NET_COMPAT_CDCETHER=m
+export CONFIG_USB_NET_COMPAT_CDCETHER=m
endif #CONFIG_COMPAT_KERNEL_2_6_29


-CONFIG_P54_USB=m
-CONFIG_RTL8187=m
+export CONFIG_P54_USB=m
+export CONFIG_RTL8187=m
ifdef CONFIG_MAC80211_LEDS
-CONFIG_RTL8187_LEDS=y
+export CONFIG_RTL8187_LEDS=y
endif #CONFIG_MAC80211_LEDS

-CONFIG_AT76C50X_USB=m
+export CONFIG_AT76C50X_USB=m

ifndef CONFIG_COMPAT_KERNEL_2_6_29
-CONFIG_CARL9170=m
+export CONFIG_CARL9170=m
ifdef CONFIG_MAC80211_LEDS
-CONFIG_CARL9170_LEDS=y
+export CONFIG_CARL9170_LEDS=y
endif #CONFIG_MAC80211_LEDS
# CONFIG_CARL9170_DEBUGFS=y
-CONFIG_CARL9170_WPC=y
+export CONFIG_CARL9170_WPC=y
endif #CONFIG_COMPAT_KERNEL_2_6_29

# This activates a threading fix for usb urb.
# this is mainline commit: b3e670443b7fb8a2d29831b62b44a039c283e351
# This fix will be included in some stable releases.
-CONFIG_COMPAT_USB_URB_THREAD_FIX=y
+export CONFIG_COMPAT_USB_URB_THREAD_FIX=y

-CONFIG_ATH9K_HTC=m
+export CONFIG_ATH9K_HTC=m
# CONFIG_ATH9K_HTC_DEBUGFS=y

# RT2500USB does not require firmware
-CONFIG_RT2500USB=m
+export CONFIG_RT2500USB=m
ifdef CONFIG_CRC_CCITT
-CONFIG_RT2800USB=m
-CONFIG_RT2800USB_RT33XX=y
-CONFIG_RT2800USB_RT35XX=y
-CONFIG_RT2800USB_RT53XX=y
-CONFIG_RT2800USB_UNKNOWN=y
+export CONFIG_RT2800USB=m
+export CONFIG_RT2800USB_RT33XX=y
+export CONFIG_RT2800USB_RT35XX=y
+export CONFIG_RT2800USB_RT53XX=y
+export CONFIG_RT2800USB_UNKNOWN=y
endif #CONFIG_CRC_CCITT
-CONFIG_RT2X00_LIB_USB=m
+export CONFIG_RT2X00_LIB_USB=m
NEED_RT2X00=y
# RT73USB requires firmware
ifdef CONFIG_CRC_ITU_T
-CONFIG_RT73USB=m
+export CONFIG_RT73USB=m
endif #CONFIG_CRC_ITU_T

ifdef CONFIG_COMPAT_KERNEL_2_6_27
-CONFIG_LIBERTAS_THINFIRM_USB=n
-CONFIG_LIBERTAS_USB=n
+export CONFIG_LIBERTAS_THINFIRM_USB=n
+export CONFIG_LIBERTAS_USB=n
NEED_LIBERTAS=n
else #CONFIG_COMPAT_KERNEL_2_6_27
-CONFIG_LIBERTAS_THINFIRM_USB=m
-CONFIG_LIBERTAS_USB=m
+export CONFIG_LIBERTAS_THINFIRM_USB=m
+export CONFIG_LIBERTAS_USB=m
NEED_LIBERTAS=y
endif #CONFIG_COMPAT_KERNEL_2_6_27

-CONFIG_ORINOCO_USB=m
+export CONFIG_ORINOCO_USB=m

-CONFIG_BT_HCIBTUSB=m
-CONFIG_BT_HCIBCM203X=m
-CONFIG_BT_HCIBPA10X=m
-CONFIG_BT_HCIBFUSB=m
-CONFIG_BT_ATH3K=m
+export CONFIG_BT_HCIBTUSB=m
+export CONFIG_BT_HCIBCM203X=m
+export CONFIG_BT_HCIBPA10X=m
+export CONFIG_BT_HCIBFUSB=m
+export CONFIG_BT_ATH3K=m

-CONFIG_RTL8192CU=m
+export CONFIG_RTL8192CU=m

endif #CONFIG_USB end of USB driver list

@@ -550,16 +544,16 @@ ifdef CONFIG_SPI_MASTER
ifndef CONFIG_COMPAT_KERNEL_2_6_25

ifdef CONFIG_CRC7
-CONFIG_WL1251_SPI=m
-CONFIG_WL12XX_SPI=m
+export CONFIG_WL1251_SPI=m
+export CONFIG_WL12XX_SPI=m
endif #CONFIG_CRC7
-CONFIG_P54_SPI=m
+export CONFIG_P54_SPI=m

ifdef CONFIG_COMPAT_KERNEL_2_6_27
-CONFIG_LIBERTAS_SPI=n
+export CONFIG_LIBERTAS_SPI=n
NEED_LIBERTAS=n
else #CONFIG_COMPAT_KERNEL_2_6_27
-CONFIG_LIBERTAS_SPI=m
+export CONFIG_LIBERTAS_SPI=m
NEED_LIBERTAS=y
endif #CONFIG_COMPAT_KERNEL_2_6_27

@@ -568,64 +562,64 @@ endif #CONFIG_SPI_MASTER end of SPI driver list

ifdef CONFIG_MMC

-CONFIG_SSB_SDIOHOST=y
-CONFIG_B43_SDIO=y
+export CONFIG_SSB_SDIOHOST=y
+export CONFIG_B43_SDIO=y

ifdef CONFIG_CRC7
ifdef CONFIG_WL12XX_PLATFORM_DATA
-CONFIG_COMPAT_WL1251_SDIO=m
+export CONFIG_COMPAT_WL1251_SDIO=m
endif #CONFIG_WL12XX_PLATFORM_DATA

ifndef CONFIG_COMPAT_KERNEL_2_6_32
ifdef CONFIG_WL12XX_PLATFORM_DATA
-CONFIG_COMPAT_WL12XX_SDIO=m
+export CONFIG_COMPAT_WL12XX_SDIO=m
endif #CONFIG_WL12XX_PLATFORM_DATA
endif #CONFIG_COMPAT_KERNEL_2_6_32

endif #CONFIG_CRC7

-CONFIG_MWIFIEX_SDIO=m
+export CONFIG_MWIFIEX_SDIO=m

ifndef CONFIG_COMPAT_KERNEL_2_6_32
-CONFIG_COMPAT_LIBERTAS_SDIO=m
+export CONFIG_COMPAT_LIBERTAS_SDIO=m
NEED_LIBERTAS=y
endif #CONFIG_COMPAT_KERNEL_2_6_32

-CONFIG_IWM=m
+export CONFIG_IWM=m
# CONFIG_IWM_DEBUG=y
# CONFIG_IWM_TRACING=y

-CONFIG_BT_HCIBTSDIO=m
-CONFIG_BT_MRVL_SDIO=m
+export CONFIG_BT_HCIBTSDIO=m
+export CONFIG_BT_MRVL_SDIO=m

ifndef CONFIG_COMPAT_KERNEL_2_6_27
-CONFIG_ATH6KL=m
+export CONFIG_ATH6KL=m
# CONFIG_ATH6KL_DEBUG=y
endif #CONFIG_COMPAT_KERNEL_2_6_27

ifndef CONFIG_COMPAT_KERNEL_2_6_29
-CONFIG_BRCMFMAC=m
-CONFIG_BRCMFMAC_SDIO=y
+export CONFIG_BRCMFMAC=m
+export CONFIG_BRCMFMAC_SDIO=y
endif #CONFIG_COMPAT_KERNEL_2_6_29

endif #CONFIG_MMC

-CONFIG_RTLWIFI=m
-CONFIG_RTL8192C_COMMON=m
+export CONFIG_RTLWIFI=m
+export CONFIG_RTL8192C_COMMON=m

# Common rt2x00 requirements
ifeq ($(NEED_RT2X00),y)
-CONFIG_RT2X00=y
-CONFIG_RT2X00_LIB=m
-CONFIG_RT2800_LIB=m
-CONFIG_RT2X00_LIB_FIRMWARE=y
-CONFIG_RT2X00_LIB_CRYPTO=y
+export CONFIG_RT2X00=y
+export CONFIG_RT2X00_LIB=m
+export CONFIG_RT2800_LIB=m
+export CONFIG_RT2X00_LIB_FIRMWARE=y
+export CONFIG_RT2X00_LIB_CRYPTO=y
# CONFIG_RT2X00_LIB_SOC=y
ifdef CONFIG_COMPAT_KERNEL_2_6_25
-CONFIG_RT2X00_LIB_LEDS=n
+export CONFIG_RT2X00_LIB_LEDS=n
else #CONFIG_COMPAT_KERNEL_2_6_25
ifdef CONFIG_LEDS_CLASS
-CONFIG_RT2X00_LIB_LEDS=y
+export CONFIG_RT2X00_LIB_LEDS=y
endif #CONFIG_LEDS_CLASS
endif #CONFIG_COMPAT_KERNEL_2_6_25
# CONFIG_RT2X00_DEBUG=y
@@ -633,40 +627,40 @@ endif #CONFIG_COMPAT_KERNEL_2_6_25
endif

# p54
-CONFIG_P54_COMMON=m
+export CONFIG_P54_COMMON=m
ifdef CONFIG_MAC80211_LEDS
-CONFIG_P54_LEDS=y
+export CONFIG_P54_LEDS=y
endif #CONFIG_MAC80211_LEDS

# Atheros
-CONFIG_ATH_COMMON=m
+export CONFIG_ATH_COMMON=m
# CONFIG_ATH_DEBUG=y

-CONFIG_BRCMUTIL=m
+export CONFIG_BRCMUTIL=m
# CONFIG_BRCMDBG=y

ifdef CONFIG_CRC7
-CONFIG_WL1251=m
-CONFIG_WL12XX=m
+export CONFIG_WL1251=m
+export CONFIG_WL12XX=m
endif #CONFIG_CRC7

-CONFIG_MWIFIEX=m
+export CONFIG_MWIFIEX=m

ifndef CONFIG_CORDIC
-CONFIG_COMPAT_CORDIC=y
+export CONFIG_COMPAT_CORDIC=y
endif #CONFIG_CORDIC

ifndef CONFIG_CRC8
-CONFIG_COMPAT_CRC8=y
+export CONFIG_COMPAT_CRC8=y
endif #CONFIG_CRC8

ifdef CONFIG_COMPAT_KERNEL_2_6_27
-CONFIG_LIBERTAS=n
+export CONFIG_LIBERTAS=n
else #CONFIG_COMPAT_KERNEL_2_6_27
ifeq ($(NEED_LIBERTAS),y)
-CONFIG_LIBERTAS_THINFIRM=m
-CONFIG_LIBERTAS=m
-CONFIG_LIBERTAS_MESH=y
+export CONFIG_LIBERTAS_THINFIRM=m
+export CONFIG_LIBERTAS=m
+export CONFIG_LIBERTAS_MESH=y
# CONFIG_LIBERTAS_DEBUG=y
endif
endif #CONFIG_COMPAT_KERNEL_2_6_27
@@ -674,10 +668,10 @@ endif #CONFIG_COMPAT_KERNEL_2_6_27
# We need the backported rfkill module on kernel < 2.6.31.
# In more recent kernel versions use the in kernel rfkill module.
ifdef CONFIG_COMPAT_KERNEL_2_6_31
-CONFIG_RFKILL_BACKPORT=m
+export CONFIG_RFKILL_BACKPORT=m
ifdef CONFIG_LEDS_TRIGGERS
-CONFIG_RFKILL_BACKPORT_LEDS=y
+export CONFIG_RFKILL_BACKPORT_LEDS=y
endif #CONFIG_LEDS_TRIGGERS
-CONFIG_RFKILL_BACKPORT_INPUT=y
+export CONFIG_RFKILL_BACKPORT_INPUT=y
endif #CONFIG_COMPAT_KERNEL_2_6_31

diff --git a/scripts/gen-compat-autoconf.sh b/scripts/gen-compat-autoconf.sh
index 87257c6..c7bdd38 100755
--- a/scripts/gen-compat-autoconf.sh
+++ b/scripts/gen-compat-autoconf.sh
@@ -146,7 +146,9 @@ EOF
kernel_version_req $OLDEST_KERNEL_SUPPORTED

# For each CONFIG_FOO=x option
-for i in $(egrep -h '^CONFIG_|^ifdef CONFIG_|^ifndef CONFIG_|^endif #CONFIG_|^else #CONFIG_' $COMPAT_CONFIG_1 $COMPAT_CONFIG_2 | sed 's/ /+/'); do
+for i in $(egrep -h '^export CONFIG_|^ifdef CONFIG_|^ifndef CONFIG_|^endif #CONFIG_|^else #CONFIG_' $COMPAT_CONFIG_1 $COMPAT_CONFIG_2 | \
+ sed 's/export //' | \
+ sed 's/ /+/'); do
case $i in
'ifdef+CONFIG_'* )
echo "#$i" | sed -e 's/+/ /' -e 's/\(ifdef CONFIG_COMPAT_KERNEL_3_\)\([0-9]*\)/if (LINUX_VERSION_CODE < KERNEL_VERSION(3,\2,0))/' -e 's/\(ifdef CONFIG_COMPAT_KERNEL_2_6_\)\([0-9]*\)/if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,\2))/' -e 's/\(ifdef CONFIG_COMPAT_RHEL_\)\([0-9]*\)_\([0-9]*\)/if (defined(RHEL_MAJOR) \&\& RHEL_MAJOR == \2 \&\& RHEL_MINOR >= \3)/' -e 's/\(#ifdef \)\(CONFIG_[^:space:]*\)/#if defined(\2) || defined(\2_MODULE)/'
--
1.7.10.rc1.22.gf5241


2012-03-30 21:48:53

by Luis Chamberlain

[permalink] [raw]
Subject: Re: [PATCH 0/2] compat: fix extreme build slowdowns

On Fri, Mar 30, 2012 at 05:24:42PM -0400, Luis R. Rodriguez wrote:
> On Fri, Mar 30, 2012 at 01:43:20PM -0700, Luis R. Rodriguez wrote:
> > On Fri, Mar 30, 2012 at 7:41 AM, Richard Farina <[email protected]> wrote:
> > > On 03/30/12 07:30, Johannes Berg wrote:
> > >> On Fri, 2012-03-30 at 16:56 +0530, Sujith Manoharan wrote:
> > >>> Johannes Berg wrote:
> > >>>> Somehow exporting too many variables completely confuses the kernel's
> > >>>> Makefiles into trying to calculate the size of every file in a very slow
> > >>>> shell script ... this is causing EXTREME build slowdowns for me.
> > >>>>
> > >>>> These two patches fix it.
> > >>> Nice.
> > >>>
> > >>> Trying to build ath9k..
> > >>>
> > >>> Before:
> > >>>
> > >>> real ? ?1m18.689s
> > >>> user ? ?3m1.382s
> > >>> sys ? ? 0m6.833s
> > >>>
> > >>> After:
> > >>>
> > >>> real ? ?0m42.091s
> > >>> user ? ?1m30.024s
> > >>> sys ? ? 0m5.700s
> > > Please put this in stable as well, seems like a good thing ;-)
> >
> > Johannes, kick ass patches, thanks!!! Richard, I will propagate to
> > stable, but first gotta figure why the patch, "compat: explicitly
> > export generated variables" broke builds for older kernels:
> >
> > mcgrof@tux ~/compat (git::master)$ ckmake
> > Trying kernel 3.3.0-030300rc2-generic [OK]
> > Trying kernel 3.2.2-030202-generic [OK]
> > Trying kernel 3.1.10-030110-generic [OK]
> > Trying kernel 3.0.18-030018-generic [OK]
> > Trying kernel 2.6.39-02063904-generic [OK]
> > Trying kernel 2.6.38-13-generic [OK]
> > Trying kernel 2.6.38-02063808-generic [OK]
> > Trying kernel 2.6.37-02063706-generic [OK]
> > Trying kernel 2.6.36-02063604-generic [OK]
> > Trying kernel 2.6.35-02063512-generic [OK]
> > Trying kernel 2.6.34-02063410-generic [OK]
> > Trying kernel 2.6.33-02063305-generic [OK]
> > Trying kernel 2.6.32-02063255-generic [FAILED]
> > Trying kernel 2.6.31-22-generic [FAILED]
> > Trying kernel 2.6.31-02063113-generic [FAILED]
> > Trying kernel 2.6.30-02063010-generic [FAILED]
> > Trying kernel 2.6.29-02062906-generic [FAILED]
> > Trying kernel 2.6.28-02062810-generic [FAILED]
> > Trying kernel 2.6.27-020627-generic [FAILED]
> > Trying kernel 2.6.26-020626-generic [FAILED]
> > Trying kernel 2.6.25-020625-generic [FAILED]
> > Trying kernel 2.6.24-020624-generic [FAILED]
>
> Applying this patch prior to yours fixes it:

I added one more hunk:

diff --git a/include/linux/compat-2.6.33.h b/include/linux/compat-2.6.33.h
index a11d80f..0c71af9 100644
--- a/include/linux/compat-2.6.33.h
+++ b/include/linux/compat-2.6.33.h
@@ -15,7 +15,7 @@
#include <linux/firmware.h>
#include <linux/input.h>

-#if defined(CONFIG_COMPAT_FIRMWARE_CLASS)
+#if defined(CONFIG_FW_LOADER) || defined(CONFIG_FW_LOADER_MODULE)
#define release_firmware compat_release_firmware
#define request_firmware compat_request_firmware
#define request_firmware_nowait compat_request_firmware_nowait

And another:

diff --git a/Makefile b/Makefile
index 570dd8b..8775294 100644
--- a/Makefile
+++ b/Makefile
@@ -7,9 +7,8 @@ export KLIB:= /lib/modules/$(shell uname -r)
endif
export KLIB_BUILD ?= $(KLIB)/build

-export PWD := $(shell pwd)
-
ifeq ($(KERNELRELEASE),)
+export PWD := $(shell pwd)
export COMPAT_BASE_TREE := "linux-next.git"
# For this specific tree this is only relevant in
# terms of the last time we synched code up with upstream

Still not sure why this fixes it but it does... anyway, I merged these
two patches as individual atomic patches with a sensible individual
commit log message, before yours, and then added yours. Thanks so much!

Applied all and pushed out!

PS. If anyone wants patches propagated to a stable branch you can
use: [email protected] on the commit log and later I can suck these
out automatically.

Luis

2012-03-30 20:34:07

by Johannes Berg

[permalink] [raw]
Subject: Re: [PATCH 2/2] compat: explicitly export generated variables

On Fri, 2012-03-30 at 13:30 -0700, Luis R. Rodriguez wrote:
> On Fri, Mar 30, 2012 at 4:11 AM, Johannes Berg
> <[email protected]> wrote:
> > From: Johannes Berg <[email protected]>
> >
> > Doing the blanket "export" statement at the beginning
> > of the generated file confuses the kernel's Makefiles
> > and causes extreme build slowdowns.
> >
> > Signed-off-by: Johannes Berg <[email protected]>
> > ---
>
> Nice, how did you figure this out BTW!?

Random monkey approach ;-)

I noticed it was slow and saw that it was due to some weird shit from
the kernel Makefile.lib being executed when it shouldn't be.

Since I have the compat *result* in git, I could easily see the diff
between the old compat.git/compat-wireless.git and the new versions. And
then I basically tried to identify the changes that caused this problem,
my best guess was that it had to be the Makefile so I gradually changed
that back to the previous version until the problem went away ... and
then identified which changes were responsible.

johannes