Received: by 10.213.65.68 with SMTP id h4csp3138323imn; Mon, 9 Apr 2018 15:10:01 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+fuhch791/+vPzPjntFHagyRDO/I+kFrA3YxjcYBJlOFbT218hWbDjgnWPU3Deduocgt34 X-Received: by 2002:a17:902:b28:: with SMTP id 37-v6mr39885563plq.207.1523311801435; Mon, 09 Apr 2018 15:10:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523311801; cv=none; d=google.com; s=arc-20160816; b=lbspZu5TAl1WRnDHGmdp7NTIY4XbKJAdFGZfjPMmcniDNdVl3jQ1kI/QxY3Rj/bOVW OaQttHrkDhdJnG+8sWOAmuMNWv9zmFZ4RfgFg0bZNC4BIiHmIJqDKibr/dHhiB+v4d+U bUD/EwA9PRz/f6L6t8w4TKh2P9krlVfmnti5R25oe/FKxENC02qix9uQ3YY0NwvW1wsq IDUThKFwCVfy4+BEyHfShAR/NebKT/8C/TdAfilTkZNdgps0LfBILuTnQ2TcXQTGuJq9 f5bweLqOIs9TkoyAUzKz5eLws2LJ20nboq67JMccIiBGM/dLfeCCNZwmyuPnEX4m21a0 u1SQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature :arc-authentication-results; bh=Hf7QHbdF8TCjoDt3KvTj+0BWyiwa8YmuX3DOMIDQVis=; b=kNS5mV4FteAV8Sli6SlJF7E9kfgs+I9i3pJxUhwQQElFUbZEmDYs4eUbF3QXihGVM4 UQ/CwEVO/KszsmtNwo/TitbvdxWfjeqay6tx29iTIPEw/R10LQD2ALApVfWXWhrbX6ga Sbe6Q6shXzanB5tj2fQNKHF59YeZQqN+6c7CgTMTSrOzVtgVTkDDJgN8A2RJFYqXryzy 8hlqzOpHdn9q+fHjGHXJz6zdzhymj6d0ozu8UR8MZr7Yo6DsZk9kytEZIZbS3aMnJxa0 0p9aW0R+spBvkolvC+zvVlphCx2Qy7/n+SwuW2yjLwEnuJUmxrDa+DTHRN+uh/qOUU8S eM9w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=IZ0/3T2d; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f4-v6si1102148plr.587.2018.04.09.15.09.24; Mon, 09 Apr 2018 15:10:01 -0700 (PDT) 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=@gmail.com header.s=20161025 header.b=IZ0/3T2d; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752953AbeDIOtA (ORCPT + 99 others); Mon, 9 Apr 2018 10:49:00 -0400 Received: from mail-pl0-f68.google.com ([209.85.160.68]:40893 "EHLO mail-pl0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751671AbeDIOs4 (ORCPT ); Mon, 9 Apr 2018 10:48:56 -0400 Received: by mail-pl0-f68.google.com with SMTP id x4-v6so5292688pln.7; Mon, 09 Apr 2018 07:48:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding:content-language; bh=Hf7QHbdF8TCjoDt3KvTj+0BWyiwa8YmuX3DOMIDQVis=; b=IZ0/3T2dxk+F0ymaz9BBgIcy7qwE3qZ179dr3MlZ8/SGpWpv4BwouCEpgJRq95vnSh eYVJN4//QxeXeZ8J+g6VRMoycQWjGAZKB1qVxdv7qGHaW+BEdct52CQcR7cLmqflI9h+ p/znVqMbiRzUknDGDgQeuJW70YZydo8hUhP9d45jeNfd5KJY4Xn9UYvFL9FIyP3NS86F mNha7n38EZ8j28nJCnX5ugq1ziW1u+H74zXyLQ03E7sqBL5EhbrRI7+xT+evbROOpWh2 T5VJf+kwZ91M1WCmbW+bRI5vdJMOi6dDKC4Zy5kzL6UdgDrdWW02r7+V2oUTpjajfXLV qWEg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=Hf7QHbdF8TCjoDt3KvTj+0BWyiwa8YmuX3DOMIDQVis=; b=gx1RCMKHxzdbUireCSt9qL7Zhyee9FZiyfO3KOy5CFPfJSJdAWqy4us3jqrmMQPvfO ntZcgpW7RC/XfCPzTy+1Kz4xMTQoHchRDGbFOhEf2S7NEGEuUZ+ULuKV9T1hHUjdhjB1 7gbi55ArmBBGHzu/yaGrDLhXHdMNC1T261NESD15KISpZpmkZHO8WyRUqGrx/OtuWWsp xQcNDiqCk8kPSITZdNc9yVJa4QJGT0HPdpmuzP4143++Ue95yMJEkQRA2GDKm152NoqC IX8mmpqV/H/mq5FkVh19i+525Sbby2ooHZoPTMuBZEL7LnJk4u/CqBUy6Venp4MYFzLS j3ew== X-Gm-Message-State: AElRT7FfhYxSDp1Iv6hEDLWXjB/d5z0N6YeCg4acQrL0rx1EB8dom7oZ dV/CQK1ADLUsb3JU87oYif/mTYby X-Received: by 2002:a17:902:6ac1:: with SMTP id i1-v6mr38285249plt.152.1523285335736; Mon, 09 Apr 2018 07:48:55 -0700 (PDT) Received: from ?IPv6:2402:f000:1:1501:200:5efe:166.111.70.53? ([2402:f000:1:1501:200:5efe:a66f:4635]) by smtp.gmail.com with ESMTPSA id b64sm994103pgc.23.2018.04.09.07.48.52 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 09 Apr 2018 07:48:55 -0700 (PDT) Subject: Re: [PATCH] net: decnet: Replace GFP_ATOMIC with GFP_KERNEL in dn_route_init To: Eric Dumazet , davem@davemloft.net, kafai@fb.com, weiwan@google.com, dsa@cumulusnetworks.com, johannes.berg@intel.com, fw@strlen.de Cc: linux-decnet-user@lists.sourceforge.net, netdev@vger.kernel.org, linux-kernel@vger.kernel.org References: <1523283035-25639-1-git-send-email-baijiaju1990@gmail.com> <945ed4f2-e1e2-a038-2808-f18a79a35732@gmail.com> From: Jia-Ju Bai Message-ID: <92500938-e1c1-906c-58a7-404645df5b81@gmail.com> Date: Mon, 9 Apr 2018 22:48:38 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.2.0 MIME-Version: 1.0 In-Reply-To: <945ed4f2-e1e2-a038-2808-f18a79a35732@gmail.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2018/4/9 22:44, Eric Dumazet wrote: > > On 04/09/2018 07:10 AM, Jia-Ju Bai wrote: >> dn_route_init() is never called in atomic context. >> >> The call chain ending up at dn_route_init() is: >> [1] dn_route_init() <- decnet_init() >> decnet_init() is only set as a parameter of module_init(). >> >> Despite never getting called from atomic context, >> dn_route_init() calls __get_free_pages() with GFP_ATOMIC, >> which waits busily for allocation. >> GFP_ATOMIC is not necessary and can be replaced with GFP_KERNEL, >> to avoid busy waiting and improve the possibility of sucessful allocation. >> >> This is found by a static analysis tool named DCNS written by myself. >> And I also manually check it. >> >> Signed-off-by: Jia-Ju Bai >> --- >> net/decnet/dn_route.c | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/net/decnet/dn_route.c b/net/decnet/dn_route.c >> index 0bd3afd..59ed12a 100644 >> --- a/net/decnet/dn_route.c >> +++ b/net/decnet/dn_route.c >> @@ -1898,7 +1898,7 @@ void __init dn_route_init(void) >> while(dn_rt_hash_mask & (dn_rt_hash_mask - 1)) >> dn_rt_hash_mask--; >> dn_rt_hash_table = (struct dn_rt_hash_bucket *) >> - __get_free_pages(GFP_ATOMIC, order); >> + __get_free_pages(GFP_KERNEL, order); >> } while (dn_rt_hash_table == NULL && --order > 0); >> >> if (!dn_rt_hash_table) >> > This might OOM under pressure. Sorry, I do not understand this. Could you please explain the reason? > This would need __GFP_NOWARN | __GFP_NORETRY I guess, and would target net-next > Do you mean __get_free_pages(__GFP_NOWARN | __GFP_NORETRY) or __get_free_pages(__GFP_NOWARN | __GFP_NORETRY | GFP_KERNEL)? Best wishes, Jia-Ju Bai