From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id 3643F38425B1 for ; Mon, 9 May 2022 18:35:23 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 3643F38425B1 Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-395-eW4SoV8XPB-_VJEUWcYV_g-1; Mon, 09 May 2022 14:35:21 -0400 X-MC-Unique: eW4SoV8XPB-_VJEUWcYV_g-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 332333C977C2 for ; Mon, 9 May 2022 18:35:21 +0000 (UTC) Received: from redhat.com (unknown [10.2.16.15]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 23F13C15E71; Mon, 9 May 2022 18:35:21 +0000 (UTC) Received: from fche by redhat.com with local (Exim 4.94.2) (envelope-from ) id 1no8E4-0002Ay-8D; Mon, 09 May 2022 14:35:20 -0400 Date: Mon, 9 May 2022 14:35:20 -0400 From: "Frank Ch. Eigler" To: Noah Sanci Cc: elfutils-devel@sourceware.org Subject: Re: [Bug debuginfod/29098] set default prefetch limits to >0 Message-ID: <20220509183520.GE20072@redhat.com> References: MIME-Version: 1.0 In-Reply-To: User-Agent: Mutt/1.12.0 (2019-05-25) X-Scanned-By: MIMEDefang 2.85 on 10.11.54.8 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Spam-Status: No, score=-4.9 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, KAM_NUMSUBJECT, RCVD_IN_DNSWL_LOW, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: elfutils-devel@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Elfutils-devel mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 May 2022 18:35:24 -0000 Hi - > + // Make the prefetch cache spaces smaller than the normal > + // fd cache if rpm scanning is on. This is to not waste memory > + // since the prefetch cache isn't used when -R isn't specified > + // Set to 1/2 arbitrarily > + if ( scan_archives[".rpm"] == "cat" ) > + { > + if ( fdcache_prefetch_fds == 0 ) > + fdcache_prefetch_fds = fdcache_fds * .5; > + if ( fdcache_prefetch_mbs == 0 ) > + fdcache_prefetch_mbs = fdcache_mbs * .5; > + } Yeah, something like that. It turns out that space for the prefetch cache is not used at all if RPM (and don't forget about other archive types!) is not in effect. So it's harmless to set those defaults unconditionally. How about a simpler: if ( fdcache_prefetch_fds == 0 ) fdcache_prefetch_fds = fdcache_fds * .5; if ( fdcache_prefetch_mbs == 0 ) fdcache_prefetch_mbs = fdcache_mbs * .5; - FChE