Received: by 10.213.65.68 with SMTP id h4csp2707535imn; Mon, 9 Apr 2018 07:50:12 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/ZJgJtmS9zby5+9EaBDdO3ImICP3l17XOM4sFy7GtYUsDl5QLKVkGfbOY+31Ry2RiU5T+Y X-Received: by 10.99.123.80 with SMTP id k16mr25672321pgn.173.1523285412721; Mon, 09 Apr 2018 07:50:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523285412; cv=none; d=google.com; s=arc-20160816; b=DUpz9ie0sP350FvyH/THkGBFbmpUUiRgcF+MYAx6/nuQN9P33VpqtzuOgsD2O0gsKd GNMSFXmhQpWT79r7uVjE9AyzYrY+SNQQnXrYeSCMYAz6Ze7u3Vl+WF6O9tr4NNs62/iS TbDdgmbarFbLQy2cPdt+1DSyxpyBSSxDwulI16GNlE5tWCpmblpz6kOB5h92z4xhipFU IKmvDFlbC2E28tBQb/KDM4l+cIpRZXH/jl1KCh5gEzYPo6nHCbLrqSEyJ+NB/Wf7+gna 4uetz/cLVVw3U5fJYn3R6NeYqsvPYnGwXrfDmjKaOuo9wL8Vuunx4Ybc4FZG0pC+1xT/ qC5w== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature :arc-authentication-results; bh=udJYvhIKlluntyILOKUxInQhEUR1IloRho6UF6gAb98=; b=jHEcAJStKcp84qPRgVaVAAAeknVF2lB9Vmk9tOnQqcys48GcDFB1NNoYcUwifpQGoM l4fG+ZEaHk63oA084zNOQctQFPwVwqBnBxEG11bFQ3gHhbSaANJwsKg33ce93xl04az9 2n5KizWST6tDgWsOxbqnjHy00Rjw0KVu+1abOx14DGM38CUGXZB/BDy/O4zoF2boJe3h QfIUByKchv1cnbRVxlG1TqnK1RSNQoxSAH4q91wMskxnGa5Gm4syQnlv2+5qvg6JahrW ZxcXPCbqJlob2ytOiUgypOUvs1oepNBUxaUO1kYX/slIy9Z6RrW5qPnOFHVCl2hJu8V8 RwoQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=oUHuGNhP; 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 j16si313261pga.720.2018.04.09.07.49.35; Mon, 09 Apr 2018 07:50:12 -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=oUHuGNhP; 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 S1753134AbeDIOoz (ORCPT + 99 others); Mon, 9 Apr 2018 10:44:55 -0400 Received: from mail-qk0-f196.google.com ([209.85.220.196]:42721 "EHLO mail-qk0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750759AbeDIOox (ORCPT ); Mon, 9 Apr 2018 10:44:53 -0400 Received: by mail-qk0-f196.google.com with SMTP id b198so9532567qkg.9; Mon, 09 Apr 2018 07:44:53 -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-language:content-transfer-encoding; bh=udJYvhIKlluntyILOKUxInQhEUR1IloRho6UF6gAb98=; b=oUHuGNhPmtGzaq3MLjMhtXq0FW7wbmGeV2RGzhikggShqN1EVeQ2/gkJ/Oq69G70sM WVZtTpWEjBf0k5kH82yg8WTR4fZrJSlM6r1Q9YcG44W5OcJ4kMMEJAUjvCTQ6gwPa+lN TkUxFnYok7uO/FyuaDnohFJ4lmd6zstX+y1eXLtPOyGD8FCHFHIM5gpxgGv2CUgAf9j1 3UR6msSLwJ9z2MWQ65YYvprlye2V/ryYdjPuKN9/zXl2AnHdENMZSgYTLkExUkb6546t 3BmX7DQAMEfI9EN6gFMulUJzYU6KwgETH1Im6VkZOG9BJfvhoRDKAHZGArAnXcP9S2Kh gkgg== 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-language :content-transfer-encoding; bh=udJYvhIKlluntyILOKUxInQhEUR1IloRho6UF6gAb98=; b=Qqp85WCiy5lYwoRcaky5yWOp8N/C/IZCQbQn9I+x1o7dWYHxC9qrPXFsR5VYab6FYP HAuaEeBKgh+gJCKLv3IXvwUaGvIP310y3Le7VrgQ2mgj6IWLeKvVeA320XBQ0fUrk1lf 7ly8rMaxNriUNQGeElL6ZjFXcdKD3PHAHc9M0JcJwb5dbNVZFvk4PC4d/N4F2YXcCkyO fIDutJFnJOZMua/t8F1aEIg6ot/HvmHmHTa/t7VGeHd+4iEUOi3SZAPQLbeETZOYvFea 1WEnQDL6cgByYlxH49Y8LKB9eB5jYW/KHeixZnH7R5/jkHi9lKS3n61H4+vmerj09xh2 rWVQ== X-Gm-Message-State: ALQs6tB1XYboRSCVO6DeWdCENt6oQJ6OKcUMhiOMNR8xMlYk9GD17DOW B0BIds3FdfbM9vTI3Pqj47wIb91K X-Received: by 10.55.92.198 with SMTP id q189mr25002367qkb.63.1523285092972; Mon, 09 Apr 2018 07:44:52 -0700 (PDT) Received: from [192.168.86.235] (c-67-180-167-114.hsd1.ca.comcast.net. [67.180.167.114]) by smtp.gmail.com with ESMTPSA id u79sm409133qki.10.2018.04.09.07.44.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 09 Apr 2018 07:44:52 -0700 (PDT) Subject: Re: [PATCH] net: decnet: Replace GFP_ATOMIC with GFP_KERNEL in dn_route_init To: Jia-Ju Bai , 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> From: Eric Dumazet Message-ID: <945ed4f2-e1e2-a038-2808-f18a79a35732@gmail.com> Date: Mon, 9 Apr 2018 07:44:49 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <1523283035-25639-1-git-send-email-baijiaju1990@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. This would need __GFP_NOWARN | __GFP_NORETRY I guess, and would target net-next