Received: by 10.223.185.116 with SMTP id b49csp3828610wrg; Tue, 13 Feb 2018 08:21:26 -0800 (PST) X-Google-Smtp-Source: AH8x225ac4s40358h5ncFqTJWiBvhrUfpyXZnwD2ipsAFB+T+Qtuh9jSLMt9W2SjB5zp75bvQjoU X-Received: by 10.99.99.2 with SMTP id x2mr1414956pgb.406.1518538886746; Tue, 13 Feb 2018 08:21:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518538886; cv=none; d=google.com; s=arc-20160816; b=dMOtcID2b/5/BtKwavcxeYneRzsova04fbZh5dg2TgEN51fkSiEhpvpsDJZO4WuGNb 4rl4iS+5qo9YvR5SHURNPBo6LJzvgDFWFfKZTj/kP2MhJA2UIaB8PJpkxnhIL5ohELlr Dx7QVJrQu9fQ7uJpUud3cV8CbxD+596nPjVzYbSDxuM4BVed0RkZVzf1LOpJvYFMs2Jp IIZ9lzndaF399hMylhq1xId1j7JZGy6Gv+Io6wI+9A6D9I/s5p11fr3lh+/OSHFAkfgt lWumlQ3mL9z0huBFSVJPhxxc3v3PtNgEW1TYiiY9Nw0QDDM+5mOIq4HoInReuT4nCMen SR0A== 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=gGdHBqC4X3mhiupYGZvUETzxn4pUaKfXbksop+82g6I=; b=GbDs5ROtE8FYkp5V7iDHlvahsAiOf6ZQowNoNFR65ZBa8+dOK9kZJXsuK2nDxJ81u7 2BHq4eLNv6rgd0fJoFCS9Eh+5OFhRXCQmQgheUFBrFt/59VqQQvXRRJwHS1YL45dwpOn et5noi0lDu+/H4kBX3ikfYZtd+7hGrqB0818aC9VoZMwqHBpnWhUKJV0droPykQpwn1v VnttqPE8t19hCKc+uqf+Y4wMQj2DkhiJTXjcmpyd7gwzY5fPWErgjpNziLwart4JcTek LmgTtrArAk/Rl+Oa9zVIM7b9RZ2QKoZ0VopfOiMZv8TJ+rcoXQtSNVoWIbDh4MFzmsRc y/SA== 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 72-v6si5717574ple.299.2018.02.13.08.21.09; Tue, 13 Feb 2018 08:21:26 -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 S934627AbeBMQUX (ORCPT + 99 others); Tue, 13 Feb 2018 11:20:23 -0500 Received: from Galois.linutronix.de ([146.0.238.70]:50980 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933927AbeBMQUW (ORCPT ); Tue, 13 Feb 2018 11:20:22 -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 1eldGM-0004y5-CO; Tue, 13 Feb 2018 17:16:58 +0100 Date: Tue, 13 Feb 2018 17:20:18 +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: <20180213161659.aribhtrooupdv4m4@gmail.com> Message-ID: References: <1516758015-7236-1-git-send-email-baijiaju1990@gmail.com> <20180213155604.62ulolc34snh5n3p@gmail.com> <20180213161659.aribhtrooupdv4m4@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: > * Thomas Gleixner wrote: > > 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. > > Yeah, so at minimum there's a mismatch between the changelog: > > > > > The function __add_pin_to_irq_node is not called in atomic context. > > ... and actual behavior. What you wrote should be part of the changelog I suspect. Fair enough.