Received: by 2002:a89:413:0:b0:1fd:dba5:e537 with SMTP id m19csp829702lqs; Fri, 14 Jun 2024 07:00:49 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUXmoPytICEZ9jjlLwPBzGQhseQPouauNMASHz5oV8q25tskEhViyYeRKKCsXAELJCUyWmdh3iE9+5I285W9DT05OVEO+p8Lz4r8no1mQ== X-Google-Smtp-Source: AGHT+IFtFyln61wkN53Sby9caiVRXpUUHnY9WldClJu4a9U3q5yTIp3hikMo3NunvwURO0LsM7jk X-Received: by 2002:a05:6870:2c8:b0:254:94a4:35e2 with SMTP id 586e51a60fabf-25842b83561mr2758156fac.59.1718373649272; Fri, 14 Jun 2024 07:00:49 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718373649; cv=pass; d=google.com; s=arc-20160816; b=0K4hzo/MvuQ9v9Zg3I4Ejql/jImHO2d6Vw2wcc7u5L+4DuPAvzPY4hYHM3KNg92zGZ 34TsqnLb0eiVFcpdFu+2oFSquEQqr4/QTNcSAX6003SCHO86n2JRfkg+zpQZzPp/skmH sET5vCJoZMkmMr6eVK6uBjCEecGxvFqLJS8IdWW2xizkXq1DRQVWJ3H9Yw87zz8wgtEm FekZmt0zS2A+62AiKc8juHBIhwLWGa+qApYKTgt5xr/wpwIEae6lc0cHlTGmn8PwgxG6 ecqg+M5b3VqT2fDtjtAJhHYEG2+SBiF+5bAZnGJp3fuLpNPbdCgnNzqjzZEQWqQbdoBH odHg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id; bh=FZb6vvNrZtqpQjXugnIpb2IwuFvbmzOmzNcf27f1ay8=; fh=Fl2vOlIFU0+u88ML/btWuduXS3ofItsvSMXIuru1xEQ=; b=HqHFBsK9TMIct88ImPgGzfiXRGn4xRzh/2yULEUq9xj9GEnJY/IdnKzqof5WW3SMP2 EFcr4B0g76XdjkqaqtwFe/NRtuA3xe5B1SQ2Y8yDy0B/XXI1sY1kMPMHetaYsZ/fua4Z Q2dGFtGGmOPFDKclmeqw84xjnVSkwyLUMJkO07ikx/ugO1bi4I5884XDkS9yYJZKmUPP bdiNOZIowTmN0Hr68DNxbgdbZ/ZV98R8X3SsBaQUVYUh+YW2JxbvJ2E2fgh9qPyONVIk 4yw3oWwdvmAN/4JJvmeJhpbUCF1bUOz82laOcmwKIzV91dk7a3sbNYUXo+J9oiIgSh1a 1Hhw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-214976-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-214976-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id 586e51a60fabf-2569930fd50si1412504fac.227.2024.06.14.07.00.49 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Jun 2024 07:00:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-214976-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-214976-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-214976-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 6104B2858E5 for ; Fri, 14 Jun 2024 13:59:20 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id EAA428F59; Fri, 14 Jun 2024 13:59:15 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 163D079CF for ; Fri, 14 Jun 2024 13:59:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718373555; cv=none; b=rDqnRiYbn/fcBQoiOtoeAuOkYx80YVtmBNIh/BZkv6e77Ge8yHEyEk0nh7dLyP/J9oT7QFjzyhy/80piTj9IE3m0m6DY8J2uGMroQRim6AbD0X7ODQicmDCP/HESaNGiX6zDpldSMxTiZBEGTaR9BZAK7UHylxiVoG+nWZvpI3c= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718373555; c=relaxed/simple; bh=O8rQAoZh+GFQusD52/AxHZGlDyQ2BNovWAmx80/SfT8=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=TxLXgsaDdAw/xaIpg4F/3myR3gGyekQNkyDFwDFyRGMg/YVDPmY1sLxh08MVzgYhmwB4yhJOmof77Vj4/UWNfjGzMJVgiyC0Me1WFntNiuZPUR2Nu7Y2ZuSNEYJ0PhrPZSr/t8IGFWinAsBYos2HNtrl94FjQj2bEh5gk/Mrdu0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 0DE8FFEC; Fri, 14 Jun 2024 06:59:38 -0700 (PDT) Received: from [10.1.196.28] (eglon.cambridge.arm.com [10.1.196.28]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 1BB913F5A1; Fri, 14 Jun 2024 06:59:09 -0700 (PDT) Message-ID: Date: Fri, 14 Jun 2024 14:59:09 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v1 28/31] x86/resctrl: Drop __init/__exit on assorted symbols Content-Language: en-GB To: Dave Martin , Amit Singh Tomar Cc: Reinette Chatre , x86@kernel.org, linux-kernel@vger.kernel.org, Fenghua Yu , Thomas Gleixner , Ingo Molnar , Borislav Petkov , H Peter Anvin , Babu Moger , shameerali.kolothum.thodi@huawei.com, D Scott Phillips OS , carl@os.amperecomputing.com, lcherian@marvell.com, bobo.shaobowang@huawei.com, tan.shaopeng@fujitsu.com, baolin.wang@linux.alibaba.com, Jamie Iles , Xin Hao , peternewman@google.com, dfustini@baylibre.com, David Hildenbrand , Rex Nie References: <20240321165106.31602-1-james.morse@arm.com> <20240321165106.31602-29-james.morse@arm.com> <47af4fef-35d3-4d88-9afa-42c1a99fbe07@marvell.com> From: James Morse In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Hi guys, On 02/05/2024 16:58, Dave Martin wrote: > On Wed, May 01, 2024 at 09:51:51PM +0530, Amit Singh Tomar wrote: >>>>> I think James will need to comment on this, but I think that yes, it >>>>> is probably appropriate to require a reboot. I think an MPAM error >>>>> interrupt should only happen if the software did something wrong, so >>>>> it's a bit like hitting a BUG(): we don't promise that everything works >>>>> 100% properly until the system is restarted. Misbehaviour should be >>>>> contained to MPAM though. Indeed - all the reasons for the MPAM error interrupt being triggered indicate a software bug, so re-mounting resctrl with the same buggy code isn't going to fix anything. >>>> if "resctrl" is nonfunctional in this state, then this comment[1] here does >>>> *not* make sense. >>>> >>>> "restore any modified controls to their reset values." The MPAM driver goes on to reset all the MPAM hardware to the best of its ability. These means everything gets set back to 100%, so its as if MPAM is not implemented. This is better than throttling the wrong task because an out-of-range PARTID for ${important_task} is using the configuration of ${background_process}... >>> Can you clarify what you mean here? >> >> What I meant was, What's the rationale behind restoring the modified >> controls, if user is going to restart the system anyways (in order to use >> MPAM again), but later realized that it is needed so that *non* MPAM loads>> (user may still want to run other things even after MPAM error interrupt) >> would not have any adverse effect with modified controls. >> >> Therefore, taking my statement back. > > Ack: we can't force the system to restart without losing data. Really, > the decision about when and whether to attempt a graceful shutdown or > reboot should be left to userspace. But until userspace does shut down > the system, we do our best to behave as if the broken part of the system > (MPAM) were not present at all. Dave's systemd choking on this angle is interesting - I'll go experiment with this. The alternative here is to delete the __exit text completely as it can't be run, and instead get MPAM's error interrupt to disable the static-keys and return -EIO for every call into the arch code. I didn't do this as its likely to cause extra churn to ensure that every arch helper can propagate errors back to user-space, and this seemed like a good (re-)use of existing code. The third option was to not do anything in MPAM, and just print a message to say bad things might be happening. Given its extra work for hardware to detect the error conditions, I previously assumed no-one would do this, and hardware would just 'go wrong' instead... but as someone has built this, it would be good to try and react to it. Thanks, James