* [PATCH 0/4] use mmgrab
@ 2019-12-29 15:42 Julia Lawall
2019-12-29 15:42 ` [PATCH 1/4] misc: cxl: " Julia Lawall
2020-01-03 12:31 ` [PATCH 0/4] " Dan Carpenter
0 siblings, 2 replies; 6+ messages in thread
From: Julia Lawall @ 2019-12-29 15:42 UTC (permalink / raw)
To: kvm; +Cc: linuxppc-dev, Cornelia Huck, kernel-janitors, linux-kernel, openrisc
Mmgrab was introduced in commit f1f1007644ff ("mm: add new mmgrab()
helper") and most of the kernel was updated to use it. Update a few
remaining files.
---
arch/openrisc/kernel/smp.c | 2 +-
drivers/misc/cxl/context.c | 2 +-
drivers/vfio/pci/vfio_pci_nvlink2.c | 2 +-
drivers/vfio/vfio_iommu_spapr_tce.c | 2 +-
4 files changed, 4 insertions(+), 4 deletions(-)
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 1/4] misc: cxl: use mmgrab
2019-12-29 15:42 [PATCH 0/4] use mmgrab Julia Lawall
@ 2019-12-29 15:42 ` Julia Lawall
2019-12-29 22:38 ` Andrew Donnellan
2020-01-29 5:17 ` Michael Ellerman
2020-01-03 12:31 ` [PATCH 0/4] " Dan Carpenter
1 sibling, 2 replies; 6+ messages in thread
From: Julia Lawall @ 2019-12-29 15:42 UTC (permalink / raw)
To: Frederic Barrat
Cc: Andrew Donnellan, Arnd Bergmann, Greg Kroah-Hartman,
kernel-janitors, linux-kernel, linuxppc-dev
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 <Julia.Lawall@inria.fr>
---
drivers/misc/cxl/context.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/misc/cxl/context.c b/drivers/misc/cxl/context.c
index aed9c445d1e2..fb2eff69e449 100644
--- a/drivers/misc/cxl/context.c
+++ b/drivers/misc/cxl/context.c
@@ -352,7 +352,7 @@ void cxl_context_free(struct cxl_context *ctx)
void cxl_context_mm_count_get(struct cxl_context *ctx)
{
if (ctx->mm)
- atomic_inc(&ctx->mm->mm_count);
+ mmgrab(ctx->mm);
}
void cxl_context_mm_count_put(struct cxl_context *ctx)
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH 1/4] misc: cxl: use mmgrab
2019-12-29 15:42 ` [PATCH 1/4] misc: cxl: " Julia Lawall
@ 2019-12-29 22:38 ` Andrew Donnellan
2020-01-29 5:17 ` Michael Ellerman
1 sibling, 0 replies; 6+ messages in thread
From: Andrew Donnellan @ 2019-12-29 22:38 UTC (permalink / raw)
To: Julia Lawall, Frederic Barrat
Cc: Greg Kroah-Hartman, kernel-janitors, linuxppc-dev, Arnd Bergmann,
linux-kernel
On 30/12/19 2:42 am, Julia Lawall wrote:
> 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 <Julia.Lawall@inria.fr>
Thanks!
Acked-by: Andrew Donnellan <ajd@linux.ibm.com>
--
Andrew Donnellan OzLabs, ADL Canberra
ajd@linux.ibm.com IBM Australia Limited
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 0/4] use mmgrab
2019-12-29 15:42 [PATCH 0/4] use mmgrab Julia Lawall
2019-12-29 15:42 ` [PATCH 1/4] misc: cxl: " Julia Lawall
@ 2020-01-03 12:31 ` Dan Carpenter
2020-01-03 12:47 ` Julia Lawall
1 sibling, 1 reply; 6+ messages in thread
From: Dan Carpenter @ 2020-01-03 12:31 UTC (permalink / raw)
To: Julia Lawall
Cc: kvm, Cornelia Huck, kernel-janitors, linux-kernel, openrisc,
linuxppc-dev
On Sun, Dec 29, 2019 at 04:42:54PM +0100, Julia Lawall wrote:
> Mmgrab was introduced in commit f1f1007644ff ("mm: add new mmgrab()
> helper") and most of the kernel was updated to use it. Update a few
> remaining files.
I wonder if there is an automatic way to generate these kind of
Coccinelle scripts which use inlines instead of open coding. Like maybe
make a list of one line functions, and then auto generate a recipe. Or
the mmgrab() function could have multiple lines if the first few were
just sanity checks for NULL or something...
regards,
dan carpenter
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 0/4] use mmgrab
2020-01-03 12:31 ` [PATCH 0/4] " Dan Carpenter
@ 2020-01-03 12:47 ` Julia Lawall
0 siblings, 0 replies; 6+ messages in thread
From: Julia Lawall @ 2020-01-03 12:47 UTC (permalink / raw)
To: Dan Carpenter
Cc: kvm, Cornelia Huck, kernel-janitors, linux-kernel, openrisc,
linuxppc-dev
On Fri, 3 Jan 2020, Dan Carpenter wrote:
> On Sun, Dec 29, 2019 at 04:42:54PM +0100, Julia Lawall wrote:
> > Mmgrab was introduced in commit f1f1007644ff ("mm: add new mmgrab()
> > helper") and most of the kernel was updated to use it. Update a few
> > remaining files.
>
> I wonder if there is an automatic way to generate these kind of
> Coccinelle scripts which use inlines instead of open coding. Like maybe
> make a list of one line functions, and then auto generate a recipe. Or
> the mmgrab() function could have multiple lines if the first few were
> just sanity checks for NULL or something...
I tried this at one point (10 years ago!):
https://pages.lip6.fr/Julia.Lawall/acp4is09-lawall.pdf
Perhaps it is worth reviving.
julia
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 1/4] misc: cxl: use mmgrab
2019-12-29 15:42 ` [PATCH 1/4] misc: cxl: " Julia Lawall
2019-12-29 22:38 ` Andrew Donnellan
@ 2020-01-29 5:17 ` Michael Ellerman
1 sibling, 0 replies; 6+ messages in thread
From: Michael Ellerman @ 2020-01-29 5:17 UTC (permalink / raw)
To: Julia Lawall, Frederic Barrat
Cc: Andrew Donnellan, Arnd Bergmann, Greg Kroah-Hartman,
kernel-janitors, linux-kernel, linuxppc-dev
On Sun, 2019-12-29 at 15:42:55 UTC, Julia Lawall wrote:
> 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 <Julia.Lawall@inria.fr>
Applied to powerpc next, thanks.
https://git.kernel.org/powerpc/c/30e813cf46ccaeea6508607632e49b4a1d743d2a
cheers
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2020-01-29 5:55 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-29 15:42 [PATCH 0/4] use mmgrab Julia Lawall
2019-12-29 15:42 ` [PATCH 1/4] misc: cxl: " Julia Lawall
2019-12-29 22:38 ` Andrew Donnellan
2020-01-29 5:17 ` Michael Ellerman
2020-01-03 12:31 ` [PATCH 0/4] " Dan Carpenter
2020-01-03 12:47 ` Julia Lawall
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).