linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ipc: fix call_kern.cocci warnings
@ 2020-06-15 11:53 Julia Lawall
  2020-06-15 11:55 ` Matthew Wilcox
  0 siblings, 1 reply; 2+ messages in thread
From: Julia Lawall @ 2020-06-15 11:53 UTC (permalink / raw)
  To: Matthew Wilcox (Oracle)
  Cc: Andrew Morton, Linux Memory Management List, Alexey Dobriyan,
	Waiman Long, Vasily Averin, Pankaj Bharadiya, linux-kernel,
	kbuild-all

From: kernel test robot <lkp@intel.com>

This function is called from ipc_addid with a spin lock held so change
GFP_KERNEL to GFP_ATOMIC.

Generated by: scripts/coccinelle/locks/call_kern.cocci

Fixes: dc996261c060 ("ipc: convert ipcs_idr to XArray")
CC: Matthew Wilcox (Oracle) <willy@infradead.org>
Signed-off-by: kernel test robot <lkp@intel.com>
Signed-off-by: Julia Lawall <julia.lawall@inria.fr>
---

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   842221d073a88c9cd1aa01777c4b69020c28e7a4
commit: dc996261c060f06e1f20f580e203b81a4ddfe301 [16130/16374] ipc: convert ipcs_idr to XArray
:::::: branch date: 17 hours ago
:::::: commit date: 3 days ago

Please take the patch only if it's a positive warning. Thanks!

 util.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- a/ipc/util.c
+++ b/ipc/util.c
@@ -241,7 +241,7 @@ static inline int ipc_id_alloc(struct ip
 					xas.xa_index;
 			xas_store(&xas, new);
 			xas_clear_mark(&xas, XA_FREE_MARK);
-		} while (__xas_nomem(&xas, GFP_KERNEL));
+		} while (__xas_nomem(&xas, GFP_ATOMIC));

 		xas_unlock(&xas);
 		err = xas_error(&xas);
@@ -250,7 +250,7 @@ static inline int ipc_id_alloc(struct ip
 		new->id = get_restore_id(ids);
 		new->seq = ipcid_to_seqx(new->id);
 		idx = ipcid_to_idx(new->id);
-		err = xa_insert(&ids->ipcs, idx, new, GFP_KERNEL);
+		err = xa_insert(&ids->ipcs, idx, new, GFP_ATOMIC);
 		if (err == -EBUSY)
 			err = -ENOSPC;
 		set_restore_id(ids, -1);

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] ipc: fix call_kern.cocci warnings
  2020-06-15 11:53 [PATCH] ipc: fix call_kern.cocci warnings Julia Lawall
@ 2020-06-15 11:55 ` Matthew Wilcox
  0 siblings, 0 replies; 2+ messages in thread
From: Matthew Wilcox @ 2020-06-15 11:55 UTC (permalink / raw)
  To: Julia Lawall
  Cc: Andrew Morton, Linux Memory Management List, Alexey Dobriyan,
	Waiman Long, Vasily Averin, Pankaj Bharadiya, linux-kernel,
	kbuild-all

On Mon, Jun 15, 2020 at 01:53:54PM +0200, Julia Lawall wrote:
> From: kernel test robot <lkp@intel.com>
> 
> This function is called from ipc_addid with a spin lock held so change
> GFP_KERNEL to GFP_ATOMIC.
> 
> Generated by: scripts/coccinelle/locks/call_kern.cocci
> 
> Fixes: dc996261c060 ("ipc: convert ipcs_idr to XArray")

We're dropping this patch; the problems go far deeper.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-06-15 11:55 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-15 11:53 [PATCH] ipc: fix call_kern.cocci warnings Julia Lawall
2020-06-15 11:55 ` Matthew Wilcox

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).