From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.128.51 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1794242593; b=fdfkGhVHuVDB0Bf84/RfuM37/CMw0gZSAtRedqkiTyEIoHbgoKGsUe9f2PmnZ0TpvquG vhL/VcJE6KggchWqY+caOSqL+uBTJJk6UbQlo/lbgGCM7Tmv0Xqig/epS/pXX1//gXvkh HsOS1awDAf+tdqRzDPvNOJQ/XRc8dMZVA8uICzEp/NXW6YZDYFl6coMKnErveK7tfKTvh LGfdUUPTkwiIfWhDb5Zvk9DqJuQIsWV0f6Je40TYu2sNJr/RuRW8S8A4Zxj8EeZgcZATm 3rjU+kvvOqTfvFNnMeCEClKKyCTXlWt5J3JnCLzRnrAvNTgoQ+wwex4MeihVjToAP/A== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1794242593; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received: Message-ID:Date:MIME-Version:User-Agent:Subject:To:Cc:References: Content-Language:From:In-Reply-To:Content-Type: Content-Transfer-Encoding; bh=HLYen38mKGP677B1oAzbJm7ZesXCZSDjKVwDLOHWtRg=; b=nGDQ87kOedHO/+UG9A32liaP6oT8fzRGOsk00c6U+kHl7PuJsSmVygzFCOFKy8BwdMiD KdxBQNzbSBH3PHZA1P4YrQfTsWTJIZBBNJTNWLCnH1B8w97F9vTo95kjBY65zN3gMngcp /AXmpLrE6gGhLixaNCNzASSc0AXoJPLwKoUhbU81nvb0zN/Lts3uDi5NZR6lvSlKj4F3H AEzCpHaT4WllHkHTHg4LXYlbpmrnfXfZ+ffdo8gMqk0RuL6xohcMa57JuKdvDW61TAQDY AMi1J2k1vWLHLJB0O+m9RgMsc4Xv/x48Mxd9zwzcNhfmrG7WiRI5m02lIi28jafLUeQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=suse.com; spf=pass smtp.mailfrom=suse.com; dkim=pass header.d=suse.com header.i=@suse.com header.a=rsa-sha256 header.s=google header.b=YGuhw1oZ; arc=none smtp.remote-ip=209.85.128.51 Received: from mail-wm1-f51.google.com (mail-wm1-f51.google.com [209.85.128.51]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BE10A606A335 for ; Mon, 9 Nov 2026 16:43:12 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org BE10A606A335 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.a=rsa-sha256 header.s=google header.b=YGuhw1oZ Received: by mail-wm1-f51.google.com with SMTP id 5b1f17b1804b1-4a9a8d6cea8so13493115e9.1 for ; Mon, 09 Nov 2026 08:43:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1794242591; x=1794847391; darn=vger.kernel.org; h=content-transfer-encoding:content-type:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:from:to:cc:subject:date:message-id:reply-to :content-type; bh=HLYen38mKGP677B1oAzbJm7ZesXCZSDjKVwDLOHWtRg=; b=YGuhw1oZxUPL/bbx+i0ijosSnISYIbUul/qGq2zAELOacB08dvYDccSx/x9rU6g9gl QyPht0zwbkvD9ejc3WNj6TDVij9KZUrBEQ9Xt5i0q2PMick2I5G7BiPPIhuJ5QsC5cpF Hc9VdS41J2qakEC5kRjP6W1h9qpqNpRyQS76N9UiluO+WrKbrxUc+eHpH3MgwEVU/LBg EKYTjvlmvVcRDnUT5YdBxwyzf6msDAIK2mLzEprKTk57LkQxxSPMwQJzYJo0fRMdPBCc S1EcyuYCyB06Nre1/tH9qJ9dfWqNPjCBc4QnRUd5kWvI+126KhchYL1WWv8hq+Sx8TwT sacg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1794242591; x=1794847391; h=content-transfer-encoding:content-type:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=HLYen38mKGP677B1oAzbJm7ZesXCZSDjKVwDLOHWtRg=; b=LSzHwRj35r/DH5z22yCAXqZnzo2QbZ/hxMnyHtPkDnOEkbPpacQJVm768NP73GufLk 65yFdXcKjwGQkxXbmk9m3N/8e1IC37gK0Qjf06PAsrNdt/vqHSYy4d6Slz9GTllz4Go0 qO5MrhV7npq4CGIXqnsMlX5ULWc7uZErdT8iqfiwR+WhyyWebY8ecvFIu+5OYWl60iWI GQXpYyvht5obQGBwlDK86TIpUbENyJbBlK7hjjiIRgb6Hc/Pg+OmGExZQlj9S3n/RkAN g1bk6N7pD5TXUAjbvag+FlB2WrK0eqm4D9T7ZPq9nHAiOjfB2BpZHzLtRu7Gdu3/fdV1 5Ixg== X-Forwarded-Encrypted: i=1; AL+hErH1ca/YbB9KS9HX6oX+k1CUeL1BikQEYp+N6sFuWD9t8oKGL3F1hK5tOTmpuG3RIcI/LkpF3dEETgqrr+w=@vger.kernel.org X-Gm-Message-State: APuU4Z/7N1biLLl1pxzpK7AiQYE4m4fo8NRaGtN477nYwnM5Ty4Iln9F CVNRb2QQGneB1ccGLdlsBPK4ZOAMOeKFTzWpGcoY7xuUH+b1rqMhuy92XHwryNgZm0k= X-Gm-Gg: AYBFou0hV1P6Nxu8eH87o9j26tGxDKhkIjTZYcM4kr/+U136UlEpgiDBbmng5Gg/f03 SuD+3FJm/YKd1+AGonQxavdbe2mjBdZDKMb6PuA55/qqcEGjtMz7vEPIziuiXtVR7MYBjIg/Qlz 8Twj9FSmvLKCLRDHXFHpIdsqqCr6uNMcVCJMS+xCeJ6OITe/o+NUIXpxMblDVpRMRvHDO6yOk0n /tG5gRh9U7xqQysIM5sU2y64FCYuEFIebxrbJ86uRgKOk+dRkmP0vTK8485YtTPGSsm9zO9ST/f qOoWTBTqRQbW+moGKi+eJ4qQ3C6EGUWLQQaZrPVQ5jFPkGVySMTokWM80d7gAV7YZA8tdO3DTb5 hV+EjI9uzuMQofRVYCNcVc6qudTfi1W42FJjsCmoHXxPC8DrFCpfqu1syWjbWc/S2RrFfoI4Dzt 4VGRadTAl8xXoamR98sAz4Zu6HF/JbP+nqJ1wRiDysKvm2PvvfYGkQYiAteYwcR9Vsof126soSe 5eKoOv0WOdlx9TR5x0K0rqKnwySy+zWhEj2tNASZuwpt4+Sa19F4hyVe0f0g0STrDgVLPMTe6Va 3mX4gSkuhf5lz0s+1xdBot2gfKU9XJv1hnXfTGdMbPZv2dpeNeR3BC4egmbk7gbo X-Received: by 2002:a05:600c:3508:b0:4a2:526b:d40f with SMTP id 5b1f17b1804b1-4ba015b8c6amr1961265e9.0.1794242591012; Mon, 09 Nov 2026 08:43:11 -0800 (PST) Received: from ?IPV6:2a07:de40:8100:0:89a9:fd0e:583d:4a53? ([2001:af0:8000:1409:193:86:92:181]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4ba01d8ae9fsm806785e9.3.2026.11.09.08.43.09 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 09 Nov 2026 08:43:10 -0800 (PST) Message-ID: <1dddcf29-36a9-4ffd-999f-54b730c9ea27@suse.com> Date: Mon, 9 Nov 2026 17:43:09 +0100 X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v5 03/11] modpost: cache section relocation mismatch state To: "Lorenzo Stoakes (ARM)" Cc: Linus Torvalds , Nathan Chancellor , Nicolas Schier , Nick Desaulniers , Bill Wendling , Justin Stitt , Geert Uytterhoeven , Luis Chamberlain , Daniel Gomez , Sami Tolvanen , Aaron Tomlin , Josh Poimboeuf , Peter Zijlstra , Miguel Ojeda , Boqun Feng , Gary Guo , =?UTF-8?Q?Bj=C3=B6rn_Roy_Baron?= , Benno Lossin , Andreas Hindborg , Alice Ryhl , Trevor Gross , Danilo Krummrich , Daniel Almeida , Tamir Duberstein , Alexandre Courbot , =?UTF-8?Q?Onur_=C3=96zkan?= , linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, llvm@lists.linux.dev, linux-m68k@lists.linux-m68k.org, linux-modules@vger.kernel.org, rust-for-linux@vger.kernel.org References: <20261104-build-speedup-v5-0-0f6018be8dae@kernel.org> <20261104-build-speedup-v5-3-0f6018be8dae@kernel.org> Content-Language: en-US From: Petr Pavlu In-Reply-To: <20261104-build-speedup-v5-3-0f6018be8dae@kernel.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 11/4/26 7:20 PM, Lorenzo Stoakes (ARM) wrote: > For every relocation modpost invokes check_section_mismatch() to determine > whether there is any kind of mismatch between the source and destination, > and if so which classification applies. > > Each time it does this it invokes section_mismatch() which iterates > through the sectioncheck[] array every time it's called. > > When walked a relocation section the source is fixed and there aren't many > targets, so the same names are looked up over and over again. > > Therefore cache not only mismatch categorisation but also whether a > mismatch even exists for a given section and look up the sections in the > cache. > > Special indices (undefined, absolute, common) take the uncached path as > before. > > This results in very significant speed ups for allmodconfig incremental > builds. > > modpost is on the serial tail of every build that links vmlinux. > > Whole build, 128-thread Threadripper 9980X, best of N runs: > > before after delta > ------------------------------- > x86 defconfig, touch mm/vma.c, gcc 8.5s 8.3s -0.14s (-2%) > x86 defconfig, touch mm/vma.c, clang 7.7s 7.6s -0.13s (-2%) > x86 allmodconfig, touch mm/vma.c, gcc 33.9s 29.4s -4.5s (-13%) > x86 allmodconfig, touch mm/vma.c, clang 31.9s 27.9s -4.0s (-13%) > > Signed-off-by: Lorenzo Stoakes (ARM) Looks reasonable to me. Reviewed-by: Petr Pavlu -- Thanks, Petr