Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp710167ybv; Thu, 13 Feb 2020 08:08:53 -0800 (PST) X-Google-Smtp-Source: APXvYqxhMBeVrB+XK6t99G7p/LWWQn3Sm4vXs0X/VHw1N7CsGVgoNTADeUhlejwdfMNYOz4cNYTH X-Received: by 2002:a9d:7083:: with SMTP id l3mr13194599otj.193.1581610133255; Thu, 13 Feb 2020 08:08:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581610133; cv=none; d=google.com; s=arc-20160816; b=Am/yXDyR1RJblCSm5P/vdID8DlszSB1dyJNGcta4k6ptcmGhAhcJ4g/XF4Cc5dfOKS myzLFBtBCPiwF0kKRpoLmzjhO8qHe9x/lWtqsL2XJk3Zt6AAmWW9S3PUjfMbcFKmz5mq up8b3ZTBsVZ2Oak6YwgzNYtzLjUW3VSw65I7uoyb4aDmTUsiD46/kZykozShnbawEHU5 icuefsI/Qqd4cPYT7oOvMjyh3d2+mvqDbYODzB3sqNMwVsN3NS7BRIoXRz3GPNb3Tb5+ tEPmjiPI62U4b9ZTtAtSdfdWuQt8gBigbJkzpgwgW1VKTSXKeEpGe9uuUzYy4z8mpkPe yjVw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=RV66R+z8L0k52klg+I9DyerHgGXnhmGjqYIwWBsQBeY=; b=osXobOX127hMo0ZqMTVod9Gqom5/8kSwei2L8UiR47qxsGZOP+wGt2WEchzk0BA6ag 1/XsSCQ91ukkF/pep25cyyFIMOpldDHDWUipitH5VjG1GG5qI49NOQ27ODg5tQ7K7/Rc opTpzypcU4H0xIs5cWdsC7x3Er66zrXDaVzMF9OCPzXpL9FF456lhtg2vH+Olbyqj5n7 tpJAJ9dosWRHR6SRwCTepvMCjTx8FIufjrGwPhEv4miwj7VMALulxdRyOVYeDF7h7OdS qJZlP/GY3xhpMUzxyECUk3SCJqDubTBmdPobuU7ZZq7p39H9oZVZALkCA1ffjY6Cn3oP y8NQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Y2TCGAU6; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 77si1368253oie.10.2020.02.13.08.08.40; Thu, 13 Feb 2020 08:08:53 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Y2TCGAU6; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388394AbgBMQHW (ORCPT + 99 others); Thu, 13 Feb 2020 11:07:22 -0500 Received: from mail.kernel.org ([198.145.29.99]:34480 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728367AbgBMPXZ (ORCPT ); Thu, 13 Feb 2020 10:23:25 -0500 Received: from localhost (unknown [104.132.1.104]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id BC98B20848; Thu, 13 Feb 2020 15:23:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1581607403; bh=zCnYQwLaSk6jNcHbnqxcTOVbTYavOhSozb67NHsNvss=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Y2TCGAU6LEVxSzaHnn7TeUk+VjK23RObIY8xbpIez6OBsDUgEFpKqe6UmwKrjxgSy GpGp+0tIaYZ28HjtYbUbl+FQ2qrbr4p70IZeyuDMkp6JE2XLhr4/ruK2fJKCAKJF5M IDkjNqFdOEgw30YiLkAoLLFkltvat0wVjhJLxiLQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Taehee Yoo , "David S. Miller" Subject: [PATCH 4.9 006/116] gtp: use __GFP_NOWARN to avoid memalloc warning Date: Thu, 13 Feb 2020 07:19:10 -0800 Message-Id: <20200213151845.076376193@linuxfoundation.org> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200213151842.259660170@linuxfoundation.org> References: <20200213151842.259660170@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Taehee Yoo [ Upstream commit bd5cd35b782abf5437fbd01dfaee12437d20e832 ] gtp hashtable size is received by user-space. So, this hashtable size could be too large. If so, kmalloc will internally print a warning message. This warning message is actually not necessary for the gtp module. So, this patch adds __GFP_NOWARN to avoid this message. Splat looks like: [ 2171.200049][ T1860] WARNING: CPU: 1 PID: 1860 at mm/page_alloc.c:4713 __alloc_pages_nodemask+0x2f3/0x740 [ 2171.238885][ T1860] Modules linked in: gtp veth openvswitch nsh nf_conncount nf_nat nf_conntrack nf_defrag_ipv] [ 2171.262680][ T1860] CPU: 1 PID: 1860 Comm: gtp-link Not tainted 5.5.0+ #321 [ 2171.263567][ T1860] Hardware name: innotek GmbH VirtualBox/VirtualBox, BIOS VirtualBox 12/01/2006 [ 2171.264681][ T1860] RIP: 0010:__alloc_pages_nodemask+0x2f3/0x740 [ 2171.265332][ T1860] Code: 64 fe ff ff 65 48 8b 04 25 c0 0f 02 00 48 05 f0 12 00 00 41 be 01 00 00 00 49 89 47 0 [ 2171.267301][ T1860] RSP: 0018:ffff8880b51af1f0 EFLAGS: 00010246 [ 2171.268320][ T1860] RAX: ffffed1016a35e43 RBX: 0000000000000000 RCX: 0000000000000000 [ 2171.269517][ T1860] RDX: 0000000000000000 RSI: 000000000000000b RDI: 0000000000000000 [ 2171.270305][ T1860] RBP: 0000000000040cc0 R08: ffffed1018893109 R09: dffffc0000000000 [ 2171.275973][ T1860] R10: 0000000000000001 R11: ffffed1018893108 R12: 1ffff11016a35e43 [ 2171.291039][ T1860] R13: 000000000000000b R14: 000000000000000b R15: 00000000000f4240 [ 2171.292328][ T1860] FS: 00007f53cbc83740(0000) GS:ffff8880da000000(0000) knlGS:0000000000000000 [ 2171.293409][ T1860] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 2171.294586][ T1860] CR2: 000055f540014508 CR3: 00000000b49f2004 CR4: 00000000000606e0 [ 2171.295424][ T1860] Call Trace: [ 2171.295756][ T1860] ? mark_held_locks+0xa5/0xe0 [ 2171.296659][ T1860] ? __alloc_pages_slowpath+0x21b0/0x21b0 [ 2171.298283][ T1860] ? gtp_encap_enable_socket+0x13e/0x400 [gtp] [ 2171.298962][ T1860] ? alloc_pages_current+0xc1/0x1a0 [ 2171.299475][ T1860] kmalloc_order+0x22/0x80 [ 2171.299936][ T1860] kmalloc_order_trace+0x1d/0x140 [ 2171.300437][ T1860] __kmalloc+0x302/0x3a0 [ 2171.300896][ T1860] gtp_newlink+0x293/0xba0 [gtp] [ ... ] Fixes: 459aa660eb1d ("gtp: add initial driver for datapath of GPRS Tunneling Protocol (GTP-U)") Signed-off-by: Taehee Yoo Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- drivers/net/gtp.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) --- a/drivers/net/gtp.c +++ b/drivers/net/gtp.c @@ -784,11 +784,13 @@ static int gtp_hashtable_new(struct gtp_ { int i; - gtp->addr_hash = kmalloc(sizeof(struct hlist_head) * hsize, GFP_KERNEL); + gtp->addr_hash = kmalloc(sizeof(struct hlist_head) * hsize, + GFP_KERNEL | __GFP_NOWARN); if (gtp->addr_hash == NULL) return -ENOMEM; - gtp->tid_hash = kmalloc(sizeof(struct hlist_head) * hsize, GFP_KERNEL); + gtp->tid_hash = kmalloc(sizeof(struct hlist_head) * hsize, + GFP_KERNEL | __GFP_NOWARN); if (gtp->tid_hash == NULL) goto err1;