From: kbuild test robot <lkp@intel.com>
To: Daniel Jordan <daniel.m.jordan@oracle.com>
Cc: dave@stgolabs.net, jack@suse.cz, kvm@vger.kernel.org,
linux-mm@kvack.org, aik@ozlabs.ru, linux-fpga@vger.kernel.org,
atull@kernel.org, linux-kernel@vger.kernel.org,
kvm-ppc@vger.kernel.org, daniel.m.jordan@oracle.com,
jgg@ziepe.ca, alex.williamson@redhat.com, mdf@kernel.org,
kbuild-all@01.org, cl@linux.com, linuxppc-dev@lists.ozlabs.org,
akpm@linux-foundation.org, hao.wu@intel.com
Subject: Re: [PATCH 5/5] kvm/book3s: use pinned_vm instead of locked_vm to account pinned pages
Date: Wed, 13 Feb 2019 09:43:05 +0800 [thread overview]
Message-ID: <201902130942.blI6qjyh%fengguang.wu@intel.com> (raw)
In-Reply-To: <20190211224437.25267-6-daniel.m.jordan@oracle.com>
[-- Attachment #1: Type: text/plain, Size: 13126 bytes --]
Hi Daniel,
Thank you for the patch! Yet something to improve:
[auto build test ERROR on vfio/next]
[also build test ERROR on v5.0-rc4]
[cannot apply to next-20190212]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
url: https://github.com/0day-ci/linux/commits/Daniel-Jordan/use-pinned_vm-instead-of-locked_vm-to-account-pinned-pages/20190213-070458
base: https://github.com/awilliam/linux-vfio.git next
config: powerpc-defconfig (attached as .config)
compiler: powerpc64-linux-gnu-gcc (Debian 8.2.0-11) 8.2.0
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
GCC_VERSION=8.2.0 make.cross ARCH=powerpc
All errors (new ones prefixed by >>):
In file included from include/linux/llist.h:63,
from include/linux/smp.h:15,
from include/linux/percpu.h:7,
from include/linux/context_tracking_state.h:5,
from include/linux/vtime.h:5,
from include/linux/hardirq.h:8,
from include/linux/kvm_host.h:10,
from arch/powerpc/kvm/book3s_64_vio.c:23:
arch/powerpc/kvm/book3s_64_vio.c: In function 'kvmppc_account_memlimit':
>> arch/powerpc/kvm/book3s_64_vio.c:70:42: error: passing argument 2 of 'atomic64_add_return_relaxed' from incompatible pointer type [-Werror=incompatible-pointer-types]
pinned_vm = atomic64_add_return(pages, ¤t->mm->pinned_vm);
^~~~~~~~~~~~~~~~~~~~~~~
include/linux/atomic.h:75:22: note: in definition of macro '__atomic_op_fence'
typeof(op##_relaxed(args)) __ret; \
^~~~
arch/powerpc/kvm/book3s_64_vio.c:70:15: note: in expansion of macro 'atomic64_add_return'
pinned_vm = atomic64_add_return(pages, ¤t->mm->pinned_vm);
^~~~~~~~~~~~~~~~~~~
In file included from include/linux/atomic.h:7,
from include/linux/llist.h:63,
from include/linux/smp.h:15,
from include/linux/percpu.h:7,
from include/linux/context_tracking_state.h:5,
from include/linux/vtime.h:5,
from include/linux/hardirq.h:8,
from include/linux/kvm_host.h:10,
from arch/powerpc/kvm/book3s_64_vio.c:23:
arch/powerpc/include/asm/atomic.h:331:52: note: expected 'atomic64_t *' {aka 'struct <anonymous> *'} but argument is of type 'long unsigned int *'
atomic64_##op##_return_relaxed(long a, atomic64_t *v) \
~~~~~~~~~~~~^
arch/powerpc/include/asm/atomic.h:367:2: note: in expansion of macro 'ATOMIC64_OP_RETURN_RELAXED'
ATOMIC64_OP_RETURN_RELAXED(op, asm_op) \
^~~~~~~~~~~~~~~~~~~~~~~~~~
arch/powerpc/include/asm/atomic.h:370:1: note: in expansion of macro 'ATOMIC64_OPS'
ATOMIC64_OPS(add, add)
^~~~~~~~~~~~
In file included from include/linux/llist.h:63,
from include/linux/smp.h:15,
from include/linux/percpu.h:7,
from include/linux/context_tracking_state.h:5,
from include/linux/vtime.h:5,
from include/linux/hardirq.h:8,
from include/linux/kvm_host.h:10,
from arch/powerpc/kvm/book3s_64_vio.c:23:
>> arch/powerpc/kvm/book3s_64_vio.c:70:42: error: passing argument 2 of 'atomic64_add_return_relaxed' from incompatible pointer type [-Werror=incompatible-pointer-types]
pinned_vm = atomic64_add_return(pages, ¤t->mm->pinned_vm);
^~~~~~~~~~~~~~~~~~~~~~~
include/linux/atomic.h:77:23: note: in definition of macro '__atomic_op_fence'
__ret = op##_relaxed(args); \
^~~~
arch/powerpc/kvm/book3s_64_vio.c:70:15: note: in expansion of macro 'atomic64_add_return'
pinned_vm = atomic64_add_return(pages, ¤t->mm->pinned_vm);
^~~~~~~~~~~~~~~~~~~
In file included from include/linux/atomic.h:7,
from include/linux/llist.h:63,
from include/linux/smp.h:15,
from include/linux/percpu.h:7,
from include/linux/context_tracking_state.h:5,
from include/linux/vtime.h:5,
from include/linux/hardirq.h:8,
from include/linux/kvm_host.h:10,
from arch/powerpc/kvm/book3s_64_vio.c:23:
arch/powerpc/include/asm/atomic.h:331:52: note: expected 'atomic64_t *' {aka 'struct <anonymous> *'} but argument is of type 'long unsigned int *'
atomic64_##op##_return_relaxed(long a, atomic64_t *v) \
~~~~~~~~~~~~^
arch/powerpc/include/asm/atomic.h:367:2: note: in expansion of macro 'ATOMIC64_OP_RETURN_RELAXED'
ATOMIC64_OP_RETURN_RELAXED(op, asm_op) \
^~~~~~~~~~~~~~~~~~~~~~~~~~
arch/powerpc/include/asm/atomic.h:370:1: note: in expansion of macro 'ATOMIC64_OPS'
ATOMIC64_OPS(add, add)
^~~~~~~~~~~~
>> arch/powerpc/kvm/book3s_64_vio.c:73:24: error: passing argument 2 of 'atomic64_sub' from incompatible pointer type [-Werror=incompatible-pointer-types]
atomic64_sub(pages, ¤t->mm->pinned_vm);
^~~~~~~~~~~~~~~~~~~~~~~
In file included from include/linux/atomic.h:7,
from include/linux/llist.h:63,
from include/linux/smp.h:15,
from include/linux/percpu.h:7,
from include/linux/context_tracking_state.h:5,
from include/linux/vtime.h:5,
from include/linux/hardirq.h:8,
from include/linux/kvm_host.h:10,
from arch/powerpc/kvm/book3s_64_vio.c:23:
arch/powerpc/include/asm/atomic.h:315:58: note: expected 'atomic64_t *' {aka 'struct <anonymous> *'} but argument is of type 'long unsigned int *'
static __inline__ void atomic64_##op(long a, atomic64_t *v) \
~~~~~~~~~~~~^
arch/powerpc/include/asm/atomic.h:366:2: note: in expansion of macro 'ATOMIC64_OP'
ATOMIC64_OP(op, asm_op) \
^~~~~~~~~~~
arch/powerpc/include/asm/atomic.h:371:1: note: in expansion of macro 'ATOMIC64_OPS'
ATOMIC64_OPS(sub, subf)
^~~~~~~~~~~~
>> arch/powerpc/kvm/book3s_64_vio.c:76:29: error: passing argument 1 of 'atomic64_read' from incompatible pointer type [-Werror=incompatible-pointer-types]
pinned_vm = atomic64_read(¤t->mm->pinned_vm);
^~~~~~~~~~~~~~~~~~~~~~~
In file included from include/linux/atomic.h:7,
from include/linux/llist.h:63,
from include/linux/smp.h:15,
from include/linux/percpu.h:7,
from include/linux/context_tracking_state.h:5,
from include/linux/vtime.h:5,
from include/linux/hardirq.h:8,
from include/linux/kvm_host.h:10,
from arch/powerpc/kvm/book3s_64_vio.c:23:
arch/powerpc/include/asm/atomic.h:300:56: note: expected 'const atomic64_t *' {aka 'const struct <anonymous> *'} but argument is of type 'long unsigned int *'
static __inline__ long atomic64_read(const atomic64_t *v)
~~~~~~~~~~~~~~~~~~^
arch/powerpc/kvm/book3s_64_vio.c:80:23: error: passing argument 2 of 'atomic64_sub' from incompatible pointer type [-Werror=incompatible-pointer-types]
atomic64_sub(pages, ¤t->mm->pinned_vm);
^~~~~~~~~~~~~~~~~~~~~~~
In file included from include/linux/atomic.h:7,
from include/linux/llist.h:63,
from include/linux/smp.h:15,
from include/linux/percpu.h:7,
from include/linux/context_tracking_state.h:5,
from include/linux/vtime.h:5,
from include/linux/hardirq.h:8,
from include/linux/kvm_host.h:10,
from arch/powerpc/kvm/book3s_64_vio.c:23:
arch/powerpc/include/asm/atomic.h:315:58: note: expected 'atomic64_t *' {aka 'struct <anonymous> *'} but argument is of type 'long unsigned int *'
static __inline__ void atomic64_##op(long a, atomic64_t *v) \
~~~~~~~~~~~~^
arch/powerpc/include/asm/atomic.h:366:2: note: in expansion of macro 'ATOMIC64_OP'
ATOMIC64_OP(op, asm_op) \
^~~~~~~~~~~
arch/powerpc/include/asm/atomic.h:371:1: note: in expansion of macro 'ATOMIC64_OPS'
ATOMIC64_OPS(sub, subf)
^~~~~~~~~~~~
In file included from include/linux/kernel.h:14,
from include/linux/list.h:9,
from include/linux/preempt.h:11,
from include/linux/hardirq.h:5,
from include/linux/kvm_host.h:10,
from arch/powerpc/kvm/book3s_64_vio.c:23:
arch/powerpc/kvm/book3s_64_vio.c:85:18: error: passing argument 1 of 'atomic64_read' from incompatible pointer type [-Werror=incompatible-pointer-types]
atomic64_read(¤t->mm->pinned_vm) << PAGE_SHIFT,
^~~~~~~~~~~~~~~~~~~~~~~
include/linux/printk.h:136:17: note: in definition of macro 'no_printk'
printk(fmt, ##__VA_ARGS__); \
^~~~~~~~~~~
arch/powerpc/kvm/book3s_64_vio.c:83:2: note: in expansion of macro 'pr_debug'
pr_debug("[%d] RLIMIT_MEMLOCK KVM %c%lu %ld/%lu%s\n", current->pid,
^~~~~~~~
In file included from include/linux/atomic.h:7,
from include/linux/llist.h:63,
from include/linux/smp.h:15,
from include/linux/percpu.h:7,
from include/linux/context_tracking_state.h:5,
from include/linux/vtime.h:5,
from include/linux/hardirq.h:8,
from include/linux/kvm_host.h:10,
from arch/powerpc/kvm/book3s_64_vio.c:23:
arch/powerpc/include/asm/atomic.h:300:56: note: expected 'const atomic64_t *' {aka 'const struct <anonymous> *'} but argument is of type 'long unsigned int *'
static __inline__ long atomic64_read(const atomic64_t *v)
~~~~~~~~~~~~~~~~~~^
cc1: all warnings being treated as errors
vim +/atomic64_add_return_relaxed +70 arch/powerpc/kvm/book3s_64_vio.c
> 23 #include <linux/kvm_host.h>
24 #include <linux/highmem.h>
25 #include <linux/gfp.h>
26 #include <linux/slab.h>
27 #include <linux/sched/signal.h>
28 #include <linux/hugetlb.h>
29 #include <linux/list.h>
30 #include <linux/anon_inodes.h>
31 #include <linux/iommu.h>
32 #include <linux/file.h>
33
34 #include <asm/kvm_ppc.h>
35 #include <asm/kvm_book3s.h>
36 #include <asm/book3s/64/mmu-hash.h>
37 #include <asm/hvcall.h>
38 #include <asm/synch.h>
39 #include <asm/ppc-opcode.h>
40 #include <asm/kvm_host.h>
41 #include <asm/udbg.h>
42 #include <asm/iommu.h>
43 #include <asm/tce.h>
44 #include <asm/mmu_context.h>
45
46 static unsigned long kvmppc_tce_pages(unsigned long iommu_pages)
47 {
48 return ALIGN(iommu_pages * sizeof(u64), PAGE_SIZE) / PAGE_SIZE;
49 }
50
51 static unsigned long kvmppc_stt_pages(unsigned long tce_pages)
52 {
53 unsigned long stt_bytes = sizeof(struct kvmppc_spapr_tce_table) +
54 (tce_pages * sizeof(struct page *));
55
56 return tce_pages + ALIGN(stt_bytes, PAGE_SIZE) / PAGE_SIZE;
57 }
58
59 static long kvmppc_account_memlimit(unsigned long pages, bool inc)
60 {
61 long ret = 0;
62 s64 pinned_vm;
63
64 if (!current || !current->mm)
65 return ret; /* process exited */
66
67 if (inc) {
68 unsigned long lock_limit = rlimit(RLIMIT_MEMLOCK) >> PAGE_SHIFT;
69
> 70 pinned_vm = atomic64_add_return(pages, ¤t->mm->pinned_vm);
71 if (pinned_vm > lock_limit && !capable(CAP_IPC_LOCK)) {
72 ret = -ENOMEM;
> 73 atomic64_sub(pages, ¤t->mm->pinned_vm);
74 }
75 } else {
> 76 pinned_vm = atomic64_read(¤t->mm->pinned_vm);
77 if (WARN_ON_ONCE(pages > pinned_vm))
78 pages = pinned_vm;
79
80 atomic64_sub(pages, ¤t->mm->pinned_vm);
81 }
82
83 pr_debug("[%d] RLIMIT_MEMLOCK KVM %c%lu %ld/%lu%s\n", current->pid,
84 inc ? '+' : '-', pages << PAGE_SHIFT,
85 atomic64_read(¤t->mm->pinned_vm) << PAGE_SHIFT,
86 rlimit(RLIMIT_MEMLOCK), ret ? " - exceeded" : "");
87
88 return ret;
89 }
90
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 24035 bytes --]
next prev parent reply other threads:[~2019-02-13 1:46 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-02-11 22:44 [PATCH 0/5] use pinned_vm instead of locked_vm to account pinned pages Daniel Jordan
2019-02-11 22:44 ` [PATCH 1/5] vfio/type1: " Daniel Jordan
2019-02-11 22:56 ` Jason Gunthorpe
2019-02-11 23:11 ` Daniel Jordan
2019-02-12 18:41 ` Alex Williamson
2019-02-13 0:26 ` Daniel Jordan
2019-02-13 20:03 ` Alex Williamson
2019-02-13 23:07 ` Jason Gunthorpe
2019-02-14 1:46 ` Daniel Jordan
2019-02-11 22:44 ` [PATCH 2/5] vfio/spapr_tce: " Daniel Jordan
2019-02-12 6:56 ` Alexey Kardashevskiy
2019-02-12 16:50 ` Christopher Lameter
2019-02-12 17:18 ` Daniel Jordan
2019-02-13 0:37 ` Alexey Kardashevskiy
2019-02-12 18:56 ` Alex Williamson
2019-02-13 0:34 ` Alexey Kardashevskiy
2019-02-11 22:44 ` [PATCH 3/5] fpga/dlf/afu: " Daniel Jordan
2019-02-11 22:44 ` [PATCH 4/5] powerpc/mmu: " Daniel Jordan
2019-02-13 1:14 ` kbuild test robot
2019-02-11 22:44 ` [PATCH 5/5] kvm/book3s: " Daniel Jordan
2019-02-13 1:43 ` kbuild test robot [this message]
2019-02-11 22:54 ` [PATCH 0/5] " Jason Gunthorpe
2019-02-11 23:15 ` Daniel Jordan
2019-02-14 1:53 ` Ira Weiny
2019-02-14 6:00 ` Jason Gunthorpe
2019-02-14 19:33 ` Ira Weiny
2019-02-14 20:12 ` Jason Gunthorpe
2019-02-14 21:46 ` Ira Weiny
2019-02-14 22:16 ` Jason Gunthorpe
2019-02-15 15:26 ` Christopher Lameter
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=201902130942.blI6qjyh%fengguang.wu@intel.com \
--to=lkp@intel.com \
--cc=aik@ozlabs.ru \
--cc=akpm@linux-foundation.org \
--cc=alex.williamson@redhat.com \
--cc=atull@kernel.org \
--cc=cl@linux.com \
--cc=daniel.m.jordan@oracle.com \
--cc=dave@stgolabs.net \
--cc=hao.wu@intel.com \
--cc=jack@suse.cz \
--cc=jgg@ziepe.ca \
--cc=kbuild-all@01.org \
--cc=kvm-ppc@vger.kernel.org \
--cc=kvm@vger.kernel.org \
--cc=linux-fpga@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=mdf@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).