Received: by 10.223.185.116 with SMTP id b49csp3820317wrg; Tue, 13 Feb 2018 08:14:30 -0800 (PST) X-Google-Smtp-Source: AH8x225QyihzXJ5OVweDHdSDJKXq8NCt2jNwDv+XbEtPJu771lATWbxVUEyuLA3Ghwwsqeiaghoc X-Received: by 10.99.126.19 with SMTP id z19mr1382353pgc.108.1518538470117; Tue, 13 Feb 2018 08:14:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518538470; cv=none; d=google.com; s=arc-20160816; b=wQpASDaZrSt0oA4HHbxPQjUjTgGP/5YBH797n1yqvpbW7V9bCkZA0PWVOAAECLlZS/ Ms0pP7Jrx/cMtS8PQdSOldtxdDsldFLfZlRKjTL2Xwx+DNL2GCHa3S67d8bdAYc0dtRM wZjKFhOTCSwFAelIM94XHsP0or2EbNUrDwh3ciBjWurG3Jve2Lo5eyVBEbRMr8d5UPka nTG3Ud9dIqzJyVhFplWJP+dT9ntvyetxI51M0h2v6Xc9kHw4Z55vv7DDLZEVKD15GcAr lLP5Ay+yxoVZtaQFmM9gpaiDPmDeaqsHzoG7VfRFACyuVRc1hElIovxOdiaz25Ir25j6 6XmA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date :arc-authentication-results; bh=qxglXru7chsQYzFkVctFcGD8dEsQVAhqbBLYyDDW9/Q=; b=t97IvazW65hEGtG6erm/R3xbRxq06iH5qRQoTx9HTGcxBKJK6GXVMShbQ5Fmo38u/3 wrddRua84Ir22x0N/BS9w43DIGotoPUlTLfSkfqZLvK3ySCkLrY+I6wfPnBqe0iGNEPx 9OAvO4ZEiRnjursuR5TMqPWO4DsSZGbKa3eFdZG1udU8w4iPh+LdAnMym0mLE3c7DXeG e6Y6qL6K3K/J1M2yqm+Vg1yl/UJ7KD4Lzjq9p5DSUpvdvKjNEbpfZE/ltBoBCTTyBcWC pral6isrSmP2xyD+Yj1LIs8Wwov+XoxK6mrrP8drWmGDr0j9VN1/+O4XkVpBOWBS/VLJ Ks/A== ARC-Authentication-Results: i=1; mx.google.com; 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 a28si3023486pfl.54.2018.02.13.08.14.15; Tue, 13 Feb 2018 08:14:30 -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; 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 S934780AbeBMQNA (ORCPT + 99 others); Tue, 13 Feb 2018 11:13:00 -0500 Received: from Galois.linutronix.de ([146.0.238.70]:50950 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934415AbeBMQMr (ORCPT ); Tue, 13 Feb 2018 11:12:47 -0500 Received: from hsi-kbw-5-158-153-52.hsi19.kabel-badenwuerttemberg.de ([5.158.153.52] helo=nanos.tec.linutronix.de) by Galois.linutronix.de with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1eld8R-0004rr-G8; Tue, 13 Feb 2018 17:08:47 +0100 Date: Tue, 13 Feb 2018 17:12:08 +0100 (CET) From: Thomas Gleixner To: Ingo Molnar cc: Jia-Ju Bai , mingo@redhat.com, hpa@zytor.com, jgross@suse.com, douly.fnst@cn.fujitsu.com, kkamagui@gmail.com, gregkh@linuxfoundation.org, mka@chromium.org, linux-kernel@vger.kernel.org, x86@kernel.org Subject: Re: [PATCH] kernel: x86: apic: Replace GFP_ATOMIC with GFP_KERNEL in __add_pin_to_irq_node In-Reply-To: <20180213155604.62ulolc34snh5n3p@gmail.com> Message-ID: References: <1516758015-7236-1-git-send-email-baijiaju1990@gmail.com> <20180213155604.62ulolc34snh5n3p@gmail.com> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 13 Feb 2018, Ingo Molnar wrote: > * Jia-Ju Bai wrote: > > > The function __add_pin_to_irq_node is not called in atomic context. > > Thus GFP_ATOMIC is not necessary, and it can be replaced with GFP_KERNEL. > > > > Signed-off-by: Jia-Ju Bai > > --- > > arch/x86/kernel/apic/io_apic.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/arch/x86/kernel/apic/io_apic.c b/arch/x86/kernel/apic/io_apic.c > > index 201579d..665c013 100644 > > --- a/arch/x86/kernel/apic/io_apic.c > > +++ b/arch/x86/kernel/apic/io_apic.c > > @@ -379,7 +379,7 @@ static int __add_pin_to_irq_node(struct mp_chip_data *data, > > if (entry->apic == apic && entry->pin == pin) > > return 0; > > > > - entry = kzalloc_node(sizeof(struct irq_pin_list), GFP_ATOMIC, node); > > + entry = kzalloc_node(sizeof(struct irq_pin_list), GFP_KERNEL, node); > > if (!entry) { > > pr_err("can not alloc irq_pin_list (%d,%d,%d)\n", > > node, apic, pin); > > NAK: this is called in an atomic section: with IRQs disabled ... The only invocation where this happens with IRQs disabled is the early check_timer() code which runs _before_ the scheduler is working. GFP_KERNEL is valid during that phase. All other call sites have interrupts enabled. Thanks, tglx