From owner-dev-commits-src-main@freebsd.org Thu Mar 11 17:13:44 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6CA4057C1A0; Thu, 11 Mar 2021 17:13:44 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DxFsN2ftqz3Lmc; Thu, 11 Mar 2021 17:13:44 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from John-Baldwins-MacBook-Pro.local (ralph.baldwin.cx [66.234.199.215]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id B5A7CE5A6; Thu, 11 Mar 2021 17:13:43 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Subject: Re: git: d1cbe7908986 - main - Allocating the LinuxKPI current structure from an interrupt thread must be done using the M_NOWAIT flag after 1ae20f7c70ea . To: Hans Petter Selasky , Konstantin Belousov Cc: src-committers@freebsd.org, dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org References: <202103100952.12A9qRKR040117@gitrepo.freebsd.org> <2b1739ab-000c-ca28-5a59-0a3e19ef4591@selasky.org> From: John Baldwin Message-ID: <5aaa5f2a-a67d-a495-7f56-a6b31c2494c7@FreeBSD.org> Date: Thu, 11 Mar 2021 09:13:42 -0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:78.0) Gecko/20100101 Thunderbird/78.7.1 MIME-Version: 1.0 In-Reply-To: <2b1739ab-000c-ca28-5a59-0a3e19ef4591@selasky.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Mar 2021 17:13:44 -0000 On 3/10/21 2:09 AM, Hans Petter Selasky wrote: > On 3/10/21 11:04 AM, Konstantin Belousov wrote: >> This probably hangs machine instead of panicing. In low memory condition, >> you do not handle interrupt, which probably mean that the source is not >> silenced, and after EOI the same interrupt will be generated again. > > Hi, > > This usually happens during boot. Another possibility is to panic() > there. I don't see so many options. Is there no way to pre-allocate this? That is, could we not have all ithreads invoke this during their initialization, and have the module handler for linuxkpi iterate over ithreads allocating one for each ithread during MOD_LOAD? I think there are few enough ithreads that allocating "extra" ones is probably ok. Alternatively, you could hook into the path when an interrupt is registered perhaps by passing some sort of INTR_LINUX flag or the like that causes kern_intr.c to allocate one for the associated ithread when the interrupt is registered. -- John Baldwin