From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp-out1.suse.de (smtp-out1.suse.de [IPv6:2a07:de40:b251:101:10:150:64:1]) by sourceware.org (Postfix) with ESMTPS id 5DCF038319CF for ; Fri, 21 Jun 2024 16:59:06 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 5DCF038319CF Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=suse.cz Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.cz ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 5DCF038319CF Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a07:de40:b251:101:10:150:64:1 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1718989148; cv=none; b=P8zzt9C0juIP/U4qdw1uWWahRGMIz6nXH2Neg7nyIWUdfXvcIpeWeliHF0M3b/lTKX1drqMyXxTzzOSIrpQEaNSlMiLahi6b7/djVpFdd2TctAI9CFXChJzcuudaiv4fjSxtO6xdUgk24tIZb4Uc8nzLoTZuUGUcfLHcZVCIlkY= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1718989148; c=relaxed/simple; bh=Zjx2ws1oNlkv8BuRY2nurBOoITM70W5+LkWqA41zYD4=; h=DKIM-Signature:DKIM-Signature:DKIM-Signature:DKIM-Signature: Message-ID:Date:MIME-Version:Subject:To:From; b=HNBdx+DI7LW9sHE+TffxHcFQvx4FQS202Onw1LOr+t16f2EMy3OEUlj/RXPki6CHvpt5rYGoloimuZqcGaozAZwMd/3dmJ/efjuB4aVZGgIIBAoR7Zus0KlDOwUEyrUzOjKjQvm8sN/M07Xb/HjI7A7wSDuOjDVKebZo2v5DF2Y= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from imap1.dmz-prg2.suse.org (unknown [10.150.64.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 7847921B3B; Fri, 21 Jun 2024 16:59:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1718989145; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=1B2NrbXR28YLrbhIZH3ZgOinhtvnz1bz6ZYuqab/CVM=; b=GgN0UOkAIdJ1KIli9SPZcXz5lBN0ER/m3Bg+49sRDe8pp67HhXzm1cY1FIcl7I+WnAcpGI oN+/a93mCBhJ3x8rm92Ehx21wfOCZZXtkKOKB599dXN5kq+X2KiiyODJMBqRf1+Lv1ty+c 4cCpfZWD86ByAdiwkW6WPuTiTSstdkI= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1718989145; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=1B2NrbXR28YLrbhIZH3ZgOinhtvnz1bz6ZYuqab/CVM=; b=6eSGRyYDaS2FQ48nyXFp5Ujpxn382F1qFayEWR07N2V9iibCiK8iawudqrEgjegEnrf7NJ 7Z/sN929uVRclwDw== Authentication-Results: smtp-out1.suse.de; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1718989145; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=1B2NrbXR28YLrbhIZH3ZgOinhtvnz1bz6ZYuqab/CVM=; b=GgN0UOkAIdJ1KIli9SPZcXz5lBN0ER/m3Bg+49sRDe8pp67HhXzm1cY1FIcl7I+WnAcpGI oN+/a93mCBhJ3x8rm92Ehx21wfOCZZXtkKOKB599dXN5kq+X2KiiyODJMBqRf1+Lv1ty+c 4cCpfZWD86ByAdiwkW6WPuTiTSstdkI= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1718989145; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=1B2NrbXR28YLrbhIZH3ZgOinhtvnz1bz6ZYuqab/CVM=; b=6eSGRyYDaS2FQ48nyXFp5Ujpxn382F1qFayEWR07N2V9iibCiK8iawudqrEgjegEnrf7NJ 7Z/sN929uVRclwDw== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 635D713ABD; Fri, 21 Jun 2024 16:59:05 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id Z55xF1mxdWZSWwAAD6G6ig (envelope-from ); Fri, 21 Jun 2024 16:59:05 +0000 Message-ID: <780f5e2d-779c-4f66-94d4-dca5ffdde2a2@suse.cz> Date: Fri, 21 Jun 2024 18:59:05 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 4/7 v2] lto: Implement ltrans cache To: Andi Kleen Cc: gcc-patches@gcc.gnu.org, hubicka@ucw.cz References: <18cc1c3980551ac1881eea6e78811a629c7baa82.1700222403.git.mjires@suse.cz> <788aa123a8fd4bbfa8a80eda37fbacf38ec78c9b.1700222403.git.mjires@suse.cz> <8734p7wlrx.fsf@linux.intel.com> Content-Language: en-US From: =?UTF-8?Q?Michal_Jire=C5=A1?= In-Reply-To: <8734p7wlrx.fsf@linux.intel.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spamd-Result: default: False [-4.28 / 50.00]; BAYES_HAM(-3.00)[99.99%]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_SHORT(-0.19)[-0.940]; MIME_GOOD(-0.10)[text/plain]; XM_UA_NO_VERSION(0.01)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; ARC_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_TLS_ALL(0.00)[]; FUZZY_BLOCKED(0.00)[rspamd.com]; TO_DN_SOME(0.00)[]; FROM_HAS_DN(0.00)[]; DKIM_SIGNED(0.00)[suse.cz:s=susede2_rsa,suse.cz:s=susede2_ed25519]; FROM_EQ_ENVFROM(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; RCPT_COUNT_THREE(0.00)[3] X-Spam-Score: -4.28 X-Spam-Level: X-Spam-Status: No, score=-5.9 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On 6/20/24 7:45 PM, Andi Kleen wrote: > > There are much faster/optimized modern hashes for good collision detection over > MD5 especially when it's not needed to be cryptographically secure. Pick > something from smhasher. > > Also perhaps the check sum should be cached in the file? I assume it's > cheap to compute while writing. It could be written at the tail of the > file. Then it can be read by seeking to the end and you save that > step. Good ideas, but with only minor benefits relative to time spent in LTRANS phase. Current focus was to create simple mostly self-contained implementation that reduces LTRANS recompilations. We can do these more pervasive improvements incrementally. Just to clarify, the hashes are computed only once, then stored in the cache. > The lockfiles scare me a bit. What happens when they get lost, e.g. > due to a compiler crash? You may need some recovery for that. > Perhaps it would be better to make the files self checking, so that > partial files can be detected when reading, and get rid of the locks. It uses process-associated locks via fcntl, so if the compiler crashes, the locks will be released. If the compiler process crashes and leaves partially written file, the lto-wrapper deletes it in tool_cleanup. If a file is missing, the cache entry will be deleted. Michal