From patchwork Mon Jun 15 11:53:54 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julia Lawall X-Patchwork-Id: 11604603 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1A13813B1 for ; Mon, 15 Jun 2020 11:54:06 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id DBD2220776 for ; Mon, 15 Jun 2020 11:54:05 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DBD2220776 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=inria.fr Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 2D1A26B0002; Mon, 15 Jun 2020 07:54:05 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 25B6E6B0003; Mon, 15 Jun 2020 07:54:05 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 14A186B0005; Mon, 15 Jun 2020 07:54:05 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0063.hostedemail.com [216.40.44.63]) by kanga.kvack.org (Postfix) with ESMTP id E82036B0002 for ; Mon, 15 Jun 2020 07:54:04 -0400 (EDT) Received: from smtpin09.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id A50501EE6 for ; Mon, 15 Jun 2020 11:54:04 +0000 (UTC) X-FDA: 76931287608.09.stem98_4611d4f26df6 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin09.hostedemail.com (Postfix) with ESMTP id 85FBA180AD815 for ; Mon, 15 Jun 2020 11:54:04 +0000 (UTC) X-Spam-Summary: 1,0,0,,d41d8cd98f00b204,julia.lawall@inria.fr,,RULES_HIT:30054:30064:30070:30080,0,RBL:192.134.164.104:@inria.fr:.lbl8.mailshell.net-64.100.201.201 62.2.5.0,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fp,MSBL:0,DNSBL:neutral,Custom_rules:0:0:0,LFtime:23,LUA_SUMMARY:none X-HE-Tag: stem98_4611d4f26df6 X-Filterd-Recvd-Size: 2774 Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by imf09.hostedemail.com (Postfix) with ESMTP for ; Mon, 15 Jun 2020 11:54:03 +0000 (UTC) X-IronPort-AV: E=Sophos;i="5.73,514,1583190000"; d="scan'208";a="351626852" Received: from abo-173-121-68.mrs.modulonet.fr (HELO hadrien) ([85.68.121.173]) by mail3-relais-sop.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 15 Jun 2020 13:53:55 +0200 Date: Mon, 15 Jun 2020 13:53:54 +0200 (CEST) From: Julia Lawall X-X-Sender: jll@hadrien To: "Matthew Wilcox (Oracle)" cc: Andrew Morton , Linux Memory Management List , Alexey Dobriyan , Waiman Long , Vasily Averin , Pankaj Bharadiya , linux-kernel@vger.kernel.org, kbuild-all@lists.01.org Subject: [PATCH] ipc: fix call_kern.cocci warnings Message-ID: User-Agent: Alpine 2.22 (DEB 394 2020-01-19) MIME-Version: 1.0 X-Rspamd-Queue-Id: 85FBA180AD815 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam03 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: From: kernel test robot 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) Signed-off-by: kernel test robot Signed-off-by: Julia Lawall --- 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);