From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 57B85C433DF for ; Sat, 17 Oct 2020 01:11:13 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D12EC208E4 for ; Sat, 17 Oct 2020 01:11:12 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="MbA7MMgC"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=marvell.com header.i=@marvell.com header.b="Rr9eMy9h"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=marvell.onmicrosoft.com header.i=@marvell.onmicrosoft.com header.b="iU3GfC4n" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D12EC208E4 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=marvell.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:Content-ID:In-Reply-To:References: Message-ID:Date:Subject:To:From:Reply-To:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=z0Ux6boI3srWjTGcAko9W4UHBm7sgvS33agbLekhPeU=; b=MbA7MMgC9eR7V/GZ28qZ9Hidb wuEAeQBk4+9StG5hvmtAkV4jNr/aIRTN4UeT7SB00+GBF+47veuavZg0MBrs1Ljo+gql+ntJrQu2z qZ8796Goe0jkdiEpgPMTx8AZCV3whp14rcU7TLRqutulYZccjsREC7o1SA4yGfYsA/VCSmzr+Wjzo 1zVrFgK0FfwcMt4jpMOtMcMVriRgOiyefL1a9ilH0A2O1OR3gUeVEpCE0IYgjCXhlm9aXyhv9Z7GC IX1l0plfGZ/COICW9QDqSIfeZHWQphjjKwrodJO+RYMNSeyWBX9eJhe6J0r4x4HfPwjF63RlfWjw8 /iQFKFgdw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kTaij-0006N8-S1; Sat, 17 Oct 2020 01:09:17 +0000 Received: from mx0b-0016f401.pphosted.com ([67.231.156.173]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kTaih-0006Mi-9a for linux-arm-kernel@lists.infradead.org; Sat, 17 Oct 2020 01:09:16 +0000 Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 09H0ovQd010969; Fri, 16 Oct 2020 18:08:26 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : references : in-reply-to : content-type : content-id : content-transfer-encoding : mime-version; s=pfpt0220; bh=EDOZu0LlohVHOe6pDFJ2pBFL/gQjBbDi+hMpuygOAvM=; b=Rr9eMy9h+43yhSHXfQN95KyhONURKfTXHz3CJJVKTNvcw8imLHT7JbmwMZg1tdTXArRF 2UenHTPqTgw64cyNGBpiLQQUbNVLQKjIitqgzHaAfaHCHAA+uiX6ocNNI9zPKwt/5Vb2 FluGO3OwlfD2r36kxqj/BE8yaTrKZxKKhQj9cblBJhSleKsBwvkkscN9+P5/eNFu/ecN GyeiLbYpVY3e2FXTGJ6uEHYXAPhagBz93akqWYdmx6EGIppj4zFDRYvOfDkSxU+SHpHQ /zAHuvfcV6ezl+HEjodN4+fZmahtGv0etVzVqFGskHp5VjuNNmQZJwF54tYXouZS9y+s Fg== Received: from sc-exch03.marvell.com ([199.233.58.183]) by mx0b-0016f401.pphosted.com with ESMTP id 343cfjrsj1-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Fri, 16 Oct 2020 18:08:26 -0700 Received: from SC-EXCH01.marvell.com (10.93.176.81) by SC-EXCH03.marvell.com (10.93.176.83) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Fri, 16 Oct 2020 18:08:25 -0700 Received: from NAM02-CY1-obe.outbound.protection.outlook.com (104.47.37.56) by SC-EXCH01.marvell.com (10.93.176.81) with Microsoft SMTP Server (TLS) id 15.0.1497.2 via Frontend Transport; Fri, 16 Oct 2020 18:08:23 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hRROTGCbPqimSXofOvmI1dUPIIdNmH6qN5m0kONLrroGKnqUkNNrGrQgNOlWZHJvthv5cyhf9KEFNdwb+fT4hN0R5LSFoSbv9mYqevXAKsN+YFYL9GWBQV/8YtoESe5ILk7MllGzTmEvywgTvvWleRw6z4K2qr57miTeUOa0hCBy9j76TH1OUPaO+/5GL9Sjp2oIkgK63Is/KINl0tLugffSYvQ1ym/batQdaD9NG0XTSytX5l/R4vYvX6m45GN3efQnhzuVI+lletJN8NtBjRyZXbL2SZREIa1ROYgZffY/sb4xP4hodorQLj8JP+Cj8oM0KXUV0hPol6krcJEvrg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=EDOZu0LlohVHOe6pDFJ2pBFL/gQjBbDi+hMpuygOAvM=; b=NXEZ8rFuPiaAxpPYRPQrN8PEVgkoufYW9PNEsOcUmy9/nS49+5t00vt0D+dWPVTmb7Eb9Ltnoz63sdmw3b9XIOkBBvzcldqF+BkfsQpNRvNmCQG+5gxC3zTN5BHKbObGrOv5i7fENdUxec/GTou01wQXULAyO8+kIMbBwrq0W1oMe7M4YDbUjHlG8Dl86L+fpmw1tYg+ghQGenujKM8/CJE3GlBupfLUMu4Tj2sOoJOFSc8i6hAc2mZ8WJPZdkDR02kT7OzEhh6Bl316bD1ApFreHkGKsTh347tgnpXEiwwKvddSGJqniVaDQnRmtneBo8fxYlUf1MaOrZCC0mCvoA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=marvell.com; dmarc=pass action=none header.from=marvell.com; dkim=pass header.d=marvell.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.onmicrosoft.com; s=selector1-marvell-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=EDOZu0LlohVHOe6pDFJ2pBFL/gQjBbDi+hMpuygOAvM=; b=iU3GfC4nKlmu/qY1aBlmpsinE8jUYf4ecuA/z7TWK3U5zw84xWlRQC58DagttE20wvplaMWtnRpJQ5YVeXTe6o4+t1mleiGo8MWAVL9hmsy5B5o6KIQMaH4LiwY8n0h1ep8NjDkvSFGLqXPX+JmmgV1Ockfh214VQYZoxpX9i8k= Received: from MW2PR18MB2267.namprd18.prod.outlook.com (2603:10b6:907:3::11) by MWHPR1801MB1822.namprd18.prod.outlook.com (2603:10b6:301:6b::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3455.23; Sat, 17 Oct 2020 01:08:20 +0000 Received: from MW2PR18MB2267.namprd18.prod.outlook.com ([fe80::69b0:73ce:7112:3b95]) by MW2PR18MB2267.namprd18.prod.outlook.com ([fe80::69b0:73ce:7112:3b95%7]) with mapi id 15.20.3455.031; Sat, 17 Oct 2020 01:08:20 +0000 From: Alex Belits To: "nitesh@redhat.com" , "frederic@kernel.org" Subject: Re: [EXT] Re: [PATCH v4 03/13] task_isolation: userspace hard isolation from kernel Thread-Topic: [EXT] Re: [PATCH v4 03/13] task_isolation: userspace hard isolation from kernel Thread-Index: AQHWYDdZDqoeqvfF50CzG3l43t/UoamDNPAAgATEYwCAAI5YAIABSVeAgBGyj4A= Date: Sat, 17 Oct 2020 01:08:20 +0000 Message-ID: <91b8301b0888bf9e5ff7711c3b49d21beddf569a.camel@marvell.com> References: <04be044c1bcd76b7438b7563edc35383417f12c8.camel@marvell.com> <20201001135640.GA1748@lothringen> <7e54b3c5e0d4c91eb64f2dd1583dd687bc34757e.camel@marvell.com> <20201004231404.GA66364@lothringen> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: redhat.com; dkim=none (message not signed) header.d=none;redhat.com; dmarc=none action=none header.from=marvell.com; x-originating-ip: [173.228.7.197] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 2b328d48-849c-4df5-fea7-08d872392359 x-ms-traffictypediagnostic: MWHPR1801MB1822: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:10000; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: TgmW+Uv/DOmjdOsGwTsAr0NbrGLUTUTXUdo/wbCX9orYIJBlDHgy0ojUrVtbv5HPdXV/iRK6beTUYcOwY7xIMQpQJ7gC+NUXKxLkidBRG/ews45dCxZ3Z2PiH/kR/hIkZGOUgpj3e39Q4dQ7hvT6pEnzJXdBrqXe1KoYTsoe66sPxpY+s+wIPNNxFVc83FXFKoO+GtDzRZ4oNZYAes1p20fBFFJewL82FEqWBnD9BsmeEqNM02BWpK7IcSIY5MBGtvMKJ50dJHnVZMZ3tgNl0NH7YCcPinlEt3nRpYpLYMvhJzrgJA81KYMdS6TN4io2Y0pIUvisR/eV+HIk9EusNg== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MW2PR18MB2267.namprd18.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(396003)(346002)(136003)(39860400002)(376002)(53546011)(6506007)(66476007)(66556008)(186003)(2616005)(86362001)(6486002)(4326008)(76116006)(91956017)(6512007)(316002)(66946007)(7416002)(8936002)(71200400001)(66446008)(64756008)(5660300002)(54906003)(83380400001)(2906002)(478600001)(26005)(110136005)(8676002)(36756003); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata: C4eegixIrQpf70lhX7lXbF4MwSxt7RrWK5pK0drbB8J45x76xMUma53rBR3XexhSD7xXF4Z3Or8NHod96LxLJN535vZZtIMq6nXsifQoEIVFVC3MEIs1eTCVbYmfJHjwLaqJb4abqMBGitS6ZqKISfFilPDSp9zNKbsWt91ECfGjfLqD1yx6ByJJsgVuX/d94SWPSZJ+8x4rSkdBF/FR+CKSm1EZVJWdKAt8tYdR2qaMcUdu6DZv+Q4n0Yaq70gbEc81RBy60ofx5e/VKWwjeUZbjCH7lBVDW9bBBTzIfMDszt0kkUnoz6u6Mu4GnvtYvIk5iZsUjF2Dm+/Xjja15wvkHqJ9/fVWLAPS0431PjhjfBbnvwAf9OEIp40SObJrHsDQh4mksNaqUgw33oIeqXprNNE1+/KCSvnJP4ufCkbHUZq+Iv3doL+UjlHqUISs/+hkG8lK3qEH5whPqTFHRmq2s8YCQb+RCbkL5OwDatTuvqZEyj8ZFBscb40Xtri6N/PCIY9fKiexLjvJorvRdJMozYiN5lZzfN6zzhtCBHP1UvTy+5IFA1GzT8wt6UGnneJeGbp0zL2lw6RKEtDZrY0ujooIeMH8pSpjCYm+UyetYkqXfDaTB4ewT0ffDjv9mFCuEcn8Di6iddWMTZGsBw== Content-ID: <667B3873B7052043B22F58D0FBC4F61A@namprd18.prod.outlook.com> MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: MW2PR18MB2267.namprd18.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2b328d48-849c-4df5-fea7-08d872392359 X-MS-Exchange-CrossTenant-originalarrivaltime: 17 Oct 2020 01:08:20.3718 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 70e1fb47-1155-421d-87fc-2e58f638b6e0 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: hn1pI0iEhEH9X7+8v3+kWzwCLZkSVdZs6TG0MZAVkkCsP+R68M/Cx+M9ezsD6HZbyZ1v1480vnzay8yjHXiQmA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR1801MB1822 X-OriginatorOrg: marvell.com X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.235, 18.0.687 definitions=2020-10-16_12:2020-10-16, 2020-10-16 signatures=0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201016_210915_433377_5BAB74F1 X-CRM114-Status: GOOD ( 40.50 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "linux-arch@vger.kernel.org" , "peterz@infradead.org" , "linux-api@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "rostedt@goodmis.org" , "davem@davemloft.net" , "netdev@vger.kernel.org" , "catalin.marinas@arm.com" , Prasun Kapoor , "tglx@linutronix.de" , "will@kernel.org" , "mingo@kernel.org" , "linux-arm-kernel@lists.infradead.org" Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Mon, 2020-10-05 at 14:52 -0400, Nitesh Narayan Lal wrote: > On 10/4/20 7:14 PM, Frederic Weisbecker wrote: > > On Sun, Oct 04, 2020 at 02:44:39PM +0000, Alex Belits wrote: > > > On Thu, 2020-10-01 at 15:56 +0200, Frederic Weisbecker wrote: > > > > External Email > > > > > > > > ------------------------------------------------------------- > > > > ------ > > > > --- > > > > On Wed, Jul 22, 2020 at 02:49:49PM +0000, Alex Belits wrote: > > > > > +/* > > > > > + * Description of the last two tasks that ran isolated on a > > > > > given > > > > > CPU. > > > > > + * This is intended only for messages about isolation > > > > > breaking. We > > > > > + * don't want any references to actual task while accessing > > > > > this > > > > > from > > > > > + * CPU that caused isolation breaking -- we know nothing > > > > > about > > > > > timing > > > > > + * and don't want to use locking or RCU. > > > > > + */ > > > > > +struct isol_task_desc { > > > > > + atomic_t curr_index; > > > > > + atomic_t curr_index_wr; > > > > > + bool warned[2]; > > > > > + pid_t pid[2]; > > > > > + pid_t tgid[2]; > > > > > + char comm[2][TASK_COMM_LEN]; > > > > > +}; > > > > > +static DEFINE_PER_CPU(struct isol_task_desc, > > > > > isol_task_descs); > > > > So that's quite a huge patch that would have needed to be split > > > > up. > > > > Especially this tracing engine. > > > > > > > > Speaking of which, I agree with Thomas that it's unnecessary. > > > > It's > > > > too much > > > > code and complexity. We can use the existing trace events and > > > > perform > > > > the > > > > analysis from userspace to find the source of the disturbance. > > > The idea behind this is that isolation breaking events are > > > supposed to > > > be known to the applications while applications run normally, and > > > they > > > should not require any analysis or human intervention to be > > > handled. > > Sure but you can use trace events for that. Just trace interrupts, > > workqueues, > > timers, syscalls, exceptions and scheduler events and you get all > > the local > > disturbance. You might want to tune a few filters but that's pretty > > much it. > > > > As for the source of the disturbances, if you really need that > > information, > > you can trace the workqueue and timer queue events and just filter > > those that > > target your isolated CPUs. > > > > I agree that we can do all those things with tracing. > However, IMHO having a simplified logging mechanism to gather the > source of > violation may help in reducing the manual effort. > > Although, I am not sure how easy will it be to maintain such an > interface > over time. I think that the goal of "finding source of disturbance" interface is different from what can be accomplished by tracing in two ways: 1. "Source of disturbance" should provide some useful information about category of event and it cause as opposed to determining all precise details about things being called that resulted or could result in disturbance. It should not depend on the user's knowledge about details of implementations, it should provide some definite answer of what happened (with whatever amount of details can be given in a generic mechanism) even if the user has no idea how those things happen and what part of kernel is responsible for either causing or processing them. Then if the user needs further details, they can be obtained with tracing. 2. It should be usable as a runtime error handling mechanism, so the information it provides should be suitable for application use and logging. It should be usable when applications are running on a system in production, and no specific tracing or monitoring mechanism can be in use. If, say, thousands of devices are controlling neutrino detectors on an ocean floor, and in a month of work one of them got one isolation breaking event, it should be able to report that isolation was broken by an interrupt from a network interface, so the users will be able to track it down to some userspace application reconfiguring those interrupts. It will be a good idea to make such mechanism optional and suitable for tracking things on conditions other than "always enabled" and "enabled with task isolation". However in my opinion, there should be something in kernel entry procedure that, if enabled, prepared something to be filled by the cause data, and we know at least one such situation when this kernel entry procedure should be triggered -- when task isolation is on. -- Alex _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel