Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp4304490pxb; Tue, 10 Nov 2020 13:00:36 -0800 (PST) X-Google-Smtp-Source: ABdhPJzvvaYARAszePyvDtIX7zBs15zJspI1IqFEmEiqdPeCXjS1VK7c9yIwj2Ma6JH/spGgRPV5 X-Received: by 2002:a17:906:415a:: with SMTP id l26mr21369444ejk.442.1605042036690; Tue, 10 Nov 2020 13:00:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605042036; cv=none; d=google.com; s=arc-20160816; b=bo1+f/oiSe0ZhWxtgOLF6eFz3pFCQ0gEUtH8eDCYKyn657egc2pSFe0UnzvrIcaCOe bpoD3j1739PQyUaQrox4HSb8WGcnThAQ9XxIcrlPha4VT5sLywxkLUQwuIrfVb3Xn9Y5 bcid91e3MqHVOhwN1ZcECGQKeFczckt7VIl4rjYxfpcmscJSzBERbmcxvfL2xMSDtbJ9 1qjpGyvpDUFZImfyhB7AyOhWOol8YXJ0/7AEvez00PTEewSZtQLOMRmtAW8t9kbEEqEl wLpHAFKFfrFw6utKANe+rmCJfficWYgwmlHdgzNGiGz3byYTWa4IAjbFYMfUPFa4+tdb ksaw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:references :in-reply-to:subject:cc:to:dkim-signature:dkim-signature:from; bh=F3OCDDykxm75oQ+X0v+Bq8zz0zI84NXCyUalM/m2yK8=; b=dkM7P+CQxiha3NOZejzW7O82HJ/POY3b/e8dqil2KKOJQKSZTf4Z3TvquNZrVgotBl n20UjZ+56RIdiGMknHHEjlwJgqy86z5lll1B5Gy5E5qhjYibDjfaq0+2Do5Suj50Kish vcvysqQL+xNp94Y2OpTbu/7Zi+sd3/nme3Voci+CmrexayRUj0czIT7zIeIavNLAiwzv AxExfd1yIXNKnYHh8wrUDaBZXs0TnIxJ14me50Zv76qtqC2IQgfqXFQ+DIzcH+E/NZct zEfTm0pZEW63+4l+2J4E9lNE5VWCRqJFl0WoDGc2bMN2iuEazU898E6d1H6QRijjNqiQ i7Fg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=y06k4RY7; dkim=neutral (no key) header.i=@linutronix.de; 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=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j5si7846809edl.250.2020.11.10.13.00.13; Tue, 10 Nov 2020 13:00:36 -0800 (PST) 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=@linutronix.de header.s=2020 header.b=y06k4RY7; dkim=neutral (no key) header.i=@linutronix.de; 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=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731711AbgKJU4e (ORCPT + 99 others); Tue, 10 Nov 2020 15:56:34 -0500 Received: from Galois.linutronix.de ([193.142.43.55]:60912 "EHLO galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730618AbgKJU4e (ORCPT ); Tue, 10 Nov 2020 15:56:34 -0500 From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1605041792; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=F3OCDDykxm75oQ+X0v+Bq8zz0zI84NXCyUalM/m2yK8=; b=y06k4RY7XCZk4viumC4BENASSjmi6BBNWoavsw6bsqU5UpEt3YJ+pz4WwXdPmSIQMo9i4z +pdihdGLS7kVgY86X+CuTdhuGOC39FCjdxqz1o+1EXfFBXp4iY6PooFwSHYcnVI+dVSqjR cotEZperNJEQXogbbP7SMe/bR2W3vVZaJ23oEvKzLpYdmEjIsl1HExZKTLZt0Z/imqHYdG 5LDfLZi2c6i3iUX3vP2BQzricabmv3ivqpFiYG/2DXMpG45ku8ugA5OqtMwDC5mEaoYJQi bl9uC9wEZBvoEZxiixJQ3iAevxYNY/O4XM1cAEBYZPMaynRfQZoFv/Z0/fdxyQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1605041792; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=F3OCDDykxm75oQ+X0v+Bq8zz0zI84NXCyUalM/m2yK8=; b=8vc6N5Q7IQ+rrgQ3vqfUqYLHmBWbu1M/XlnUY6QV92mos6uDdr4isiMQqhgDIQKs1JVkqd 8GHL6CAnY6VZUqCg== To: Prarit Bhargava , linux-kernel@vger.kernel.org Cc: Ingo Molnar , Borislav Petkov , x86@kernel.org, "H. Peter Anvin" , Marc Zyngier , Andy Lutomirski , Ming Lei , Peter Xu Subject: Re: "irq 4: Affinity broken due to vector space exhaustion." warning on restart of ttyS0 console In-Reply-To: <3ba26c8d-04ac-1822-d5c2-4a8906f7fd9a@redhat.com> References: <3ba26c8d-04ac-1822-d5c2-4a8906f7fd9a@redhat.com> Date: Tue, 10 Nov 2020 21:56:27 +0100 Message-ID: <871rh1gcck.fsf@nanos.tec.linutronix.de> MIME-Version: 1.0 Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Prarit, On Tue, Nov 10 2020 at 14:24, Prarit Bhargava wrote: > Occasionally when logging out of the ttyS0 aka serial console I see that > > irq 4: Affinity broken due to vector space exhaustion. > > *** console shutdown, IRQ released for cpu on socket 1 > *** console starts back up again, IRQ assigned to on cpu on socket 0 > > In this process, however, the smp_affinity is not cleared for IRQ4. That is, it > remains as > > /proc/irq/4/smp_affinity:ffffff00,0000ffff,ff000000 > > so that the check in activate_reserved() fails and > > "irq 4: Affinity broken due to vector space exhaustion." > > is output to the screen. > > I am not sure of correct fix here. It looks like the smp_affinity should be > reset to default at irq shutdown, however, I cannot determine if that should be > done for every IRQ, or (hopefully not) per driver. This has been that way forever and there was a discussion about this at least 15 years ago. I can't find it at the moment because I can't access my archives and I failed to find the conversation on lore. But here is the gist: At some point I actually wanted to reset the affinity mask to the default affinity mask in free_irq() when the last action was removed. That broke setups where the affinity of the serial console interrupt, was set to some specific CPU by the admin and then it was moved to some other place due to logout -> shutdown -> startup. So we left the historic behaviour untouched. So now you are complaining about it the other way round and I have to tell you that there is no correct fix neither in the core nor in a driver. The real problem is irqbalanced aggressively exhausting the vector space of a _whole_ socket to the point that there is not a single vector left for serial. That's the problem you want to fix. Thanks, tglx