tree:
https://git.kernel.org/pub/scm/linux/kernel/git/tglx/devel.git preempt
head: bafee3053cbbb524a19b093add8bd30fbb266001
commit: bc510815d5cad14f492e9a0033134655360365d3 [5/13] mm/pagemap: Clenaup PREEMPT_COUNT
leftovers
config: arm-randconfig-r011-20200913 (attached as .config)
compiler: clang version 12.0.0 (
https://github.com/llvm/llvm-project
3ed89b51da38f081fedb57727076262abb81d149)
reproduce (this is a W=1 build):
wget
https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O
~/bin/make.cross
chmod +x ~/bin/make.cross
# install arm cross compiling tool for clang build
# apt-get install binutils-arm-linux-gnueabi
git checkout bc510815d5cad14f492e9a0033134655360365d3
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=arm
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All error/warnings (new ones prefixed by >>):
In file included from fs/direct-io.c:30:
> include/linux/pagemap.h:171:26: error: expected ';' after
do/while statement
VM_BUG_ON(preemptible())
^
;
1 error generated.
--
In file included from fs/aio.c:21:
In file included from include/linux/backing-dev.h:15:
In file included from include/linux/blkdev.h:13:
> include/linux/pagemap.h:171:26: error: expected ';' after
do/while statement
VM_BUG_ON(preemptible())
^
;
In file included from fs/aio.c:29:
include/linux/mman.h:138:9: warning: division by zero is undefined
[-Wdivision-by-zero]
_calc_vm_trans(flags, MAP_SYNC, VM_SYNC );
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/mman.h:115:21: note: expanded from macro '_calc_vm_trans'
: ((x) & (bit1)) / ((bit1) / (bit2))))
^ ~~~~~~~~~~~~~~~~~
1 warning and 1 error generated.
--
In file included from fs/io_uring.c:61:
In file included from include/linux/blkdev.h:13:
> include/linux/pagemap.h:171:26: error: expected ';' after
do/while statement
VM_BUG_ON(preemptible())
^
;
In file included from fs/io_uring.c:64:
In file included from include/net/sock.h:46:
In file included from include/linux/netdevice.h:37:
In file included from include/linux/ethtool.h:18:
In file included from include/uapi/linux/ethtool.h:19:
In file included from include/linux/if_ether.h:19:
In file included from include/linux/skbuff.h:31:
include/linux/dma-mapping.h:632:9: warning: implicit conversion from 'unsigned long
long' to 'unsigned long' changes value from 18446744073709551615 to 4294967295
[-Wconstant-conversion]
return DMA_BIT_MASK(32);
~~~~~~ ^~~~~~~~~~~~~~~~
include/linux/dma-mapping.h:139:40: note: expanded from macro 'DMA_BIT_MASK'
#define DMA_BIT_MASK(n) (((n) == 64) ? ~0ULL : ((1ULL<<(n))-1))
^~~~~
1 warning and 1 error generated.
--
In file included from fs/pipe.c:22:
> include/linux/pagemap.h:171:26: error: expected ';' after
do/while statement
VM_BUG_ON(preemptible())
^
;
fs/pipe.c:760:15: warning: no previous prototype for function
'account_pipe_buffers' [-Wmissing-prototypes]
unsigned long account_pipe_buffers(struct user_struct *user,
^
fs/pipe.c:760:1: note: declare 'static' if the function is not intended to be
used outside of this translation unit
unsigned long account_pipe_buffers(struct user_struct *user,
^
static
fs/pipe.c:766:6: warning: no previous prototype for function
'too_many_pipe_buffers_soft' [-Wmissing-prototypes]
bool too_many_pipe_buffers_soft(unsigned long user_bufs)
^
fs/pipe.c:766:1: note: declare 'static' if the function is not intended to be
used outside of this translation unit
bool too_many_pipe_buffers_soft(unsigned long user_bufs)
^
static
fs/pipe.c:773:6: warning: no previous prototype for function
'too_many_pipe_buffers_hard' [-Wmissing-prototypes]
bool too_many_pipe_buffers_hard(unsigned long user_bufs)
^
fs/pipe.c:773:1: note: declare 'static' if the function is not intended to be
used outside of this translation unit
bool too_many_pipe_buffers_hard(unsigned long user_bufs)
^
static
fs/pipe.c:780:6: warning: no previous prototype for function
'pipe_is_unprivileged_user' [-Wmissing-prototypes]
bool pipe_is_unprivileged_user(void)
^
fs/pipe.c:780:1: note: declare 'static' if the function is not intended to be
used outside of this translation unit
bool pipe_is_unprivileged_user(void)
^
static
fs/pipe.c:1211:5: warning: no previous prototype for function
'pipe_resize_ring' [-Wmissing-prototypes]
int pipe_resize_ring(struct pipe_inode_info *pipe, unsigned int nr_slots)
^
fs/pipe.c:1211:1: note: declare 'static' if the function is not intended to be
used outside of this translation unit
int pipe_resize_ring(struct pipe_inode_info *pipe, unsigned int nr_slots)
^
static
5 warnings and 1 error generated.
--
In file included from fs/proc/meminfo.c:12:
In file included from include/linux/swap.h:9:
In file included from include/linux/memcontrol.h:22:
In file included from include/linux/writeback.h:14:
In file included from include/linux/blk-cgroup.h:23:
In file included from include/linux/blkdev.h:13:
> include/linux/pagemap.h:171:26: error: expected ';' after
do/while statement
VM_BUG_ON(preemptible())
^
;
fs/proc/meminfo.c:22:28: warning: no previous prototype for function
'arch_report_meminfo' [-Wmissing-prototypes]
void __attribute__((weak)) arch_report_meminfo(struct seq_file *m)
^
fs/proc/meminfo.c:22:1: note: declare 'static' if the function is not intended
to be used outside of this translation unit
void __attribute__((weak)) arch_report_meminfo(struct seq_file *m)
^
static
1 warning and 1 error generated.
--
In file included from fs/kernfs/file.c:14:
> include/linux/pagemap.h:171:26: error: expected ';' after
do/while statement
VM_BUG_ON(preemptible())
^
;
fs/kernfs/file.c:127:15: warning: performing pointer arithmetic on a null pointer has
undefined behavior [-Wnull-pointer-arithmetic]
return NULL + !*ppos;
~~~~ ^
1 warning and 1 error generated.
--
In file included from fs/nfs/nfstrace.c:5:
In file included from include/linux/nfs_fs.h:24:
> include/linux/pagemap.h:171:26: error: expected ';' after
do/while statement
VM_BUG_ON(preemptible())
^
;
In file included from fs/nfs/nfstrace.c:5:
In file included from include/linux/nfs_fs.h:31:
In file included from include/linux/sunrpc/auth.h:14:
In file included from include/linux/sunrpc/msg_prot.h:202:
In file included from include/linux/inet.h:42:
In file included from include/net/net_namespace.h:39:
In file included from include/linux/skbuff.h:31:
include/linux/dma-mapping.h:632:9: warning: implicit conversion from 'unsigned long
long' to 'unsigned long' changes value from 18446744073709551615 to 4294967295
[-Wconstant-conversion]
return DMA_BIT_MASK(32);
~~~~~~ ^~~~~~~~~~~~~~~~
include/linux/dma-mapping.h:139:40: note: expanded from macro 'DMA_BIT_MASK'
#define DMA_BIT_MASK(n) (((n) == 64) ? ~0ULL : ((1ULL<<(n))-1))
^~~~~
In file included from fs/nfs/nfstrace.c:10:
In file included from fs/nfs/nfstrace.h:1444:
include/trace/define_trace.h:95:10: fatal error: './nfstrace.h' file not found
#include TRACE_INCLUDE(TRACE_INCLUDE_FILE)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/trace/define_trace.h:90:32: note: expanded from macro 'TRACE_INCLUDE'
# define TRACE_INCLUDE(system) __TRACE_INCLUDE(system)
^~~~~~~~~~~~~~~~~~~~~~~
include/trace/define_trace.h:87:34: note: expanded from macro
'__TRACE_INCLUDE'
# define __TRACE_INCLUDE(system) __stringify(TRACE_INCLUDE_PATH/system.h)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/stringify.h:10:27: note: expanded from macro '__stringify'
#define __stringify(x...) __stringify_1(x)
^~~~~~~~~~~~~~~~
include/linux/stringify.h:9:29: note: expanded from macro '__stringify_1'
#define __stringify_1(x...) #x
^~
<scratch space>:80:1: note: expanded from here
"./nfstrace.h"
^~~~~~~~~~~~~~
1 warning and 2 errors generated.
--
In file included from fs/nfs/nfs4trace.c:5:
In file included from include/linux/nfs_fs.h:24:
> include/linux/pagemap.h:171:26: error: expected ';' after
do/while statement
VM_BUG_ON(preemptible())
^
;
In file included from fs/nfs/nfs4trace.c:5:
In file included from include/linux/nfs_fs.h:31:
In file included from include/linux/sunrpc/auth.h:14:
In file included from include/linux/sunrpc/msg_prot.h:202:
In file included from include/linux/inet.h:42:
In file included from include/net/net_namespace.h:39:
In file included from include/linux/skbuff.h:31:
include/linux/dma-mapping.h:632:9: warning: implicit conversion from 'unsigned long
long' to 'unsigned long' changes value from 18446744073709551615 to 4294967295
[-Wconstant-conversion]
return DMA_BIT_MASK(32);
~~~~~~ ^~~~~~~~~~~~~~~~
include/linux/dma-mapping.h:139:40: note: expanded from macro 'DMA_BIT_MASK'
#define DMA_BIT_MASK(n) (((n) == 64) ? ~0ULL : ((1ULL<<(n))-1))
^~~~~
In file included from fs/nfs/nfs4trace.c:13:
In file included from fs/nfs/nfs4trace.h:2308:
include/trace/define_trace.h:95:10: fatal error: './nfs4trace.h' file not
found
#include TRACE_INCLUDE(TRACE_INCLUDE_FILE)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/trace/define_trace.h:90:32: note: expanded from macro 'TRACE_INCLUDE'
# define TRACE_INCLUDE(system) __TRACE_INCLUDE(system)
^~~~~~~~~~~~~~~~~~~~~~~
include/trace/define_trace.h:87:34: note: expanded from macro
'__TRACE_INCLUDE'
# define __TRACE_INCLUDE(system) __stringify(TRACE_INCLUDE_PATH/system.h)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/stringify.h:10:27: note: expanded from macro '__stringify'
#define __stringify(x...) __stringify_1(x)
^~~~~~~~~~~~~~~~
include/linux/stringify.h:9:29: note: expanded from macro '__stringify_1'
#define __stringify_1(x...) #x
^~
<scratch space>:9:1: note: expanded from here
"./nfs4trace.h"
^~~~~~~~~~~~~~~
1 warning and 2 errors generated.
--
In file included from fs/gfs2/glock.c:12:
In file included from include/linux/buffer_head.h:14:
> include/linux/pagemap.h:171:26: error: expected ';' after
do/while statement
VM_BUG_ON(preemptible())
^
;
In file included from fs/gfs2/glock.c:49:
In file included from fs/gfs2/trace_gfs2.h:632:
include/trace/define_trace.h:95:10: fatal error: './trace_gfs2.h' file not
found
#include TRACE_INCLUDE(TRACE_INCLUDE_FILE)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/trace/define_trace.h:90:32: note: expanded from macro 'TRACE_INCLUDE'
# define TRACE_INCLUDE(system) __TRACE_INCLUDE(system)
^~~~~~~~~~~~~~~~~~~~~~~
include/trace/define_trace.h:87:34: note: expanded from macro
'__TRACE_INCLUDE'
# define __TRACE_INCLUDE(system) __stringify(TRACE_INCLUDE_PATH/system.h)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/stringify.h:10:27: note: expanded from macro '__stringify'
#define __stringify(x...) __stringify_1(x)
^~~~~~~~~~~~~~~~
include/linux/stringify.h:9:29: note: expanded from macro '__stringify_1'
#define __stringify_1(x...) #x
^~
<scratch space>:14:1: note: expanded from here
"./trace_gfs2.h"
^~~~~~~~~~~~~~~~
2 errors generated.
--
In file included from drivers/usb/host/ehci-platform.c:37:
In file included from include/linux/usb/of.h:12:
In file included from include/linux/usb/otg.h:13:
In file included from include/linux/phy/phy.h:17:
In file included from include/linux/regulator/consumer.h:35:
In file included from include/linux/suspend.h:5:
In file included from include/linux/swap.h:9:
In file included from include/linux/memcontrol.h:22:
In file included from include/linux/writeback.h:14:
In file included from include/linux/blk-cgroup.h:23:
In file included from include/linux/blkdev.h:13:
> include/linux/pagemap.h:171:26: error: expected ';' after
do/while statement
VM_BUG_ON(preemptible())
^
;
drivers/usb/host/ehci-platform.c:251:24: warning: shift count >= width of type
[-Wshift-count-overflow]
pdata->dma_mask_64 ? DMA_BIT_MASK(64) : DMA_BIT_MASK(32));
^~~~~~~~~~~~~~~~
include/linux/dma-mapping.h:139:54: note: expanded from macro 'DMA_BIT_MASK'
#define DMA_BIT_MASK(n) (((n) == 64) ? ~0ULL : ((1ULL<<(n))-1))
^ ~~~
1 warning and 1 error generated.
--
In file included from drivers/usb/host/xhci-plat.c:21:
In file included from include/linux/usb/of.h:12:
In file included from include/linux/usb/otg.h:13:
In file included from include/linux/phy/phy.h:17:
In file included from include/linux/regulator/consumer.h:35:
In file included from include/linux/suspend.h:5:
In file included from include/linux/swap.h:9:
In file included from include/linux/memcontrol.h:22:
In file included from include/linux/writeback.h:14:
In file included from include/linux/blk-cgroup.h:23:
In file included from include/linux/blkdev.h:13:
> include/linux/pagemap.h:171:26: error: expected ';' after
do/while statement
VM_BUG_ON(preemptible())
^
;
> drivers/usb/host/xhci-plat.c:210:10: warning: shift count >=
width of type [-Wshift-count-overflow]
DMA_BIT_MASK(64));
^~~~~~~~~~~~~~~~
include/linux/dma-mapping.h:139:54: note: expanded from macro 'DMA_BIT_MASK'
#define DMA_BIT_MASK(n) (((n) == 64) ? ~0ULL : ((1ULL<<(n))-1))
^ ~~~
drivers/usb/host/xhci-plat.c:212:43: warning: shift count >= width of type
[-Wshift-count-overflow]
ret = dma_set_mask_and_coherent(sysdev, DMA_BIT_MASK(64));
^~~~~~~~~~~~~~~~
include/linux/dma-mapping.h:139:54: note: expanded from macro 'DMA_BIT_MASK'
#define DMA_BIT_MASK(n) (((n) == 64) ? ~0ULL : ((1ULL<<(n))-1))
^ ~~~
2 warnings and 1 error generated.
..
#
https://git.kernel.org/pub/scm/linux/kernel/git/tglx/devel.git/commit/?id...
git remote add tglx-devel
https://git.kernel.org/pub/scm/linux/kernel/git/tglx/devel.git
git fetch --no-tags tglx-devel preempt
git checkout bc510815d5cad14f492e9a0033134655360365d3
vim +171 include/linux/pagemap.h
123
124 /*
125 * speculatively take a reference to a page.
126 * If the page is free (_refcount == 0), then _refcount is untouched, and 0
127 * is returned. Otherwise, _refcount is incremented by 1 and 1 is returned.
128 *
129 * This function must be called inside the same rcu_read_lock() section as has
130 * been used to lookup the page in the pagecache radix-tree (or page table):
131 * this allows allocators to use a synchronize_rcu() to stabilize _refcount.
132 *
133 * Unless an RCU grace period has passed, the count of all pages coming out
134 * of the allocator must be considered unstable. page_count may return higher
135 * than expected, and put_page must be able to do the right thing when the
136 * page has been finished with, no matter what it is subsequently allocated
137 * for (because put_page is what is used here to drop an invalid speculative
138 * reference).
139 *
140 * This is the interesting part of the lockless pagecache (and lockless
141 * get_user_pages) locking protocol, where the lookup-side (eg. find_get_page)
142 * has the following pattern:
143 * 1. find page in radix tree
144 * 2. conditionally increment refcount
145 * 3. check the page is still in pagecache (if no, goto 1)
146 *
147 * Remove-side that cares about stability of _refcount (eg. reclaim) has the
148 * following (with the i_pages lock held):
149 * A. atomically check refcount is correct and set it to 0 (atomic_cmpxchg)
150 * B. remove page from pagecache
151 * C. free the page
152 *
153 * There are 2 critical interleavings that matter:
154 * - 2 runs before A: in this case, A sees elevated refcount and bails out
155 * - A runs before 2: in this case, 2 sees zero refcount and retries;
156 * subsequently, B will complete and 1 will find no page, causing the
157 * lookup to return NULL.
158 *
159 * It is possible that between 1 and 2, the page is removed then the exact same
160 * page is inserted into the same position in pagecache. That's OK: the
161 * old find_get_page using a lock could equally have run before or after
162 * such a re-insertion, depending on order that locks are granted.
163 *
164 * Lookups racing against pagecache insertion isn't a big problem: either 1
165 * will find the page or it will not. Likewise, the old find_get_page could run
166 * either before the insertion or afterwards, depending on timing.
167 */
168 static inline int __page_cache_add_speculative(struct page *page, int count)
169 {
170 #ifdef CONFIG_TINY_RCU
171 VM_BUG_ON(preemptible())
172 /*
173 * Preempt must be disabled here - we rely on rcu_read_lock doing
174 * this for us.
175 *
176 * Pagecache won't be truncated from interrupt context, so if we have
177 * found a page in the radix tree here, we have pinned its refcount by
178 * disabling preempt, and hence no need for the "speculative get" that
179 * SMP requires.
180 */
181 VM_BUG_ON_PAGE(page_count(page) == 0, page);
182 page_ref_add(page, count);
183
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org