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 5414AC77B7A for ; Tue, 30 May 2023 19:42:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231346AbjE3Tmq (ORCPT ); Tue, 30 May 2023 15:42:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33586 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231203AbjE3Tmo (ORCPT ); Tue, 30 May 2023 15:42:44 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 87D56E8; Tue, 30 May 2023 12:41:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=JADWF5FGfjqal0Tm4srMFuXcLVsdz79srAuWZWBhE0U=; b=h83GzI9GcktWKcxm3mM6r0dFZw gDFov6i/D/ln27TGWCDBsfM8Dp2YSXIPS/PadQ/vuOP1h3KfOXRt/Ai8fqtSLwMPPA12Cqi9fsxx1 busls/x8Bbmq5as1k5M4iPcu+jv5Y4OzfZeFCee+0guhE8+nmfE57I6/H7B7Ihh6piFFztXsoWYjP OYAhAjIj5Zrcp5vuE6HXHhK6/EWyS8a9n0RzpJbz+hN84xLsxNNYkNlVBLucSrghgbLJaaYT0asy9 fMykJWPxnNC1FQbewSoj16im5rO8ZVWciD6VuY92UqYF/2BExw7xImmCHnXCRQD1CvyE6kA4zoUJp 3FXLT1pw==; Received: from mcgrof by bombadil.infradead.org with local (Exim 4.96 #2 (Red Hat Linux)) id 1q45Dk-00F0Eb-2F; Tue, 30 May 2023 19:41:28 +0000 Date: Tue, 30 May 2023 12:41:28 -0700 From: Luis Chamberlain To: Lucas De Marchi Cc: Linus Torvalds , Johan Hovold , 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 Subject: Re: [PATCH 2/2] module: add support to avoid duplicates early on load Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: Luis Chamberlain Precedence: bulk List-ID: On Tue, May 30, 2023 at 10:16:22AM -0700, Lucas De Marchi wrote: > On Tue, May 30, 2023 at 09:22:14AM -0700, Luis Chamberlain wrote: > > Lucas, any thoughts from modules kmod userspace perspective into > > supporting anyone likely issuing concurrent modules requests with > > differing arguments? > > Changing module params like that without first explicitly removing the > module was never supported by kmod or module-init-tools (I'm not digging > the history before 2.6 kernel) That's good enough. > During boot, note there is already a shortcut > if we have the sysfs node already in the "live" state or if the module is > built-in. In that case we will return success or -EEXIST (if the > KMOD_PROBE_IGNORE_LOADED flag was passed). Linus' code would make duplicates wait and share the same return value, ie, no new odd error code is returned. Or are you suggesting -EEXIST should be returned to duplicates if the module succeeded to load instead of 0 ? > The only scenario I can think of during boot in which the module params > could change would be when a buggy initrd is created, i.e. > /etc/modprobed.d/*.conf is in the rootfs but absent from initrd. This helps thanks. > So returning the same error code seems good to me. OK thanks! So just to confirm, it seems fine to return the same error code if duplicates wait, or do you prefer for some reason for there to be an exception and return -EEXIST if the module did succeed in the duplicate case? Luis