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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3F755C7EE23 for ; Sun, 4 Jun 2023 14:26:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230237AbjFDO0a (ORCPT ); Sun, 4 Jun 2023 10:26:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48482 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229449AbjFDO02 (ORCPT ); Sun, 4 Jun 2023 10:26:28 -0400 Received: from mail-pf1-x430.google.com (mail-pf1-x430.google.com [IPv6:2607:f8b0:4864:20::430]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A1B4ED3 for ; Sun, 4 Jun 2023 07:26:25 -0700 (PDT) Received: by mail-pf1-x430.google.com with SMTP id d2e1a72fcca58-652699e72f7so1762385b3a.3 for ; Sun, 04 Jun 2023 07:26:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=heitbaum.com; s=google; t=1685888785; x=1688480785; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:from:to :cc:subject:date:message-id:reply-to; bh=HA5YrIYH9MawD+4VRjcWbjHM//DpBE3FGKspT1TvJ+c=; b=CcQtwON+W3n7y7rA9m3IbuMZf1gq/6rWVzSIyiMZaJ9Vp4L7cwZl7Eptdo7f5/JYrH VY96BmCnZdcD+JuKrA0Kjp42bz0LLhrV3VQlkDWcACaWtSQ2lb+QUxFB38AQn87H3lTj U+n4Q9vvxFpFS30gxqxlMKuZ5R50iQVSLSHXU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685888785; x=1688480785; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=HA5YrIYH9MawD+4VRjcWbjHM//DpBE3FGKspT1TvJ+c=; b=QMF+mrnWjjpdxLlkeSCm70d/Om0N5RhYN1aBuiYTh8UQeumhtNRxJ2ZME7s7Ldg0IM oMlkL39qLP0O0P6Co5OUgdyWkcM20OgzO9u7wCE/7cdsGxFOaouuolP+uk1OlDo3+XPr 9MXsgVPGgoG/qtlCr3phOabdA7WGDCk1IDkTGoZ2t2FDwV9EgzePd6yu2Smaw3aqRR0e yt3iRbJeuUOS95g+tkGeEhdjBWCZyzGlBwNVrUjExZjP6bGkJII23H+TJuMH/nbebLiR qU3J2T1krN9Jog2NF5WzEssp7RhIuMjbbFcm1vownNqX5VlZ8Vq4zv6P0k/U2zKhLi6I Uwxw== X-Gm-Message-State: AC+VfDy4+tzkNYON6LeB49hJaH4a3dyBgpNCaIbL71qlZzM9LGmxRevx UdxwA1pAnxIqSXLKEApBNSvd+Q== X-Google-Smtp-Source: ACHHUZ5L7kPdWHNyYrkbAXFw/Ud0NVHz/4s8+yRhJJX2mlG+9wCBm0pRDUZD3gxZ8iMp5wqgAPDJQQ== X-Received: by 2002:a05:6a20:158b:b0:10c:4c76:e909 with SMTP id h11-20020a056a20158b00b0010c4c76e909mr1573877pzj.8.1685888784842; Sun, 04 Jun 2023 07:26:24 -0700 (PDT) Received: from 80e1dc6c40da ([122.199.31.3]) by smtp.gmail.com with ESMTPSA id h6-20020a62b406000000b00637b0c719c5sm3657475pfn.201.2023.06.04.07.26.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 04 Jun 2023 07:26:23 -0700 (PDT) Date: Sun, 4 Jun 2023 14:26:12 +0000 From: Rudi Heitbaum To: Linus Torvalds Cc: Johan Hovold , Luis Chamberlain , Lucas De Marchi , Petr Pavlu , gregkh@linuxfoundation.org, rafael@kernel.org, song@kernel.org, lucas.de.marchi@gmail.com, christophe.leroy@csgroup.eu, peterz@infradead.org, rppt@kernel.org, dave@stgolabs.net, willy@infradead.org, vbabka@suse.cz, mhocko@suse.com, dave.hansen@linux.intel.com, colin.i.king@gmail.com, jim.cromie@gmail.com, catalin.marinas@arm.com, jbaron@akamai.com, rick.p.edgecombe@intel.com, yujie.liu@intel.com, david@redhat.com, tglx@linutronix.de, hch@lst.de, patches@lists.linux.dev, linux-modules@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, pmladek@suse.com, prarit@redhat.com, lennart@poettering.net, imre.deak@intel.com Subject: Re: [PATCH 2/2] module: add support to avoid duplicates early on load Message-ID: References: <6gwjomw6sxxmlglxfoilelswv4hgygqelomevb4k4wrlrk3gtm@wrakbmwztgeu> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, May 29, 2023 at 09:55:15PM -0400, Linus Torvalds wrote: > On Mon, May 29, 2023 at 11:18 AM Johan Hovold wrote: > > > > I took a closer look at some of the modules that failed to load and > > noticed a pattern in that they have dependencies that are needed by more > > than one device. > > Ok, this is a "maybe something like this" RFC series of two patches - > one trivial one to re-organize things a bit so that we can then do the > real one which uses a filter based on the inode pointer to return an > "idempotent return value" for module loads that share the same inode. > > It's entirely untested, and since I'm on the road I'm going to not > really be able to test it. It compiles for me, and the code looks > fairly straightforward, but it's probably buggy. The updated patches fix the issue experienced with 6.4-rc4 where the Intel NUC12 booted fine, but on media playback resulted in the video stuttering, then freezing - and that audio was not coming though. # diff modules-rc4 modules-rc4-patched < snd_hda_codec_hdmi 77824 0 < snd_hda_codec_realtek 159744 0 --- > snd_hda_codec_hdmi 77824 1 > snd_hda_codec_realtek 159744 1 Revert "module: error out early on concurrent load of the same module file" module: split up 'finit_module()' into init_module_from_file() helper modules: catch concurrent module loads, take two Johan's fix: -static struct spinlock idem_lock; +static DEFINE_SPINLOCK(idem_lock); Tested-by: Rudi Heitbaum