* [PATCH] cxl: don't manipulate the mm.mm_users field directly
@ 2021-03-10 17:44 Laurent Dufour
2021-03-11 7:46 ` Frederic Barrat
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Laurent Dufour @ 2021-03-10 17:44 UTC (permalink / raw)
To: fbarrat, ajd, arnd, gregkh; +Cc: linuxppc-dev, linux-kernel, clombard
It is better to rely on the API provided by the MM layer instead of
directly manipulating the mm_users field.
Signed-off-by: Laurent Dufour <ldufour@linux.ibm.com>
---
drivers/misc/cxl/fault.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/misc/cxl/fault.c b/drivers/misc/cxl/fault.c
index 01153b74334a..60c829113299 100644
--- a/drivers/misc/cxl/fault.c
+++ b/drivers/misc/cxl/fault.c
@@ -200,7 +200,7 @@ static struct mm_struct *get_mem_context(struct cxl_context *ctx)
if (ctx->mm == NULL)
return NULL;
- if (!atomic_inc_not_zero(&ctx->mm->mm_users))
+ if (!mmget_not_zero(ctx->mm))
return NULL;
return ctx->mm;
--
2.30.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] cxl: don't manipulate the mm.mm_users field directly
2021-03-10 17:44 [PATCH] cxl: don't manipulate the mm.mm_users field directly Laurent Dufour
@ 2021-03-11 7:46 ` Frederic Barrat
2021-03-12 2:18 ` Andrew Donnellan
2021-03-31 1:09 ` Michael Ellerman
2 siblings, 0 replies; 4+ messages in thread
From: Frederic Barrat @ 2021-03-11 7:46 UTC (permalink / raw)
To: Laurent Dufour, ajd, arnd, gregkh; +Cc: linuxppc-dev, linux-kernel, clombard
On 10/03/2021 18:44, Laurent Dufour wrote:
> It is better to rely on the API provided by the MM layer instead of
> directly manipulating the mm_users field.
>
> Signed-off-by: Laurent Dufour <ldufour@linux.ibm.com>
> ---
Thanks!
Acked-by: Frederic Barrat <fbarrat@linux.ibm.com>
> drivers/misc/cxl/fault.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/misc/cxl/fault.c b/drivers/misc/cxl/fault.c
> index 01153b74334a..60c829113299 100644
> --- a/drivers/misc/cxl/fault.c
> +++ b/drivers/misc/cxl/fault.c
> @@ -200,7 +200,7 @@ static struct mm_struct *get_mem_context(struct cxl_context *ctx)
> if (ctx->mm == NULL)
> return NULL;
>
> - if (!atomic_inc_not_zero(&ctx->mm->mm_users))
> + if (!mmget_not_zero(ctx->mm))
> return NULL;
>
> return ctx->mm;
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] cxl: don't manipulate the mm.mm_users field directly
2021-03-10 17:44 [PATCH] cxl: don't manipulate the mm.mm_users field directly Laurent Dufour
2021-03-11 7:46 ` Frederic Barrat
@ 2021-03-12 2:18 ` Andrew Donnellan
2021-03-31 1:09 ` Michael Ellerman
2 siblings, 0 replies; 4+ messages in thread
From: Andrew Donnellan @ 2021-03-12 2:18 UTC (permalink / raw)
To: Laurent Dufour, fbarrat, arnd, gregkh
Cc: linuxppc-dev, linux-kernel, clombard
On 11/3/21 4:44 am, Laurent Dufour wrote:
> It is better to rely on the API provided by the MM layer instead of
> directly manipulating the mm_users field.
>
> Signed-off-by: Laurent Dufour <ldufour@linux.ibm.com>
LGTM, thanks for picking this up
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] 4+ messages in thread
* Re: [PATCH] cxl: don't manipulate the mm.mm_users field directly
2021-03-10 17:44 [PATCH] cxl: don't manipulate the mm.mm_users field directly Laurent Dufour
2021-03-11 7:46 ` Frederic Barrat
2021-03-12 2:18 ` Andrew Donnellan
@ 2021-03-31 1:09 ` Michael Ellerman
2 siblings, 0 replies; 4+ messages in thread
From: Michael Ellerman @ 2021-03-31 1:09 UTC (permalink / raw)
To: gregkh, fbarrat, arnd, ajd, Laurent Dufour
Cc: clombard, linux-kernel, linuxppc-dev
On Wed, 10 Mar 2021 18:44:05 +0100, Laurent Dufour wrote:
> It is better to rely on the API provided by the MM layer instead of
> directly manipulating the mm_users field.
Applied to powerpc/next.
[1/1] cxl: don't manipulate the mm.mm_users field directly
https://git.kernel.org/powerpc/c/2d9f69bc5a5a75579b410beb0dc3d313be762c9f
cheers
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2021-03-31 1:11 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-10 17:44 [PATCH] cxl: don't manipulate the mm.mm_users field directly Laurent Dufour
2021-03-11 7:46 ` Frederic Barrat
2021-03-12 2:18 ` Andrew Donnellan
2021-03-31 1:09 ` Michael Ellerman
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).