XArray for 5.8
The following changes since commit 4fa640dc52302b5e62b01b05c755b055549633ae:
Merge tag 'vfio-v5.8-rc7' of git://github.com/awilliam/linux-vfio into master (2020-07-20 13:30:59 -0700)
are available in the Git repository at:
git://git.infradead.org/users/willy/xarray.git tags/xarray-5.8
for you to fetch changes up to f177a7956685320eef43d248d39f61a74290f031:
XArray: Test multiorder marked iteration (2020-07-22 09:58:48 -0400)
----------------------------------------------------------------
XArray updates for 5.8
- Fix the test suite after introduction of the local_lock
- Fix a bug in the IDA spotted by Coverity
- Add a few more tests to the test suite
----------------------------------------------------------------
Matthew Wilcox (Oracle) (4):
radix tree test suite: Fix compilation
ida: Free allocated bitmap in error path
XArray: Test two more things about xa_cmpxchg
XArray: Test multiorder marked iteration
include/linux/radix-tree.h | 3 ++- lib/idr.c | 1 + lib/radix-tree.c | 1 - lib/test_xarray.c | 25 +++++++++++++++++++++++++ tools/testing/radix-tree/idr-test.c | 29 +++++++++++++++++++++++++++++ tools/testing/radix-tree/linux/kernel.h | 1 + tools/testing/radix-tree/linux/local_lock.h | 8 ++++++++ tools/testing/radix-tree/test.h | 4 ---- 8 files changed, 66 insertions(+), 6 deletions(-) create mode 100644 tools/testing/radix-tree/linux/local_lock.h
Quoted 4 lines · Matthew Wilcox
XArray updates for 5.8
- Fix the test suite after introduction of the
local_lock
What? No.
Now you broke the actual kernel build:
In file included from ./include/linux/local_lock.h:5,
from ./include/linux/radix-tree.h:14,
from ./include/linux/idr.h:15,
from lib/idr.c:5:
./include/linux/local_lock_internal.h: In function ‘local_lock_acquire’:
./include/linux/local_lock_internal.h:41:13: error: ‘current’
undeclared (first use in this function)
41 | l->owner = current;
| ^~~~~~~ ./include/linux/local_lock_internal.h:41:13: note: each undeclared
identifier is reported only once for each function it appears in
How the hell did you not see this, and why did you think it was a good idea to mess with kernel headers and make them alphabetically ordered?
Headers need to be ordered by _contents_, not by some "sort alphabetically".
Do you sort your bookcases by color and size of the book too?
Linus
Quoted 19 lines · Linus Torvalds
Quoted 4 lines · Matthew Wilcox
XArray updates for 5.8
- Fix the test suite after introduction of the
local_lockWhat? No.
Now you broke the actual kernel build:
In file included from
./include/linux/local_lock.h:5,from ./include/linux/radix-tree.h:14, from ./include/linux/idr.h:15, from lib/idr.c:5: ./include/linux/local_lock_internal.h: In function ‘local_lock_acquire’: ./include/linux/local_lock_internal.h:41:13: error: ‘current’ undeclared (first use in this function) 41 | l->owner = current; | ^~~~~~~
Quoted 5 lines
./include/linux/local_lock_internal.h:41:13: note: each undeclared
identifier is reported only once for each function it appears inHow the hell did you not see this, and why did you think it was a good idea to mess with kernel headers and make them alphabetically ordered?
Ah, crap. I was building without CONFIG_DEBUG_LOCK_ALLOC, so I didn't see this.
But I think the real problem is that local_lock_internal.h doesn't include <linux/sched.h>. Header files shouldn't depend on other headers to be included first.
Quoted 3 lines
Headers need to be ordered by _contents_, not by some "sort alphabetically".
Do you sort your bookcases by color and size of the book too?
By author, typically ;-)
Quoted 4 lines · Matthew Wilcox
But I think the real problem is that
local_lock_internal.hdoesn't include <linux/sched.h>. Header files shouldn't depend on other headers to be included first.
The big hint is that name: "internal".
Also, we often violate the "shouldn't depend on other headers" rule. Some basic headers are just that - basic. And some headers are not.
Things like the uapi headers need to be independent, but we've had circular ordering problems with kernel headers, and sometimes it's just better to say "you need to just get the basic header first".
Linus