Mmgrab was introduced in commit f1f1007644ff ("mm: add new mmgrab()
helper") and most of the kernel was updated to use it. Update a
remaining file.
The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)
<smpl>
@@ expression e; @@
- atomic_inc(&e->mm_count);
+ mmgrab(e);
</smpl>
Signed-off-by: Julia Lawall <[email protected]>
---
I was not able to compile this file.
arch/openrisc/kernel/smp.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/openrisc/kernel/smp.c b/arch/openrisc/kernel/smp.c
index 7d518ee8bddc..7bd6e0fc7a6d 100644
--- a/arch/openrisc/kernel/smp.c
+++ b/arch/openrisc/kernel/smp.c
@@ -113,7 +113,7 @@ asmlinkage __init void secondary_start_kernel(void)
* All kernel threads share the same mm context; grab a
* reference and switch to it.
*/
- atomic_inc(&mm->mm_count);
+ mmgrab(mm);
current->active_mm = mm;
cpumask_set_cpu(cpu, mm_cpumask(mm));
Hi Julia,
I love your patch! Yet something to improve:
[auto build test ERROR on vfio/next]
[also build test ERROR on char-misc/char-misc-testing v5.5-rc3 next-20191220]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]
url: https://github.com/0day-ci/linux/commits/Julia-Lawall/use-mmgrab/20191230-011611
base: https://github.com/awilliam/linux-vfio.git next
config: openrisc-simple_smp_defconfig (attached as .config)
compiler: or1k-linux-gcc (GCC) 9.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=9.2.0 make.cross ARCH=openrisc
If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <[email protected]>
All errors (new ones prefixed by >>):
arch/openrisc/kernel/smp.c: In function 'secondary_start_kernel':
>> arch/openrisc/kernel/smp.c:116:2: error: implicit declaration of function 'mmgrab'; did you mean 'igrab'? [-Werror=implicit-function-declaration]
116 | mmgrab(mm);
| ^~~~~~
| igrab
cc1: some warnings being treated as errors
vim +116 arch/openrisc/kernel/smp.c
107
108 asmlinkage __init void secondary_start_kernel(void)
109 {
110 struct mm_struct *mm = &init_mm;
111 unsigned int cpu = smp_processor_id();
112 /*
113 * All kernel threads share the same mm context; grab a
114 * reference and switch to it.
115 */
> 116 mmgrab(mm);
117 current->active_mm = mm;
118 cpumask_set_cpu(cpu, mm_cpumask(mm));
119
120 pr_info("CPU%u: Booted secondary processor\n", cpu);
121
122 setup_cpuinfo();
123 openrisc_clockevent_init();
124
125 notify_cpu_starting(cpu);
126
127 /*
128 * OK, now it's safe to let the boot CPU continue
129 */
130 complete(&cpu_running);
131
132 synchronise_count_slave(cpu);
133 set_cpu_online(cpu, true);
134
135 local_irq_enable();
136
137 preempt_disable();
138 /*
139 * OK, it's off to the idle thread for us
140 */
141 cpu_startup_entry(CPUHP_AP_ONLINE_IDLE);
142 }
143
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/hyperkitty/list/[email protected] Intel Corporation
On Mon, Dec 30, 2019 at 12:49:19PM +0800, kbuild test robot wrote:
> Hi Julia,
>
> I love your patch! Yet something to improve:
>
> [auto build test ERROR on vfio/next]
> [also build test ERROR on char-misc/char-misc-testing v5.5-rc3 next-20191220]
> [if your patch is applied to the wrong git tree, please drop us a note to help
> improve the system. BTW, we also suggest to use '--base' option to specify the
> base tree in git format-patch, please see https://stackoverflow.com/a/37406982]
>
> url: https://github.com/0day-ci/linux/commits/Julia-Lawall/use-mmgrab/20191230-011611
> base: https://github.com/awilliam/linux-vfio.git next
> config: openrisc-simple_smp_defconfig (attached as .config)
> compiler: or1k-linux-gcc (GCC) 9.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=9.2.0 make.cross ARCH=openrisc
>
> If you fix the issue, kindly add following tag
> Reported-by: kbuild test robot <[email protected]>
>
> All errors (new ones prefixed by >>):
>
> arch/openrisc/kernel/smp.c: In function 'secondary_start_kernel':
> >> arch/openrisc/kernel/smp.c:116:2: error: implicit declaration of function 'mmgrab'; did you mean 'igrab'? [-Werror=implicit-function-declaration]
> 116 | mmgrab(mm);
> | ^~~~~~
> | igrab
> cc1: some warnings being treated as errors
Hi Julia,
It looks like this is just an include issue, do you want to revise the patch?
Once fixed, how do you plan to get this patch series merged? I can add the
OpenRISC part to my queue or do you have a cleanups queue you can manage?
-Stafford
On Mon, Dec 30, 2019 at 12:49:19PM +0800, kbuild test robot wrote:
> Hi Julia,
>
> I love your patch! Yet something to improve:
>
> [auto build test ERROR on vfio/next]
> [also build test ERROR on char-misc/char-misc-testing v5.5-rc3 next-20191220]
> [if your patch is applied to the wrong git tree, please drop us a note to help
> improve the system. BTW, we also suggest to use '--base' option to specify the
> base tree in git format-patch, please see https://stackoverflow.com/a/37406982]
>
> url: https://github.com/0day-ci/linux/commits/Julia-Lawall/use-mmgrab/20191230-011611
> base: https://github.com/awilliam/linux-vfio.git next
> config: openrisc-simple_smp_defconfig (attached as .config)
> compiler: or1k-linux-gcc (GCC) 9.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=9.2.0 make.cross ARCH=openrisc
>
> If you fix the issue, kindly add following tag
> Reported-by: kbuild test robot <[email protected]>
>
> All errors (new ones prefixed by >>):
>
> arch/openrisc/kernel/smp.c: In function 'secondary_start_kernel':
> >> arch/openrisc/kernel/smp.c:116:2: error: implicit declaration of function 'mmgrab'; did you mean 'igrab'? [-Werror=implicit-function-declaration]
> 116 | mmgrab(mm);
> | ^~~~~~
> | igrab
> cc1: some warnings being treated as errors
>
> vim +116 arch/openrisc/kernel/smp.c
>
> 107
> 108 asmlinkage __init void secondary_start_kernel(void)
> 109 {
> 110 struct mm_struct *mm = &init_mm;
> 111 unsigned int cpu = smp_processor_id();
> 112 /*
> 113 * All kernel threads share the same mm context; grab a
> 114 * reference and switch to it.
> 115 */
> > 116 mmgrab(mm);
> 117 current->active_mm = mm;
> 118 cpumask_set_cpu(cpu, mm_cpumask(mm));
> 119
> 120 pr_info("CPU%u: Booted secondary processor\n", cpu);
> 121
> 122 setup_cpuinfo();
> 123 openrisc_clockevent_init();
> 124
> 125 notify_cpu_starting(cpu);
> 126
> 127 /*
> 128 * OK, now it's safe to let the boot CPU continue
> 129 */
> 130 complete(&cpu_running);
> 131
> 132 synchronise_count_slave(cpu);
> 133 set_cpu_online(cpu, true);
> 134
> 135 local_irq_enable();
> 136
> 137 preempt_disable();
> 138 /*
> 139 * OK, it's off to the idle thread for us
> 140 */
> 141 cpu_startup_entry(CPUHP_AP_ONLINE_IDLE);
> 142 }
> 143
>
Hello, FYI I have fixed this commit and queued it on my 5.7 branch.
-Stafford