From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gnu.wildebeest.org (gnu.wildebeest.org [45.83.234.184]) by sourceware.org (Postfix) with ESMTPS id 59CA03858D28 for ; Sat, 14 May 2022 22:36:26 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 59CA03858D28 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=klomp.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=klomp.org Received: from reform (deer0x07.wildebeest.org [172.31.17.137]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by gnu.wildebeest.org (Postfix) with ESMTPSA id 44AD0302BBEC for ; Sun, 15 May 2022 00:36:25 +0200 (CEST) Received: by reform (Postfix, from userid 1000) id 13E5E2E813D6; Sun, 15 May 2022 00:36:09 +0200 (CEST) Date: Sun, 15 May 2022 00:36:09 +0200 From: Mark Wielaard To: elfutils-devel@sourceware.org Subject: Re: Optimize debuginfod-client cache lookup/cleanup a little Message-ID: References: <20220509225723.96902-1-mark@klomp.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220509225723.96902-1-mark@klomp.org> X-Spam-Status: No, score=-3.5 required=5.0 tests=BAYES_00, JMQ_SPF_NEUTRAL, KAM_DMARC_STATUS, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) 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: Sat, 14 May 2022 22:36:27 -0000 Hi, On Tue, May 10, 2022 at 12:57:20AM +0200, Mark Wielaard wrote: > debuginfod-client would try to create the cache config files twice, > once through debuginfod_init_cache, which was always called before the > debuginfod_clean_cache check. Which called debuginfod_config_cache > which also tried to create the config files when they didn't exist > yet. debuginfod_config_cache however had a small bug that meant it > would not provide a valid struct stat if the config file didn't exist > yet. The first patch fixes that: > > [PATCH 1/3] debuginfod: Make sure debuginfod_config_cache always returns valid stat > > Then the second patch removes debuginfod_init_cache which saves two > stat calls (but introduces a new mkdir call). > > [PATCH 2/3] debuginfod: Remove debuginfod_init_cache > > Finally as soon as debuginfod_clean_cache commits to clean the cache > dir we immediately update the mtime of the interval config file so > other threads will not try to simultaniously also try to clean up the > cache dir. Because that is just duplicate work. > > [PATCH 3/3] debuginfod: update mtime of interval_path as early as possible Frank said off-list that he didn't see anything wrong with these patches. So I pushed thse 3 patches. 12 points! Mark