Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp512567rwb; Thu, 1 Dec 2022 05:12:32 -0800 (PST) X-Google-Smtp-Source: AA0mqf5eXV51efFeqlyeTY49svCWFGjB0xFL1KaDdLDCA6AJA43uu+rQB6w12jlN1ej7FJKX7QWt X-Received: by 2002:a05:6402:5290:b0:461:af68:9bcd with SMTP id en16-20020a056402529000b00461af689bcdmr43857020edb.67.1669900351914; Thu, 01 Dec 2022 05:12:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669900351; cv=none; d=google.com; s=arc-20160816; b=gECWbueLyzx9OwckLwULkCyjSEJ2+FfMY/6Ju3EqfM98s0aFm7n0w2FUi4qMx7c4N3 XnF8R9m1jP1AnXs5/CdqXRSHwVTAkGkH3xQpa853KJQL4AJZyhh4dqM8jgVz2xlS31Lk 2ExK+m/cPlFTnyHPyCJQgOqY/DDxbRXSO+A/5kJGRITWC8TyNcdY1+rk6miqyVcQxrLp uk4xohEJzhrUmIzGpuHtZ4f4/a6whywzNWSqWOlX7hKwK1CwfyMHdwYHYwMJjpJNhUUx zq598uBWWflk56u2pmLE0UaIFlvB0C7ln5m1Zc7woaiabCm2YxZIJqREsRtJ6fds+OiB 4FVw== 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:in-reply-to:subject :cc:to:dkim-signature:dkim-signature:from; bh=lcbWOkps8CeeBrRGflRpGB2RwbFNdBrHgzFXj1dkdtI=; b=DBS/IvyMCWBqZ7+bguHwq/bW3wi5yjLuQSDK3FSPe8huDQdIcr0lNMjC0NhztafPbM pfT9gjmPVcxE89Y3QU7br6c8ed50+H6vOc0vWR54TZg9CuiTdjFsIN4uvICFJhF66S55 u9dbOV+OVdiSP7qT+7YZA30UeN6Inl09PSQM/ouDdTxbXLHqHaG0mchjp1auoXo2m2jC aTpRkkhfrSP8ugp4GSPWkxNJW9ixyOIRzk9t0xtmbmYTZ1+mQOXB/A1dWOg7lP5TB3YA qYlAeSw1LjXB+44xbsQx6yFMIsa0RTlEhnPfTz7l7kwS3lCEyM/XxpSy0x89U6v67ER8 7gHA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=EmnCdR1S; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s20-20020a056402521400b0046ba0b85e87si4144343edd.619.2022.12.01.05.12.08; Thu, 01 Dec 2022 05:12:31 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=EmnCdR1S; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S230415AbiLAMYI (ORCPT + 82 others); Thu, 1 Dec 2022 07:24:08 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36796 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230148AbiLAMYH (ORCPT ); Thu, 1 Dec 2022 07:24:07 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 397C59581C; Thu, 1 Dec 2022 04:24:05 -0800 (PST) From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1669897443; 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; bh=lcbWOkps8CeeBrRGflRpGB2RwbFNdBrHgzFXj1dkdtI=; b=EmnCdR1SsPJYlHfskYAEPFbQWb/6iyPe8V1uAjh4ETIAjLvKJvMyLbReICsa2XZ8w+Mm0y WBK14hVm8D4rbIVwFTCMFDo0BVeb4lWPDr74gRIK9sp/C835XyoSjqzmk56xtx6qPqtybd TS28Rxw2prBvA3m5/tEKCZ4f9JKyRQYiDwBm2p6RzbkOYOUGkC0lxlJfwoH8ee6qH4xLFi x/kB+Pfpy++XVVqhesHXoTZN3s2IyZ1fAwY69D3vUw8Nf3q9SLEt+SeIAjxw3hQsDHzblL bmPc3/5GT5xCSyWfV3FHkYRs1FDIIlwxFbyYU65csXNgeuvnyPkDYwtOfl0Xdw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1669897443; 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; bh=lcbWOkps8CeeBrRGflRpGB2RwbFNdBrHgzFXj1dkdtI=; b=Vr3+KtQqVhPyhAM/sHxP6CWxpoD/A9ye2g03+XWns2x05aYJdVkmvF7jVICbmwQltjP/gs pGI+jUTGBSwgyrAw== To: Jason Gunthorpe Cc: LKML , x86@kernel.org, Joerg Roedel , Will Deacon , linux-pci@vger.kernel.org, Bjorn Helgaas , Lorenzo Pieralisi , Marc Zyngier , Greg Kroah-Hartman , Dave Jiang , Alex Williamson , Kevin Tian , Dan Williams , Logan Gunthorpe , Ashok Raj , Jon Mason , Allen Hubbe , "Ahmed S. Darwish" , Reinette Chatre Subject: Re: [patch 19/33] genirq/msi: Provide msi_desc::msi_data In-Reply-To: <878rk1ectk.ffs@tglx> Date: Thu, 01 Dec 2022 13:24:03 +0100 Message-ID: <87cz93s464.ffs@tglx> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Jason! On Wed, Nov 23 2022 at 19:38, Thomas Gleixner wrote: > On Wed, Nov 23 2022 at 12:58, Jason Gunthorpe wrote: >> I find your perspective on driver authors as the enemy quite >> interesting :) > > I'm not seeing them as enemies. Just my expectations are rather low by > now :) This made me think about it for a while. Let me follow up on that. When I set out to add real-time capabilities to the kernel about 20 years ago, I did a thorough analysis of the kernel design and code base. It turned out that aside of well encapsulated infrastructure, e.g. mm, vfs, scheduler, network core, quite some of the rest was consisting of blatant layering violations held together with duct tape, super glue and haywire-circuit. It was immediately clear to me, that this needs a lot of consolidation and cleanup work to get me even close to the point where RT becomes feasible as an integral part of the kernel. But not only this became clear, I also realized that a continuation of this model will end up in a maintenance nightmare sooner than later. Me and the other people interested in RT estimated back then that it'll take 5-10 years to get this done. Boy, we were young and naive back then and completely underestimating the efforts required. Obviously we were also underestimating the concurrent influx of new stuff. Just to give you an example. Our early experiments with substituting spinlocks was just the start of the horrors. Instead of working on the actual substitution mechanisms and the required other modifications, we spent a vast amount of our time chasing dead locks all over the place. My main test machine had not a single device driver which was correct and working out of the box. What's worse is that we had to debate with some of the driver people about the correctness of our locking analysis and fight for stuff getting fixed. This ended in writing and integrating lockdep, which has thankfully taken this burden of our plate. When I started to look into interrupt handling to add support for threaded interrupts, which are a fundamental prerequisite for RT, the next nightmare started to unfold. The "generic" core code was a skeleton and everything real was implemented in architecture specific code in completely incompatible ways. It was not even possible to change common data structures without breaking the world. What was even worse, drivers fiddled in the interrupt descriptors just to scratch an itch. What I learned pretty fast is that most driver writers try to work around short-comings in common infrastructure instead of tackling the problem at the root or talking to the developers/maintainers of that infrastructure. The consequence of that is: if you want to change core infrastructure you end up mopping up the driver tree in order not to break things all over the place. There are clearly better ways to spend your time. So I started to encapsulate things more strictly - admittedly to make my own life easier. But at the same time I always tried hard to make these encapsulations easy to use, to provide common infrastructure in order to replace boilerplate code and to help with resource management, which is one of the common problems in driver code. I'm also quite confident that I carefully listened to the needs of driver developers and I think the whole discussion about IMS last year is a good example for that. I surely have opinions, but who doesn't? So no, I'm not seeing driver writers as enemies. I'm just accepting the reality that quite some of the drivers are written in "get it out the door" mode. I'm well aware that there are other folks who stay around for a long time and do proper engineering and maintenance, but that's sadly the minority. Being responsible for core infrastructure is an interesting challenge especially with the zoo of legacy to keep alive and the knowledge that you can break the world with a trivial and obviously "correct" change. Been there, done that. :) Thanks, Thomas