Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp413395ybk; Wed, 20 May 2020 02:53:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyhjxd8UNpiq8hyvV3jpBpK8K6lxtZ96vlvkuiyojcA61y4jupxU5IHQl4gCLzxw63GvkIc X-Received: by 2002:a17:906:6a43:: with SMTP id n3mr2889670ejs.33.1589968384244; Wed, 20 May 2020 02:53:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589968384; cv=none; d=google.com; s=arc-20160816; b=Woi6EYCLGyzgAKP0LX7mIuzhENfCcdDPbZPJYU1HrsCUjakKu92470t2YnbK3J3Xss qiuJSEcUIYknA8ABika9ZYc7cCiqF297p9P+XkPqRQaH7aTA+e2Aw6nNOmG+GF691yqR DQ66sAtvcdyYxsQn4432K17xU8rDNMkJBGBclTa/9T5pXrc1HABg8cd5zqPTkQYOrp4p u8qGzg75mVh8nbU+d/VGkhAS5EoNBFhIBkCu6F0HhhnEmB0GZwax+QJR53qjVu0sY2ET P1i2/Xfzxe1fLa1oaWy4RaIGhmy2AVW7ssV3wjatQmq5WS61f/FxZDO+sKeRqijewnqm x67w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:user-agent:references :in-reply-to:subject:cc:to:from:date:content-transfer-encoding :mime-version:dkim-signature; bh=q+dzjvOZa0SmZUWFy08oQOvkakk4B06Hv+TlUVkE618=; b=cwAKLqKSVOWqeaoWvVoEVSEd62DIj0JjEBoVQzSG2cFM0lNqjHI5haJ2t27qJQvV7O HqcpDDwGMK+JBFKCO7bXnn5PVeq5SiXILLjGCHRrSHH5swe7q3C3bSBWn5Bpgc8Dblt5 69b6pZw3ixKM8Dp9Wx/RYDwNXjxM8PO14J1sliReKPDmPYNcu03XJSam45JZ1LDYYQmn 4RIImQXfohO7sv3y76hTOM4wRBxMggTUEaPptAusT/JbTlt1dg+E2gJHR9WUp65wvD3r xiZY7YWybm3qOhCK9f9HWtU7EagcEluiFaTZxIwzZJqw6bYTrqCEE+LYNkKE+EoFKFZ7 l+LA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=S5Vh1MMq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x15si1128363ede.370.2020.05.20.02.52.41; Wed, 20 May 2020 02:53:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=S5Vh1MMq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726576AbgETJvR (ORCPT + 99 others); Wed, 20 May 2020 05:51:17 -0400 Received: from mail.kernel.org ([198.145.29.99]:46446 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726224AbgETJvQ (ORCPT ); Wed, 20 May 2020 05:51:16 -0400 Received: from disco-boy.misterjones.org (disco-boy.misterjones.org [51.254.78.96]) (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 E245E2070A; Wed, 20 May 2020 09:51:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1589968276; bh=I05Xto4txiriKlSQmPh36CUF6ZigsJtHe1MV6gwtr0U=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=S5Vh1MMq9WJW18SFE3kUQ8DtR8pbNSiT3Ru/nq0BUk3EydRVMxyVGi4Qgna5ySx1x GqWO0lWjvCDXqz0/JOtjLr8fGgRQJKeGER+jFvbKxfLyua4Uyh8kSV3ZN27k6hI1BW CNsiSQ8J4Ykr6uK6QILOCF6bf650ZaRATlvwSDhY= Received: from disco-boy.misterjones.org ([51.254.78.96] helo=www.loen.fr) by disco-boy.misterjones.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1jbLNa-00Dshk-89; Wed, 20 May 2020 10:51:14 +0100 MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Wed, 20 May 2020 10:51:14 +0100 From: Marc Zyngier To: John Garry Cc: Qian Cai , Stephen Rothwell , Linux ARM , Linux Kernel Mailing List , Linux Next Mailing List , Thomas Gleixner Subject: Re: BUG: sleeping function called from atomic due to "Balance initial LPI affinity across CPUs" In-Reply-To: <81796a6e-718a-aa93-d183-6747e0654c8c@huawei.com> References: <81796a6e-718a-aa93-d183-6747e0654c8c@huawei.com> User-Agent: Roundcube Webmail/1.4.4 Message-ID: X-Sender: maz@kernel.org X-SA-Exim-Connect-IP: 51.254.78.96 X-SA-Exim-Rcpt-To: john.garry@huawei.com, cai@lca.pw, sfr@canb.auug.org.au, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-next@vger.kernel.org, tglx@linutronix.de X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi John, On 2020-05-20 09:43, John Garry wrote: > On 19/05/2020 23:09, Qian Cai wrote: >> Reverted the linux-next commit f068a62c548c ("irqchip/gic-v3-its: >> Balance initial LPI affinity across CPUs") fixed these warnings during >> boot, > > Thanks for the notice. So we need the following set to see this: > CONFIG_CPUMASK_OFFSTACK=y > CONFIG_DEBUG_ATOMIC_SLEEP=y > CONFIG_DEBUG_PER_CPU_MAPS=y Ah, thanks for pointing this out. >> its_select_cpu at drivers/irqchip/irq-gic-v3-its.c:1572 >> >> [ 332.819381][ T3359] BUG: sleeping function called from invalid >> context at mm/slab.h:568 >> [ 332.827405][ T3359] in_atomic(): 1, irqs_disabled(): 128, >> non_block: 0, pid: 3359, name: irqbalance >> [ 332.836455][ T3359] INFO: lockdep is turned off. >> [ 332.841076][ T3359] irq event stamp: 0 >> [ 332.844836][ T3359] hardirqs last enabled at (0): >> [<0000000000000000>] 0x0 >> [ 332.851828][ T3359] hardirqs last disabled at (0): >> [] copy_process+0x98c/0x1f34 >> [ 332.860710][ T3359] softirqs last enabled at (0): >> [] copy_process+0x9c0/0x1f34 >> [ 332.869586][ T3359] softirqs last disabled at (0): >> [<0000000000000000>] 0x0 >> [ 332.876560][ T3359] CPU: 155 PID: 3359 Comm: irqbalance Tainted: G >> W L 5.7.0-rc6-next-20200519 #1 >> [ 332.886563][ T3359] Hardware name: HPE Apollo 70 >> /C01_APACHE_MB , BIOS L50_5.13_1.11 06/18/2019 >> [ 332.897000][ T3359] Call trace: >> [ 332.900151][ T3359] dump_backtrace+0x0/0x22c >> [ 332.904514][ T3359] show_stack+0x28/0x34 >> [ 332.908543][ T3359] dump_stack+0x104/0x194 >> [ 332.912738][ T3359] ___might_sleep+0x314/0x328 >> [ 332.917274][ T3359] __might_sleep+0x7c/0xe0 >> [ 332.921563][ T3359] slab_pre_alloc_hook+0x44/0x8c >> [ 332.926360][ T3359] __kmalloc_node+0xb0/0x618 >> [ 332.930811][ T3359] alloc_cpumask_var_node+0x48/0x94 > > We could use GFP_ATOMIC flag at the callsite here, but maybe there is > a better solution. I don't see one, and I doubt it is worth the hassle to have anything but GFP_ATOMIC. The default arm64 config is to have on-stack cpumasks, and only DEBUG_PER_CPU_MAPS allows this to be changed. I'll stash a patch on top. Thanks, M. -- Jazz is not dead. It just smells funny...