* [rcu:dev.2019.03.20b 54/83] drivers/gpu/drm/amd/amdgpu/../amdkfd/kfd_process.c:50:1: error: type defaults to 'int' in declaration of 'DEFINE_SRCU'
@ 2019-03-24 18:34 kbuild test robot
2019-03-27 19:57 ` Paul E. McKenney
0 siblings, 1 reply; 6+ messages in thread
From: kbuild test robot @ 2019-03-24 18:34 UTC (permalink / raw)
To: Paul E. McKenney; +Cc: kbuild-all, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 1669 bytes --]
tree: https://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu.git dev.2019.03.20b
head: 6d4434b4b4df791620743178e1419de882b44c7b
commit: eb89abcb30733e3a2343dda23cb6d81cc17c60b3 [54/83] rcu: Forbid DEFINE{,_STATIC}_SRCU() from modules
config: x86_64-randconfig-b0-03250021 (attached as .config)
compiler: gcc-7 (Debian 7.3.0-1) 7.3.0
reproduce:
git checkout eb89abcb30733e3a2343dda23cb6d81cc17c60b3
# save the attached .config to linux build tree
make ARCH=x86_64
All errors (new ones prefixed by >>):
drivers/gpu/drm/amd/amdgpu/../amdkfd/kfd_process.c:50:1: warning: data definition has no type or storage class
DEFINE_SRCU(kfd_processes_srcu);
^~~~~~~~~~~
>> drivers/gpu/drm/amd/amdgpu/../amdkfd/kfd_process.c:50:1: error: type defaults to 'int' in declaration of 'DEFINE_SRCU' [-Werror=implicit-int]
drivers/gpu/drm/amd/amdgpu/../amdkfd/kfd_process.c:50:1: warning: parameter names (without types) in function declaration
cc1: some warnings being treated as errors
vim +50 drivers/gpu/drm/amd/amdgpu/../amdkfd/kfd_process.c
19f6d2a6 Oded Gabbay 2014-07-16 49
64d1c3a4 Felix Kuehling 2017-12-08 @50 DEFINE_SRCU(kfd_processes_srcu);
19f6d2a6 Oded Gabbay 2014-07-16 51
:::::: The code at line 50 was first introduced by commit
:::::: 64d1c3a43a6fb5cef32a085bc17cbbe31945a651 drm/amdkfd: Centralize IOMMUv2 code and make it conditional
:::::: TO: Felix Kuehling <Felix.Kuehling@amd.com>
:::::: CC: Oded Gabbay <oded.gabbay@gmail.com>
---
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: 25237 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: [rcu:dev.2019.03.20b 54/83] drivers/gpu/drm/amd/amdgpu/../amdkfd/kfd_process.c:50:1: error: type defaults to 'int' in declaration of 'DEFINE_SRCU' 2019-03-24 18:34 [rcu:dev.2019.03.20b 54/83] drivers/gpu/drm/amd/amdgpu/../amdkfd/kfd_process.c:50:1: error: type defaults to 'int' in declaration of 'DEFINE_SRCU' kbuild test robot @ 2019-03-27 19:57 ` Paul E. McKenney 2019-04-02 0:32 ` Rong Chen 0 siblings, 1 reply; 6+ messages in thread From: Paul E. McKenney @ 2019-03-27 19:57 UTC (permalink / raw) To: kbuild test robot; +Cc: kbuild-all, linux-kernel On Mon, Mar 25, 2019 at 02:34:27AM +0800, kbuild test robot wrote: > tree: https://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu.git dev.2019.03.20b > head: 6d4434b4b4df791620743178e1419de882b44c7b > commit: eb89abcb30733e3a2343dda23cb6d81cc17c60b3 [54/83] rcu: Forbid DEFINE{,_STATIC}_SRCU() from modules > config: x86_64-randconfig-b0-03250021 (attached as .config) > compiler: gcc-7 (Debian 7.3.0-1) 7.3.0 > reproduce: > git checkout eb89abcb30733e3a2343dda23cb6d81cc17c60b3 > # save the attached .config to linux build tree > make ARCH=x86_64 > > All errors (new ones prefixed by >>): > > drivers/gpu/drm/amd/amdgpu/../amdkfd/kfd_process.c:50:1: warning: data definition has no type or storage class > DEFINE_SRCU(kfd_processes_srcu); > ^~~~~~~~~~~ > >> drivers/gpu/drm/amd/amdgpu/../amdkfd/kfd_process.c:50:1: error: type defaults to 'int' in declaration of 'DEFINE_SRCU' [-Werror=implicit-int] > drivers/gpu/drm/amd/amdgpu/../amdkfd/kfd_process.c:50:1: warning: parameter names (without types) in function declaration > cc1: some warnings being treated as errors I don't have that hardware, but does the following help? (It at least builds for me, but your mileage may vary.) Thanx, Paul ------------------------------------------------------------------------ commit b30be5a76070402912437fa23b43de11cb1973f4 Author: Paul E. McKenney <paulmck@linux.ibm.com> Date: Wed Mar 27 12:53:36 2019 -0700 drivers/gpu/drm/amd: Dynamically allocate kfd_processes_srcu Having DEFINE_SRCU() or DEFINE_STATIC_SRCU() in a loadable module requires that the size of the reserved region be increased, which is not something we really want to be doing. This commit therefore removes the DEFINE_STATIC_SRCU() from drivers/gpu/drm/amd/amdkfd/kfd_process.c in favor of defining kfd_processes_srcu as a simple srcu_struct, initializing it in amdgpu_amdkfd_init(), and cleaning it up in amdgpu_amdkfd_fini(). Reported-by: kbuild test robot <lkp@intel.com> Signed-off-by: Paul E. McKenney <paulmck@linux.ibm.com> Cc: Oded Gabbay <oded.gabbay@gmail.com> Cc: Alex Deucher <alexander.deucher@amd.com> Cc: "Christian König" <christian.koenig@amd.com Cc: "David (ChunMing) Zhou" <David1.Zhou@amd.com> Cc: David Airlie <airlied@linux.ie> Cc: Daniel Vetter <daniel@ffwll.ch> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c index fe1d7368c1e6..eadb20dee867 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c @@ -28,6 +28,8 @@ #include <linux/module.h> #include <linux/dma-buf.h> +extern struct srcu_struct kfd_processes_srcu; + static const unsigned int compute_vmid_bitmap = 0xFF00; /* Total memory size in system memory and all GPU VRAM. Used to @@ -40,6 +42,8 @@ int amdgpu_amdkfd_init(void) struct sysinfo si; int ret; + ret = init_srcu_struct(&kfd_processes_srcu); + WARN_ON(ret); si_meminfo(&si); amdgpu_amdkfd_total_mem_size = si.totalram - si.totalhigh; amdgpu_amdkfd_total_mem_size *= si.mem_unit; @@ -57,6 +61,7 @@ int amdgpu_amdkfd_init(void) void amdgpu_amdkfd_fini(void) { kgd2kfd_exit(); + cleanup_srcu_struct(&kfd_processes_srcu); } void amdgpu_amdkfd_device_probe(struct amdgpu_device *adev) diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_process.c b/drivers/gpu/drm/amd/amdkfd/kfd_process.c index 4bdae78bab8e..98b694068b8a 100644 --- a/drivers/gpu/drm/amd/amdkfd/kfd_process.c +++ b/drivers/gpu/drm/amd/amdkfd/kfd_process.c @@ -47,7 +47,7 @@ struct mm_struct; DEFINE_HASHTABLE(kfd_processes_table, KFD_PROCESS_TABLE_SIZE); static DEFINE_MUTEX(kfd_processes_mutex); -DEFINE_SRCU(kfd_processes_srcu); +struct srcu_struct kfd_processes_srcu; /* For process termination handling */ static struct workqueue_struct *kfd_process_wq; ^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [rcu:dev.2019.03.20b 54/83] drivers/gpu/drm/amd/amdgpu/../amdkfd/kfd_process.c:50:1: error: type defaults to 'int' in declaration of 'DEFINE_SRCU' 2019-03-27 19:57 ` Paul E. McKenney @ 2019-04-02 0:32 ` Rong Chen 2019-04-02 13:04 ` Paul E. McKenney 0 siblings, 1 reply; 6+ messages in thread From: Rong Chen @ 2019-04-02 0:32 UTC (permalink / raw) To: paulmck, kbuild test robot; +Cc: kbuild-all, linux-kernel On 3/28/19 3:57 AM, Paul E. McKenney wrote: > On Mon, Mar 25, 2019 at 02:34:27AM +0800, kbuild test robot wrote: >> tree: https://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu.git dev.2019.03.20b >> head: 6d4434b4b4df791620743178e1419de882b44c7b >> commit: eb89abcb30733e3a2343dda23cb6d81cc17c60b3 [54/83] rcu: Forbid DEFINE{,_STATIC}_SRCU() from modules >> config: x86_64-randconfig-b0-03250021 (attached as .config) >> compiler: gcc-7 (Debian 7.3.0-1) 7.3.0 >> reproduce: >> git checkout eb89abcb30733e3a2343dda23cb6d81cc17c60b3 >> # save the attached .config to linux build tree >> make ARCH=x86_64 >> >> All errors (new ones prefixed by >>): >> >> drivers/gpu/drm/amd/amdgpu/../amdkfd/kfd_process.c:50:1: warning: data definition has no type or storage class >> DEFINE_SRCU(kfd_processes_srcu); >> ^~~~~~~~~~~ >>>> drivers/gpu/drm/amd/amdgpu/../amdkfd/kfd_process.c:50:1: error: type defaults to 'int' in declaration of 'DEFINE_SRCU' [-Werror=implicit-int] >> drivers/gpu/drm/amd/amdgpu/../amdkfd/kfd_process.c:50:1: warning: parameter names (without types) in function declaration >> cc1: some warnings being treated as errors > I don't have that hardware, but does the following help? (It at least > builds for me, but your mileage may vary.) > > Thanx, Paul Yes, the patch works for kbuild robot. Thanks, Rong Chen > > ------------------------------------------------------------------------ > > commit b30be5a76070402912437fa23b43de11cb1973f4 > Author: Paul E. McKenney <paulmck@linux.ibm.com> > Date: Wed Mar 27 12:53:36 2019 -0700 > > drivers/gpu/drm/amd: Dynamically allocate kfd_processes_srcu > > Having DEFINE_SRCU() or DEFINE_STATIC_SRCU() in a loadable module > requires that the size of the reserved region be increased, which is > not something we really want to be doing. This commit therefore removes > the DEFINE_STATIC_SRCU() from drivers/gpu/drm/amd/amdkfd/kfd_process.c in > favor of defining kfd_processes_srcu as a simple srcu_struct, initializing > it in amdgpu_amdkfd_init(), and cleaning it up in amdgpu_amdkfd_fini(). > > Reported-by: kbuild test robot <lkp@intel.com> > Signed-off-by: Paul E. McKenney <paulmck@linux.ibm.com> > Cc: Oded Gabbay <oded.gabbay@gmail.com> > Cc: Alex Deucher <alexander.deucher@amd.com> > Cc: "Christian König" <christian.koenig@amd.com > Cc: "David (ChunMing) Zhou" <David1.Zhou@amd.com> > Cc: David Airlie <airlied@linux.ie> > Cc: Daniel Vetter <daniel@ffwll.ch> > > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c > index fe1d7368c1e6..eadb20dee867 100644 > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c > @@ -28,6 +28,8 @@ > #include <linux/module.h> > #include <linux/dma-buf.h> > > +extern struct srcu_struct kfd_processes_srcu; > + > static const unsigned int compute_vmid_bitmap = 0xFF00; > > /* Total memory size in system memory and all GPU VRAM. Used to > @@ -40,6 +42,8 @@ int amdgpu_amdkfd_init(void) > struct sysinfo si; > int ret; > > + ret = init_srcu_struct(&kfd_processes_srcu); > + WARN_ON(ret); > si_meminfo(&si); > amdgpu_amdkfd_total_mem_size = si.totalram - si.totalhigh; > amdgpu_amdkfd_total_mem_size *= si.mem_unit; > @@ -57,6 +61,7 @@ int amdgpu_amdkfd_init(void) > void amdgpu_amdkfd_fini(void) > { > kgd2kfd_exit(); > + cleanup_srcu_struct(&kfd_processes_srcu); > } > > void amdgpu_amdkfd_device_probe(struct amdgpu_device *adev) > diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_process.c b/drivers/gpu/drm/amd/amdkfd/kfd_process.c > index 4bdae78bab8e..98b694068b8a 100644 > --- a/drivers/gpu/drm/amd/amdkfd/kfd_process.c > +++ b/drivers/gpu/drm/amd/amdkfd/kfd_process.c > @@ -47,7 +47,7 @@ struct mm_struct; > DEFINE_HASHTABLE(kfd_processes_table, KFD_PROCESS_TABLE_SIZE); > static DEFINE_MUTEX(kfd_processes_mutex); > > -DEFINE_SRCU(kfd_processes_srcu); > +struct srcu_struct kfd_processes_srcu; > > /* For process termination handling */ > static struct workqueue_struct *kfd_process_wq; > ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [rcu:dev.2019.03.20b 54/83] drivers/gpu/drm/amd/amdgpu/../amdkfd/kfd_process.c:50:1: error: type defaults to 'int' in declaration of 'DEFINE_SRCU' 2019-04-02 0:32 ` Rong Chen @ 2019-04-02 13:04 ` Paul E. McKenney 2019-04-02 13:50 ` Rong Chen 0 siblings, 1 reply; 6+ messages in thread From: Paul E. McKenney @ 2019-04-02 13:04 UTC (permalink / raw) To: Rong Chen; +Cc: kbuild test robot, kbuild-all, linux-kernel On Tue, Apr 02, 2019 at 08:32:45AM +0800, Rong Chen wrote: > > On 3/28/19 3:57 AM, Paul E. McKenney wrote: > >On Mon, Mar 25, 2019 at 02:34:27AM +0800, kbuild test robot wrote: > >>tree: https://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu.git dev.2019.03.20b > >>head: 6d4434b4b4df791620743178e1419de882b44c7b > >>commit: eb89abcb30733e3a2343dda23cb6d81cc17c60b3 [54/83] rcu: Forbid DEFINE{,_STATIC}_SRCU() from modules > >>config: x86_64-randconfig-b0-03250021 (attached as .config) > >>compiler: gcc-7 (Debian 7.3.0-1) 7.3.0 > >>reproduce: > >> git checkout eb89abcb30733e3a2343dda23cb6d81cc17c60b3 > >> # save the attached .config to linux build tree > >> make ARCH=x86_64 > >> > >>All errors (new ones prefixed by >>): > >> > >> drivers/gpu/drm/amd/amdgpu/../amdkfd/kfd_process.c:50:1: warning: data definition has no type or storage class > >> DEFINE_SRCU(kfd_processes_srcu); > >> ^~~~~~~~~~~ > >>>>drivers/gpu/drm/amd/amdgpu/../amdkfd/kfd_process.c:50:1: error: type defaults to 'int' in declaration of 'DEFINE_SRCU' [-Werror=implicit-int] > >> drivers/gpu/drm/amd/amdgpu/../amdkfd/kfd_process.c:50:1: warning: parameter names (without types) in function declaration > >> cc1: some warnings being treated as errors > >I don't have that hardware, but does the following help? (It at least > >builds for me, but your mileage may vary.) > > Yes, the patch works for kbuild robot. Thank you very much! May I add your Tested-by? Thanx, Paul > Thanks, > Rong Chen > > > > > >------------------------------------------------------------------------ > > > >commit b30be5a76070402912437fa23b43de11cb1973f4 > >Author: Paul E. McKenney <paulmck@linux.ibm.com> > >Date: Wed Mar 27 12:53:36 2019 -0700 > > > > drivers/gpu/drm/amd: Dynamically allocate kfd_processes_srcu > > Having DEFINE_SRCU() or DEFINE_STATIC_SRCU() in a loadable module > > requires that the size of the reserved region be increased, which is > > not something we really want to be doing. This commit therefore removes > > the DEFINE_STATIC_SRCU() from drivers/gpu/drm/amd/amdkfd/kfd_process.c in > > favor of defining kfd_processes_srcu as a simple srcu_struct, initializing > > it in amdgpu_amdkfd_init(), and cleaning it up in amdgpu_amdkfd_fini(). > > Reported-by: kbuild test robot <lkp@intel.com> > > Signed-off-by: Paul E. McKenney <paulmck@linux.ibm.com> > > Cc: Oded Gabbay <oded.gabbay@gmail.com> > > Cc: Alex Deucher <alexander.deucher@amd.com> > > Cc: "Christian König" <christian.koenig@amd.com > > Cc: "David (ChunMing) Zhou" <David1.Zhou@amd.com> > > Cc: David Airlie <airlied@linux.ie> > > Cc: Daniel Vetter <daniel@ffwll.ch> > > > >diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c > >index fe1d7368c1e6..eadb20dee867 100644 > >--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c > >+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c > >@@ -28,6 +28,8 @@ > > #include <linux/module.h> > > #include <linux/dma-buf.h> > >+extern struct srcu_struct kfd_processes_srcu; > >+ > > static const unsigned int compute_vmid_bitmap = 0xFF00; > > /* Total memory size in system memory and all GPU VRAM. Used to > >@@ -40,6 +42,8 @@ int amdgpu_amdkfd_init(void) > > struct sysinfo si; > > int ret; > >+ ret = init_srcu_struct(&kfd_processes_srcu); > >+ WARN_ON(ret); > > si_meminfo(&si); > > amdgpu_amdkfd_total_mem_size = si.totalram - si.totalhigh; > > amdgpu_amdkfd_total_mem_size *= si.mem_unit; > >@@ -57,6 +61,7 @@ int amdgpu_amdkfd_init(void) > > void amdgpu_amdkfd_fini(void) > > { > > kgd2kfd_exit(); > >+ cleanup_srcu_struct(&kfd_processes_srcu); > > } > > void amdgpu_amdkfd_device_probe(struct amdgpu_device *adev) > >diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_process.c b/drivers/gpu/drm/amd/amdkfd/kfd_process.c > >index 4bdae78bab8e..98b694068b8a 100644 > >--- a/drivers/gpu/drm/amd/amdkfd/kfd_process.c > >+++ b/drivers/gpu/drm/amd/amdkfd/kfd_process.c > >@@ -47,7 +47,7 @@ struct mm_struct; > > DEFINE_HASHTABLE(kfd_processes_table, KFD_PROCESS_TABLE_SIZE); > > static DEFINE_MUTEX(kfd_processes_mutex); > >-DEFINE_SRCU(kfd_processes_srcu); > >+struct srcu_struct kfd_processes_srcu; > > /* For process termination handling */ > > static struct workqueue_struct *kfd_process_wq; > > > ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [rcu:dev.2019.03.20b 54/83] drivers/gpu/drm/amd/amdgpu/../amdkfd/kfd_process.c:50:1: error: type defaults to 'int' in declaration of 'DEFINE_SRCU' 2019-04-02 13:04 ` Paul E. McKenney @ 2019-04-02 13:50 ` Rong Chen 2019-04-02 14:16 ` Paul E. McKenney 0 siblings, 1 reply; 6+ messages in thread From: Rong Chen @ 2019-04-02 13:50 UTC (permalink / raw) To: Paul E. McKenney; +Cc: kbuild test robot, kbuild-all, linux-kernel On Tue, Apr 02, 2019 at 06:04:24AM -0700, Paul E. McKenney wrote: > On Tue, Apr 02, 2019 at 08:32:45AM +0800, Rong Chen wrote: > > > > On 3/28/19 3:57 AM, Paul E. McKenney wrote: > > >On Mon, Mar 25, 2019 at 02:34:27AM +0800, kbuild test robot wrote: > > >>tree: https://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu.git dev.2019.03.20b > > >>head: 6d4434b4b4df791620743178e1419de882b44c7b > > >>commit: eb89abcb30733e3a2343dda23cb6d81cc17c60b3 [54/83] rcu: Forbid DEFINE{,_STATIC}_SRCU() from modules > > >>config: x86_64-randconfig-b0-03250021 (attached as .config) > > >>compiler: gcc-7 (Debian 7.3.0-1) 7.3.0 > > >>reproduce: > > >> git checkout eb89abcb30733e3a2343dda23cb6d81cc17c60b3 > > >> # save the attached .config to linux build tree > > >> make ARCH=x86_64 > > >> > > >>All errors (new ones prefixed by >>): > > >> > > >> drivers/gpu/drm/amd/amdgpu/../amdkfd/kfd_process.c:50:1: warning: data definition has no type or storage class > > >> DEFINE_SRCU(kfd_processes_srcu); > > >> ^~~~~~~~~~~ > > >>>>drivers/gpu/drm/amd/amdgpu/../amdkfd/kfd_process.c:50:1: error: type defaults to 'int' in declaration of 'DEFINE_SRCU' [-Werror=implicit-int] > > >> drivers/gpu/drm/amd/amdgpu/../amdkfd/kfd_process.c:50:1: warning: parameter names (without types) in function declaration > > >> cc1: some warnings being treated as errors > > >I don't have that hardware, but does the following help? (It at least > > >builds for me, but your mileage may vary.) > > > > Yes, the patch works for kbuild robot. > > Thank you very much! May I add your Tested-by? Sure, please feel free to add it. Thanks, Rong Chen > > Thanx, Paul > > > Thanks, > > Rong Chen > > > > > > > > > >------------------------------------------------------------------------ > > > > > >commit b30be5a76070402912437fa23b43de11cb1973f4 > > >Author: Paul E. McKenney <paulmck@linux.ibm.com> > > >Date: Wed Mar 27 12:53:36 2019 -0700 > > > > > > drivers/gpu/drm/amd: Dynamically allocate kfd_processes_srcu > > > Having DEFINE_SRCU() or DEFINE_STATIC_SRCU() in a loadable module > > > requires that the size of the reserved region be increased, which is > > > not something we really want to be doing. This commit therefore removes > > > the DEFINE_STATIC_SRCU() from drivers/gpu/drm/amd/amdkfd/kfd_process.c in > > > favor of defining kfd_processes_srcu as a simple srcu_struct, initializing > > > it in amdgpu_amdkfd_init(), and cleaning it up in amdgpu_amdkfd_fini(). > > > Reported-by: kbuild test robot <lkp@intel.com> > > > Signed-off-by: Paul E. McKenney <paulmck@linux.ibm.com> > > > Cc: Oded Gabbay <oded.gabbay@gmail.com> > > > Cc: Alex Deucher <alexander.deucher@amd.com> > > > Cc: "Christian König" <christian.koenig@amd.com > > > Cc: "David (ChunMing) Zhou" <David1.Zhou@amd.com> > > > Cc: David Airlie <airlied@linux.ie> > > > Cc: Daniel Vetter <daniel@ffwll.ch> > > > > > >diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c > > >index fe1d7368c1e6..eadb20dee867 100644 > > >--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c > > >+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c > > >@@ -28,6 +28,8 @@ > > > #include <linux/module.h> > > > #include <linux/dma-buf.h> > > >+extern struct srcu_struct kfd_processes_srcu; > > >+ > > > static const unsigned int compute_vmid_bitmap = 0xFF00; > > > /* Total memory size in system memory and all GPU VRAM. Used to > > >@@ -40,6 +42,8 @@ int amdgpu_amdkfd_init(void) > > > struct sysinfo si; > > > int ret; > > >+ ret = init_srcu_struct(&kfd_processes_srcu); > > >+ WARN_ON(ret); > > > si_meminfo(&si); > > > amdgpu_amdkfd_total_mem_size = si.totalram - si.totalhigh; > > > amdgpu_amdkfd_total_mem_size *= si.mem_unit; > > >@@ -57,6 +61,7 @@ int amdgpu_amdkfd_init(void) > > > void amdgpu_amdkfd_fini(void) > > > { > > > kgd2kfd_exit(); > > >+ cleanup_srcu_struct(&kfd_processes_srcu); > > > } > > > void amdgpu_amdkfd_device_probe(struct amdgpu_device *adev) > > >diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_process.c b/drivers/gpu/drm/amd/amdkfd/kfd_process.c > > >index 4bdae78bab8e..98b694068b8a 100644 > > >--- a/drivers/gpu/drm/amd/amdkfd/kfd_process.c > > >+++ b/drivers/gpu/drm/amd/amdkfd/kfd_process.c > > >@@ -47,7 +47,7 @@ struct mm_struct; > > > DEFINE_HASHTABLE(kfd_processes_table, KFD_PROCESS_TABLE_SIZE); > > > static DEFINE_MUTEX(kfd_processes_mutex); > > >-DEFINE_SRCU(kfd_processes_srcu); > > >+struct srcu_struct kfd_processes_srcu; > > > /* For process termination handling */ > > > static struct workqueue_struct *kfd_process_wq; > > > > > > ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [rcu:dev.2019.03.20b 54/83] drivers/gpu/drm/amd/amdgpu/../amdkfd/kfd_process.c:50:1: error: type defaults to 'int' in declaration of 'DEFINE_SRCU' 2019-04-02 13:50 ` Rong Chen @ 2019-04-02 14:16 ` Paul E. McKenney 0 siblings, 0 replies; 6+ messages in thread From: Paul E. McKenney @ 2019-04-02 14:16 UTC (permalink / raw) To: Rong Chen; +Cc: kbuild test robot, kbuild-all, linux-kernel On Tue, Apr 02, 2019 at 09:50:30PM +0800, Rong Chen wrote: > On Tue, Apr 02, 2019 at 06:04:24AM -0700, Paul E. McKenney wrote: > > On Tue, Apr 02, 2019 at 08:32:45AM +0800, Rong Chen wrote: > > > > > > On 3/28/19 3:57 AM, Paul E. McKenney wrote: > > > >On Mon, Mar 25, 2019 at 02:34:27AM +0800, kbuild test robot wrote: > > > >>tree: https://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu.git dev.2019.03.20b > > > >>head: 6d4434b4b4df791620743178e1419de882b44c7b > > > >>commit: eb89abcb30733e3a2343dda23cb6d81cc17c60b3 [54/83] rcu: Forbid DEFINE{,_STATIC}_SRCU() from modules > > > >>config: x86_64-randconfig-b0-03250021 (attached as .config) > > > >>compiler: gcc-7 (Debian 7.3.0-1) 7.3.0 > > > >>reproduce: > > > >> git checkout eb89abcb30733e3a2343dda23cb6d81cc17c60b3 > > > >> # save the attached .config to linux build tree > > > >> make ARCH=x86_64 > > > >> > > > >>All errors (new ones prefixed by >>): > > > >> > > > >> drivers/gpu/drm/amd/amdgpu/../amdkfd/kfd_process.c:50:1: warning: data definition has no type or storage class > > > >> DEFINE_SRCU(kfd_processes_srcu); > > > >> ^~~~~~~~~~~ > > > >>>>drivers/gpu/drm/amd/amdgpu/../amdkfd/kfd_process.c:50:1: error: type defaults to 'int' in declaration of 'DEFINE_SRCU' [-Werror=implicit-int] > > > >> drivers/gpu/drm/amd/amdgpu/../amdkfd/kfd_process.c:50:1: warning: parameter names (without types) in function declaration > > > >> cc1: some warnings being treated as errors > > > >I don't have that hardware, but does the following help? (It at least > > > >builds for me, but your mileage may vary.) > > > > > > Yes, the patch works for kbuild robot. > > > > Thank you very much! May I add your Tested-by? > > Sure, please feel free to add it. Very good! I am using "Tested-by: kbuild test robot <lkp@intel.com>", but please let me know if something else would be better for you. Thanx, Paul > Thanks, > Rong Chen > > > > > Thanx, Paul > > > > > Thanks, > > > Rong Chen > > > > > > > > > > > > > >------------------------------------------------------------------------ > > > > > > > >commit b30be5a76070402912437fa23b43de11cb1973f4 > > > >Author: Paul E. McKenney <paulmck@linux.ibm.com> > > > >Date: Wed Mar 27 12:53:36 2019 -0700 > > > > > > > > drivers/gpu/drm/amd: Dynamically allocate kfd_processes_srcu > > > > Having DEFINE_SRCU() or DEFINE_STATIC_SRCU() in a loadable module > > > > requires that the size of the reserved region be increased, which is > > > > not something we really want to be doing. This commit therefore removes > > > > the DEFINE_STATIC_SRCU() from drivers/gpu/drm/amd/amdkfd/kfd_process.c in > > > > favor of defining kfd_processes_srcu as a simple srcu_struct, initializing > > > > it in amdgpu_amdkfd_init(), and cleaning it up in amdgpu_amdkfd_fini(). > > > > Reported-by: kbuild test robot <lkp@intel.com> > > > > Signed-off-by: Paul E. McKenney <paulmck@linux.ibm.com> > > > > Cc: Oded Gabbay <oded.gabbay@gmail.com> > > > > Cc: Alex Deucher <alexander.deucher@amd.com> > > > > Cc: "Christian König" <christian.koenig@amd.com > > > > Cc: "David (ChunMing) Zhou" <David1.Zhou@amd.com> > > > > Cc: David Airlie <airlied@linux.ie> > > > > Cc: Daniel Vetter <daniel@ffwll.ch> > > > > > > > >diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c > > > >index fe1d7368c1e6..eadb20dee867 100644 > > > >--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c > > > >+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c > > > >@@ -28,6 +28,8 @@ > > > > #include <linux/module.h> > > > > #include <linux/dma-buf.h> > > > >+extern struct srcu_struct kfd_processes_srcu; > > > >+ > > > > static const unsigned int compute_vmid_bitmap = 0xFF00; > > > > /* Total memory size in system memory and all GPU VRAM. Used to > > > >@@ -40,6 +42,8 @@ int amdgpu_amdkfd_init(void) > > > > struct sysinfo si; > > > > int ret; > > > >+ ret = init_srcu_struct(&kfd_processes_srcu); > > > >+ WARN_ON(ret); > > > > si_meminfo(&si); > > > > amdgpu_amdkfd_total_mem_size = si.totalram - si.totalhigh; > > > > amdgpu_amdkfd_total_mem_size *= si.mem_unit; > > > >@@ -57,6 +61,7 @@ int amdgpu_amdkfd_init(void) > > > > void amdgpu_amdkfd_fini(void) > > > > { > > > > kgd2kfd_exit(); > > > >+ cleanup_srcu_struct(&kfd_processes_srcu); > > > > } > > > > void amdgpu_amdkfd_device_probe(struct amdgpu_device *adev) > > > >diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_process.c b/drivers/gpu/drm/amd/amdkfd/kfd_process.c > > > >index 4bdae78bab8e..98b694068b8a 100644 > > > >--- a/drivers/gpu/drm/amd/amdkfd/kfd_process.c > > > >+++ b/drivers/gpu/drm/amd/amdkfd/kfd_process.c > > > >@@ -47,7 +47,7 @@ struct mm_struct; > > > > DEFINE_HASHTABLE(kfd_processes_table, KFD_PROCESS_TABLE_SIZE); > > > > static DEFINE_MUTEX(kfd_processes_mutex); > > > >-DEFINE_SRCU(kfd_processes_srcu); > > > >+struct srcu_struct kfd_processes_srcu; > > > > /* For process termination handling */ > > > > static struct workqueue_struct *kfd_process_wq; > > > > > > > > > > ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2019-04-02 14:16 UTC | newest] Thread overview: 6+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2019-03-24 18:34 [rcu:dev.2019.03.20b 54/83] drivers/gpu/drm/amd/amdgpu/../amdkfd/kfd_process.c:50:1: error: type defaults to 'int' in declaration of 'DEFINE_SRCU' kbuild test robot 2019-03-27 19:57 ` Paul E. McKenney 2019-04-02 0:32 ` Rong Chen 2019-04-02 13:04 ` Paul E. McKenney 2019-04-02 13:50 ` Rong Chen 2019-04-02 14:16 ` Paul E. McKenney
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox