Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp5655928rwl; Tue, 21 Mar 2023 23:54:24 -0700 (PDT) X-Google-Smtp-Source: AK7set97TOQE3t8/EPTQSQcdtXU2hBMduT4yhH5oGS36jEsTkMWR+5eNQiLbU1AD05biZNt1oMjM X-Received: by 2002:aa7:c70d:0:b0:501:cf67:97f3 with SMTP id i13-20020aa7c70d000000b00501cf6797f3mr6265393edq.25.1679468063971; Tue, 21 Mar 2023 23:54:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679468063; cv=none; d=google.com; s=arc-20160816; b=oJdUZbQldEnCBePQCHPVrHDAMHXoqfjqR0MgcA/ZucwxeSzz7TTBO63xbu5MnxtbYE ynm8/JtGjWukz3cLvGeMwzAVemWSZRmdIEikrkTQ3njDFNGEFHfnh29hTNolQmLkmFlE EwNDRCbP5+LcZUMw9oSkJJ8eQ6RsSl6Z5S3/U3wuX5N6fnRV6lnhWdPk65w9H1yEwqom 590Qj0tPSKfM5NESroQx3h7cIj+2V1c9yd/UKfKYAttWAEmfJc/63uRT1DMjcbwAqvhV h8CME7d3I/BCwAqrU8iLAy5+MwhCTk5cNoaBHEvc68G8msWGGSYIRV0vp0l/mXhSLkFM xNQQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:message-id:in-reply-to :subject:cc:to:from:date:feedback-id:dkim-signature; bh=qm/wfm09fuhCSM5vGnT7Tur7d91xNuD8sTp/mz7MCZA=; b=RSgpiuPrQM5+OPW1DTc9AI5vH3QflxrOo1EjYOWAarvV6eIewx1EijKNspMfBHu3CS formsJSOeh0TeMEYn77iDkf45Vl99HeWMsaXZs4aNEyGZggtU9knOUtY9u8XwvU8927J h8HvQ/P6yx+VneHsTQ0mX2AZ16MFlgE6BzqkgFqsPSmxA50lpEpYWLx2DsHcQHklcSyH u5d1yTXD7MP5jWG6NU5tpsHCXmvz5YAudNyTO0Ds2FsufGoEdePdB0STB4F+J+Ze/VaG kMJTsnPY4wjBSYahq8LzIkvkRY9t8q/4E46xXY2dgmdJzi1LwiiZcS1FaLjnZitKqeWk MnsA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=fevLYV3L; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w13-20020aa7dccd000000b004c5a8aa02fcsi16396655edu.435.2023.03.21.23.53.59; Tue, 21 Mar 2023 23:54:23 -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=@messagingengine.com header.s=fm2 header.b=fevLYV3L; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229782AbjCVGuU (ORCPT + 99 others); Wed, 22 Mar 2023 02:50:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59522 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229973AbjCVGty (ORCPT ); Wed, 22 Mar 2023 02:49:54 -0400 Received: from wout5-smtp.messagingengine.com (wout5-smtp.messagingengine.com [64.147.123.21]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0533D28874 for ; Tue, 21 Mar 2023 23:49:47 -0700 (PDT) Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.west.internal (Postfix) with ESMTP id 8E7FF3200931; Wed, 22 Mar 2023 02:49:44 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Wed, 22 Mar 2023 02:49:44 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm2; t=1679467784; x=1679554184; bh=qm/wfm09fuhCS M5vGnT7Tur7d91xNuD8sTp/mz7MCZA=; b=fevLYV3Lo9jkshZ2VfF1nPavNEaik ORa93Y/N60UrSViWQx93YXtT4eZJAgbRbCcAVa7Tpo/eXdIbLJ0EztGGO4Qz70kI xVVOitGwqPEGoYDmNzYk8FMkbvZAf6W7g8BGOtiPDRTopcTDg8nqKpHMSMtgUs5n 8++OH4cXoiEv2QXJ3t/+hXFOStWilz04L8GMN6F8vGzOiElPhA1sWT+aPp8BGp0M KUOVjLCJr6Rmi5CjdrgHeSg98CVQvpsP8NpAc7dNJCTrdkpGtnGqWI9LZrs8A7e+ yS9ytTZcBnxz8oRYaRPHwrmvoQFPXHRMUXE3izkwUtfO9T7zZOXBHCUtQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrvdeguddguddtfecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpeffhffvvefujgfkfhggtgesthdtredttddtvdenucfhrhhomhephfhinhhn ucfvhhgrihhnuceofhhthhgrihhnsehlihhnuhigqdhmieekkhdrohhrgheqnecuggftrf grthhtvghrnhepleeuheelheekgfeuvedtveetjeekhfffkeeffffftdfgjeevkeegfedv ueehueelnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomh epfhhthhgrihhnsehlihhnuhigqdhmieekkhdrohhrgh X-ME-Proxy: Feedback-ID: i58a146ae:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 22 Mar 2023 02:49:40 -0400 (EDT) Date: Wed, 22 Mar 2023 17:52:34 +1100 (AEDT) From: Finn Thain To: Geert Uytterhoeven cc: linux-m68k@lists.linux-m68k.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] nubus: Avoid scanning "private" card resources In-Reply-To: <4f5e5d058c21270ebf31609a71c2b800fd99fa93.1679446472.git.fthain@linux-m68k.org> Message-ID: <9b0d643e-2555-8d09-a47c-19196add3345@linux-m68k.org> References: <4f5e5d058c21270ebf31609a71c2b800fd99fa93.1679446472.git.fthain@linux-m68k.org> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Spam-Status: No, score=-0.7 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, RCVD_IN_DNSWL_LOW,SPF_HELO_PASS,SPF_NONE,URIBL_BLOCKED autolearn=unavailable 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, 22 Mar 2023, Finn Thain wrote: > Some Nubus cards have many ROM resources. A single Radius video card > produced well over a thousand entries under /proc/bus/nubus. Populating > /proc/bus/nubus on a slow machine with several such cards installed takes > long enough that the user may think that the system is wedged. All those > procfs entries also consume significant RAM though they are not normally > needed except by developers. Omit the "private" resources from > /proc/bus/nubus/ by default and add a kernel parameter to enable them > when needed. On the test machine, this saved 196 KiB and 5 seconds. > This patch is nice and short but I suspect it can be improved upon. If the procfs entries are only needed for debugging then I should probably omit all of them by default, and save even more time and RAM. So I think I'll revise this patch. > Tested-by: Stan Johnson > Signed-off-by: Finn Thain > --- > drivers/nubus/nubus.c | 9 ++++++--- > 1 file changed, 6 insertions(+), 3 deletions(-) > > diff --git a/drivers/nubus/nubus.c b/drivers/nubus/nubus.c > index f70ba58dbc55..777099b8e818 100644 > --- a/drivers/nubus/nubus.c > +++ b/drivers/nubus/nubus.c > @@ -34,6 +34,9 @@ > > LIST_HEAD(nubus_func_rsrcs); > > +bool all_func_rsrcs; > +module_param(all_func_rsrcs, bool, 0444); > + > /* Meaning of "bytelanes": > > The card ROM may appear on any or all bytes of each long word in > @@ -572,9 +575,9 @@ nubus_get_functional_resource(struct nubus_board *board, int slot, > nubus_proc_add_rsrc(dir.procdir, &ent); > break; > default: > - /* Local/Private resources have their own > - function */ > - nubus_get_private_resource(fres, dir.procdir, &ent); > + if (all_func_rsrcs) > + nubus_get_private_resource(fres, dir.procdir, > + &ent); > } > } > >