Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp5361623rwl; Tue, 21 Mar 2023 17:58:58 -0700 (PDT) X-Google-Smtp-Source: AK7set/M0tLkz6EUBGINqeXHLtWtbuhaaCpAysPG9Zrz6wyFQz/zWJzgICt6Ugwfp1gBYuUUKILU X-Received: by 2002:a17:906:49:b0:931:4285:ea1d with SMTP id 9-20020a170906004900b009314285ea1dmr4616843ejg.5.1679446738660; Tue, 21 Mar 2023 17:58:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679446738; cv=none; d=google.com; s=arc-20160816; b=QjTZ/n12aKC8M9QiUSFPplTjwRvFz+sGzl56YrQTEoziyhW7htbMbUv8E0T7gNj7VA csjJnRDHlKPAKtC2jBnNbEDakmUyntv5Lh3Fy9uhmySYywTAtqzwlDvxfz7S8+FOJyLf sSi3/ns+JxV6CzSglE00p8shZGQ4OVYa8AP1kaLawRLBnjXLXGlMvmvcEJQtZwbZ0Ml/ Iya6WWpny8gfYUSopAOP11T4hNqjCcZAYRBZhDkB152IWPl1ABuQzLhivKzbmFZLumXZ B50ePxGYe3D4MJ7R+qUP4WKtnuPlWBirgni9xvtSxdF02DrwQhx56Dxq5d8o8sOkFoAW a/jw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:date:subject:from:message-id:cc:to:feedback-id :dkim-signature; bh=mM1zZpfBWD0rrswUszC5U0DSWjt2tLXLYT7+poL8Rg0=; b=rdGoUOaoCM+stwV0n5h/ohSeJ/1SP12nJshWXecEq/f4RxTHWsAFN6WGO/a3AzmqAl ermj5LpKrJ9vjlnuHLHJXoH/V1KAi/SqVrt0+CcGP1KPnetxGZsCGiYwrI8KbFXqVCyx 52x/+H1+uYO/J8pvxOXc8/jA5HF1KJZEaqrqQmhjDxT6o193yMK95EWcSR28cqfNAc+5 2lpwzAga2jZz+W6Xns4aI005Yc2MS53DExZodnWe4G+ceK8DbQGBnFVBATajt0u1zECx uvG2Q7PN9oL+OFoHeIGZb82VNhfQtUxz5zz2Q0s1bZSZQju5ALaCcDA38SiKkfPVm12N Rp1Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=pI6vQpx9; 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 vj1-20020a170907d48100b008d2b0211398si12237657ejc.534.2023.03.21.17.58.32; Tue, 21 Mar 2023 17:58:58 -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=pI6vQpx9; 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 S229789AbjCVAwj (ORCPT + 99 others); Tue, 21 Mar 2023 20:52:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54264 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229663AbjCVAwi (ORCPT ); Tue, 21 Mar 2023 20:52:38 -0400 Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com [66.111.4.25]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A97DD4D600 for ; Tue, 21 Mar 2023 17:52:34 -0700 (PDT) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 21EFA5C012E; Tue, 21 Mar 2023 20:52:34 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Tue, 21 Mar 2023 20:52:34 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:date:date:feedback-id :feedback-id:from:from:in-reply-to:message-id: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=1679446354; x=1679532754; bh=m M1zZpfBWD0rrswUszC5U0DSWjt2tLXLYT7+poL8Rg0=; b=pI6vQpx9EgLqMYzVr y0phS/05kt5s5+iZn/6H7mo5G9a+9gCzwufpHAQKNnm36nTIzn6NuLUot6LA4b1W rOn/iVsYGGD3O8Scf90fuXPNNgyBXWNSeXDLqzLqyKrLU7pG0mZ0IrL5CPUjYs/1 7a7/Kn0Rm/X/oO3JX15X6zkvjr/VLGBVxVzSU46SeEQvfb5Hbt00tBTc+O/kOG9U hckU6z1ry7skCW/d459htpMqEBkn5iGkUNcq9fFYLzAoGsmebvkA8g27c8xH2BUK Vzd6/jF/5C/2+x9dF/sW5dzcu0wFcMm4sxFCTilplc5fuP4KqDXxnb/aF4H8zXlt mLLvw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrvdeguddgvdekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepvfevkffhufffsedttdertddttddtnecuhfhrohhmpefhihhnnhcuvfhhrghi nhcuoehfthhhrghinheslhhinhhugidqmheikehkrdhorhhgqeenucggtffrrghtthgvrh hnpeehfffggeefveegvedtiefffeevuedtgefhueehieetffejfefggeevfeeuvdduleen ucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehfthhhrg hinheslhhinhhugidqmheikehkrdhorhhg X-ME-Proxy: Feedback-ID: i58a146ae:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 21 Mar 2023 20:52:30 -0400 (EDT) To: Geert Uytterhoeven Cc: linux-m68k@lists.linux-m68k.org, linux-kernel@vger.kernel.org Message-Id: <4f5e5d058c21270ebf31609a71c2b800fd99fa93.1679446472.git.fthain@linux-m68k.org> From: Finn Thain Subject: [PATCH] nubus: Avoid scanning "private" card resources Date: Wed, 22 Mar 2023 11:54:32 +1100 X-Spam-Status: No, score=-0.7 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, RCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,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 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. 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); } } -- 2.37.5