Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp988175rwr; Wed, 19 Apr 2023 16:41:45 -0700 (PDT) X-Google-Smtp-Source: AKy350ZTWi/KTmR3Y2ve7wUhSnYNguDafTMF9W9oZopa9K5WhSUySgVdKP31C0CiyT5tNyts2K6k X-Received: by 2002:a05:6a00:2d8a:b0:63d:254a:3918 with SMTP id fb10-20020a056a002d8a00b0063d254a3918mr5925830pfb.29.1681947705032; Wed, 19 Apr 2023 16:41:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681947705; cv=none; d=google.com; s=arc-20160816; b=vPzK1GEXPPWR9njgPwEgXEhx57sL7q0g6u9C2nYST6r2+o+G4WtdeBAQFPZw2GbaZk Akh+heuTWpTFG8ggvh6eo0DkbEXr26RXrUf+QWHsbfL4BwZ7q0/fBkEVBvCvUPCOfUb8 C3LNdfyiBtM0Ba/uOmcCttHECt0/iz4JgU4X6Xr6wd3BXCU7ct70SSLiTc9ddjBFKYmw L/qtIDGGaVuSBOGKqty7tiHtMSZEFcuHyhjCx5StB8VxshupjwPwfeDAdHAWXKfOQ5f7 7oiWcrAVmjSozjoDODWM4/CqjcT8x9+K0Efd7eADl2Xijf59L4ISXPoHK+TFGfp6pssH jHdw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=+4elBgltmv+lMcD+HupshMFkFMDfWM+9W5HQXxOjaa4=; b=Vxe/DJeAv3HJRvTLxaTbMeH4QvmRQmWObCG5QfX2Spj7h5QnKxUfyLD3a2n1w4zw4b av/Ol03rFoUZRqPYO06lprXrC/jxT6rGfKuH+wGeihfZ7J3BRWEpN8ejSr9WFF60RhyI R3xtGqIHzNvgSCdctFeGxDPomaB/Q2vwoEWrsXreoEoUAvVIT96P2UK7ZlXP+T8Ou4Uk xMOoAVNtMT8/9v/qMkhPn4khyBwMrGxUnsnOgxa39zyWYKY+wov2B1xtYT6vJKPiGC/L kttIM79R0JTuLY232Oron1+a6FGw9jwYT8jKQSI2O2gXYYhQMiex6TCZ7zjWItvwNpBe Jj9A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=g+CBeEM+; 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=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k7-20020aa79987000000b0063d4595dee9si3195946pfh.46.2023.04.19.16.41.32; Wed, 19 Apr 2023 16:41:45 -0700 (PDT) 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=@infradead.org header.s=bombadil.20210309 header.b=g+CBeEM+; 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=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231239AbjDSXck (ORCPT + 99 others); Wed, 19 Apr 2023 19:32:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47902 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229547AbjDSXcj (ORCPT ); Wed, 19 Apr 2023 19:32:39 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B03811FD3; Wed, 19 Apr 2023 16:32:36 -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=+4elBgltmv+lMcD+HupshMFkFMDfWM+9W5HQXxOjaa4=; b=g+CBeEM+lA6Rsj0oHYQvwzXj+b 1llNLt64NJTdOIv8eaVlV8JM40rHT30TLRZoLjUGLLZ0DhMIWVPvo85zsIUIb2Z5L/SGKtopab160 Tl1aD9MteoqR8n9Df/76QnvZzPVi64Ykc8rqD8J2czOBH6m211ANBEj4WOQ5zG+z1hBt7r5EX3dGD eLI5c70SzPFEXKlF76bDhKPDqD12Ol4JztS5SRIRaGxqaPggpxsgtZyeCuCAKG85HU3V6XJjBXE/N /4ZVLAj/yFt+uibSeqRlQrTxCM1ucOhqw41XCCZOthnTGVLmbrx7vw/51IYD3eDmz/tFU2PiTdhBR fDkkbspg==; Received: from mcgrof by bombadil.infradead.org with local (Exim 4.96 #2 (Red Hat Linux)) id 1ppHHq-006fP7-2r; Wed, 19 Apr 2023 23:32:30 +0000 Date: Wed, 19 Apr 2023 16:32:30 -0700 From: Luis Chamberlain To: Greg KH Cc: david@redhat.com, patches@lists.linux.dev, linux-modules@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, pmladek@suse.com, petr.pavlu@suse.com, prarit@redhat.com, torvalds@linux-foundation.org, rafael@kernel.org, christophe.leroy@csgroup.eu, tglx@linutronix.de, peterz@infradead.org, song@kernel.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 Subject: Re: [PATCH] module: add debugging auto-load duplicate module support Message-ID: References: <20230418204636.791699-1-mcgrof@kernel.org> <2023041951-evolution-unwitting-1791@gregkh> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2023041951-evolution-unwitting-1791@gregkh> Sender: Luis Chamberlain X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE, URIBL_BLOCKED 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 On Wed, Apr 19, 2023 at 09:15:11AM +0200, Greg KH wrote: > On Tue, Apr 18, 2023 at 01:46:36PM -0700, Luis Chamberlain wrote: > You get 72 columns for changelog text, so you can use it :) Sure! I forget what the limit is, but now I won't forget, new vimrc settings: set textwidth=100 autocmd FileType gitcommit set textwidth=72 set colorcolumn=+1 > > +config MODULE_AUTOLOAD_SUPRESS_DUPS > > MODULE_DEBUG_DUPLICATE perhaps? It has nothing to do with autoloading > (other than that is what userspace is doing) I refer to module auto-loading as the kernel's use of the *request_module() APIs. This code is used by the module auto-loading request_module() API callers, prior to us even dealing with userspace. > and you aren't suppressing anything except throwing up warnings, right? Actually the code does converge duplicate auto-loading requests into one, but'll just rename to MODULE_DEBUG_AUTOLOAD_DUPS. > > + bool "Debug duplicate modules with auto-loading" > > + help > > + Module autoloading allows in-kernel code to request modules through > > + the *request_module*() API calls. This in turn just calls userspace > > + modprobe. Although modprobe checks to see if a module is already > > + loaded before trying to load a module there is a small time window in > > + which multiple duplicate requests can end up in userspace and multiple > > + modprobe calls race calling finit_module() around the same time for > > + duplicate modules. The finit_module() system call can consume in the > > + worst case more than twice the respective module size in virtual > > + memory for each duplicate module requests. Although duplicate module > > + requests are non-fatal virtual memory is a limited resource and each > > + duplicate module request ends up just wasting virtual memory. > > It's not "wasted", as it is returned when the module is determined to be > a duplicate. Otherwise everyone will want this enabled as they think it > will actually save memory. I'll change the language to be clear the issue is memory pressure early on boot. I'll also add a bit of language to help at least guide people to realize that the real value-add for this, ie, I'll have to mention we suspect issue is udev and not module auto-loading and that this however may still help find a few cases we can optimize for. Luis