Discussion:
aufs4 GIT release (linux-v4.12-rc1)
s***@users.sourceforge.net
2017-05-21 21:21:21 UTC
Permalink
The mainline v4.12-rc1 doesn't pass my test due to drm/i915 shrinker (as
well as v4.11). So do aufs4.x-rcN branch in this release.
I have aufs4.11 branch in my hand but don't release it because
linux-v4.11 doesn't pass my test. When v4.11.X is fine, I will release
aufs4.11.X. It should not be so long.

o bugfix
- possible bugfix, fput after using inode

o minor
- remove the delayed free
- remove an unnecessary EXECed check for dir

o misc
- for v12-rc1, group param for fsnotify-mark funcs


J. R. Okajima

----------------------------------------

- aufs4-linux.git#aufs4.4..aufs4.11 branch
aufs mmap: tiny optimization, simplify pr_info in mm/prfile.c
aufs: tiny, remove an unnecessary declaration
aufs: remove the delayed free
aufs: remove an unnecessary EXECed check for dir
aufs: tiny, simplify au_seq_path
aufs: possible bugfix, fput after using inode

- aufs4-linux.git#aufs4.x-rcN branch
Addition to above,
aufs: for v12-rc1, group param for fsnotify-mark funcs

- aufs4-standalone.git#aufs4.4 branch
ditto

- aufs-util.git
nothing
Philip Müller
2017-05-29 12:43:39 UTC
Permalink
Hi all,

somehow I get with v4.1.40 [1] following error with Aufs v20161219 and
v20170220.

Setup is 17596 bytes (padded to 17920 bytes).
System is 4185 kB
CRC 7593dae8
Kernel: arch/x86/boot/bzImage is ready (#1)
ERROR: "____ilog2_NaN" [fs/aufs/aufs.ko] undefined!
make[1]: *** [scripts/Makefile.modpost:90: __modpost] Error 1
make: *** [Makefile:1106: modules] Error 2

Any clue what might create this issue?

Greez, Phil

[1] https://cdn.kernel.org/pub/linux/kernel/v4.x/ChangeLog-4.1.40
s***@users.sourceforge.net
2017-05-29 14:01:52 UTC
Permalink
Hi,
Post by Philip Müller
ERROR: "____ilog2_NaN" [fs/aufs/aufs.ko] undefined!
make[1]: *** [scripts/Makefile.modpost:90: __modpost] Error 1
make: *** [Makefile:1106: modules] Error 2
Any clue what might create this issue?
It might be related to your compiler.
See this commit in mainline.
Before you add/apply this commit into your kernel source, I'd suggest
you to confirm that aufs doesn't call ilog2() by itself.


J. R. Okajima


commit 474c90156c8dcc2fa815e6716cc9394d7930cb9c
Author: Linus Torvalds <***@linux-foundation.org>
Date: Thu Mar 2 12:17:22 2017 -0800

give up on gcc ilog2() constant optimizations

gcc-7 has an "optimization" pass that completely screws up, and
generates the code expansion for the (impossible) case of calling
ilog2() with a zero constant, even when the code gcc compiles does not
actually have a zero constant.

And we try to generate a compile-time error for anybody doing ilog2() on
a constant where that doesn't make sense (be it zero or negative). So
now gcc7 will fail the build due to our sanity checking, because it
created that constant-zero case that didn't actually exist in the source
code.

There's a whole long discussion on the kernel mailing about how to work
around this gcc bug. The gcc people themselevs have discussed their
"feature" in

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=72785

but it's all water under the bridge, because while it looked at one
point like it would be solved by the time gcc7 was released, that was
not to be.

So now we have to deal with this compiler braindamage.

And the only simple approach seems to be to just delete the code that
tries to warn about bad uses of ilog2().

So now "ilog2()" will just return 0 not just for the value 1, but for
any non-positive value too.

It's not like I can recall anybody having ever actually tried to use
this function on any invalid value, but maybe the sanity check just
meant that such code never made it out in public.

Reported-by: Laura Abbott <***@redhat.com>
Cc: John Stultz <***@linaro.org>,
Cc: Thomas Gleixner <***@linutronix.de>
Cc: Ard Biesheuvel <***@linaro.org>
Signed-off-by: Linus Torvalds <***@linux-foundation.org>

diff --git a/include/linux/log2.h b/include/linux/log2.h
index ef3d4f6..c373295 100644
--- a/include/linux/log2.h
+++ b/include/linux/log2.h
@@ -16,12 +16,6 @@
#include <linux/bitops.h>

/*
- * deal with unrepresentable constant logarithms
- */
-extern __attribute__((const, noreturn))
-int ____ilog2_NaN(void);
-
-/*
* non-constant log of base 2 calculators
* - the arch may override these in asm/bitops.h if they can be implemented
* more efficiently than using fls() and fls64()
@@ -85,7 +79,7 @@ unsigned long __rounddown_pow_of_two(unsigned long n)
#define ilog2(n) \
( \
__builtin_constant_p(n) ? ( \
- (n) < 1 ? ____ilog2_NaN() : \
+ (n) < 2 ? 0 : \
(n) & (1ULL << 63) ? 63 : \
(n) & (1ULL << 62) ? 62 : \
(n) & (1ULL << 61) ? 61 : \
@@ -148,10 +142,7 @@ unsigned long __rounddown_pow_of_two(unsigned long n)
(n) & (1ULL << 4) ? 4 : \
(n) & (1ULL << 3) ? 3 : \
(n) & (1ULL << 2) ? 2 : \
- (n) & (1ULL << 1) ? 1 : \
- (n) & (1ULL << 0) ? 0 : \
- ____ilog2_NaN() \
- ) : \
+ 1 ) : \
(sizeof(n) <= 4) ? \
__ilog2_u32(n) : \
__ilog2_u64(n) \
diff --git a/tools/include/linux/log2.h b/tools/include/linux/log2.h
index 4144666..d5677d3 100644
--- a/tools/include/linux/log2.h
+++ b/tools/include/linux/log2.h
@@ -13,12 +13,6 @@
#define _TOOLS_LINUX_LOG2_H

/*
- * deal with unrepresentable constant logarithms
- */
-extern __attribute__((const, noreturn))
-int ____ilog2_NaN(void);
-
-/*
* non-constant log of base 2 calculators
* - the arch may override these in asm/bitops.h if they can be implemented
* more efficiently than using fls() and fls64()
@@ -78,7 +72,7 @@ unsigned long __rounddown_pow_of_two(unsigned long n)
#define ilog2(n) \
( \
__builtin_constant_p(n) ? ( \
- (n) < 1 ? ____ilog2_NaN() : \
+ (n) < 2 ? 0 : \
(n) & (1ULL << 63) ? 63 : \
(n) & (1ULL << 62) ? 62 : \
(n) & (1ULL << 61) ? 61 : \
@@ -141,10 +135,7 @@ unsigned long __rounddown_pow_of_two(unsigned long n)
(n) & (1ULL << 4) ? 4 : \
(n) & (1ULL << 3) ? 3 : \
(n) & (1ULL << 2) ? 2 : \
- (n) & (1ULL << 1) ? 1 : \
- (n) & (1ULL << 0) ? 0 : \
- ____ilog2_NaN() \
- ) : \
+ 1 ) : \
(sizeof(n) <= 4) ? \
__ilog2_u32(n) : \
__ilog2_u64(n) \
Philip Müller
2017-05-29 17:34:31 UTC
Permalink
Post by s***@users.sourceforge.net
Hi,
Post by Philip Müller
ERROR: "____ilog2_NaN" [fs/aufs/aufs.ko] undefined!
make[1]: *** [scripts/Makefile.modpost:90: __modpost] Error 1
make: *** [Makefile:1106: modules] Error 2
Any clue what might create this issue?
It might be related to your compiler.
See this commit in mainline.
Before you add/apply this commit into your kernel source, I'd suggest
you to confirm that aufs doesn't call ilog2() by itself.
J. R. Okajima
commit 474c90156c8dcc2fa815e6716cc9394d7930cb9c
Date: Thu Mar 2 12:17:22 2017 -0800
Hi J. R.,

You're absolutely right. I tried gcc7. Thx for pointing me to that
patch. I was able to compile with gcc6 however just fine.

greez, Phil

Loading...