From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f54.google.com (mail-wm1-f54.google.com [209.85.128.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6DFF634C155 for ; Fri, 23 Jan 2026 09:36:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.54 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769160990; cv=none; b=rtBiuGly1ibWyjzeUpQQfDo0v+mDjWBhWtWtSWZ8M0Ig1mgbE0Bj830r2aPe4hi0VyWmQfn3xBlWOxuaJxRgs3jp0p3rrBp+Nyoc9ryt5PCiXxQFt+KLHg6GAWZXw5vVo6siC6Ec0Zbw+p51vFQc/OpjxHiCgz/xwfwyfOQL4+k= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769160990; c=relaxed/simple; bh=UHCtzZUwNmJVex/PidjG1QhsgZr3sHuco2k9/TFidh4=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=hk6eg0oaFtpa4HT3/0PEiAW87R21/CCERmXTQigDV8saZm1ivBJgMdQMYTpefHLRvnoTYugbULfHI7bDpXDA0w4iGiTgWmR5BtgS6KuFlqrKHl2KGEVBw0+YgQSBkeHPanSa+GaJ18dElJBYsaC05nYwXoXSBD9YzWfsvHIg5QE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com; spf=pass smtp.mailfrom=suse.com; dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com header.b=d7Tzg02M; arc=none smtp.client-ip=209.85.128.54 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.b="d7Tzg02M" Received: by mail-wm1-f54.google.com with SMTP id 5b1f17b1804b1-48049955f7fso14354475e9.0 for ; Fri, 23 Jan 2026 01:36:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1769160981; x=1769765781; darn=vger.kernel.org; h=content-transfer-encoding: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; bh=Ml193Cxw+2y2CyhUl9eY/flN/zutVC5TnFaQhjrJlN4=; b=d7Tzg02M22dfWu8JPYQY/z9qZRSZdRQaQ2Duc6QTYQ/IumvpC4DyB7alcAanyqOXCx 9OLd8E33DmgQyREZ3zDxq7O9oxNSJ6S4FfudiZ4zWh71h97dV8mYA+LWBf7quEnx8O1U ORikHgVJ4LEjLuvAZNfcwcKbNvQi0uZs8v0oBLCaNLo+r7hpxiov2MbuO3ABwszn84Im KvFIbLMF1Z2dSKocCzeT1iBCRvLlYK7iAtEP2n3rpBuAvaTmKArLs+LY7qIFAf+L9zE1 qoFRd123269oyJO0KqtAOb/Xlkbny+XuyiyhZSHQx6aF7/8JJOwr2iCYZrTSOq7ZqDdo +QcQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1769160981; x=1769765781; h=content-transfer-encoding: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; bh=Ml193Cxw+2y2CyhUl9eY/flN/zutVC5TnFaQhjrJlN4=; b=a1jfnIpZnxgfQEAVBdvSeXwJ4qdS8pd+vE9uSavgBS3StJNsO24ufzOAx0+prz8Xj+ BinI6QjTcrD4f5BASeCp/Ju8Tvv5T/8KzpJi4jfks1DogwR93csWCxrYSsPgSnCEcF3j Rx0i/Gmdg5EjiOBVmp85Buqj2TAzWSlHvF31gEks8c1P3XvyO6a7l0Y7rSCZ3+K4s6z+ AUwl37AIx85q5f/NrCiNab59xjqyPDXlgmSE0NJ+li3MggNPDfVDUqxbcfbDSMcQ2v14 LUwv43h3BbpLNzO+ukd1zs4JXL8HmYJv2VCkbQr9sWTOyroHB6TdZIpqaJsZ9fys/Gff NWbA== X-Forwarded-Encrypted: i=1; AJvYcCWj48EQxybh+wsvPXd0q0oojbo7t8I9+dctgX84tXYhxwHRVRf57fsu5+GRV7M3cC/C/88BrQ6TNzNUZNs=@vger.kernel.org X-Gm-Message-State: AOJu0Yzej+4M5rlRfT2KgOX+zeeyDLuWdeUsLReEYZRIDUlMhM01e3sb boDGRlPJILws6moaYYA3HTMitOtTQIf+R5WRJ2bmHMgHMrbRKj+j6Sy09GHyRiLcPLs= X-Gm-Gg: AZuq6aKpIorjlXY6k9iVOFD+OfK4PIyTVDieUI2vMR1sYbHVnDWWcomMaM3uZbuRHf4 d9dxv+bjZQ5RvIxiTUrHtg/16FI0+4I1V0wKAyYpei5C85dM0UAjTLMVOAUd8e1RY4jIdD9lzYR LrpJBk8/Wz0u543ys/uKBvSbnjm7JiezVZKfE69vqe3H5pPlU0HrjZXqqWJA/NvRB4pIqxXZWMS D83Vtcrb2HN2q+mnGXnvCVR4xKGb1RMHoya0qqZjHjg5oR802BH6JMYcXDrBMW6PGvkdDBrw7KA Vtjil5kEu4FZ58A2qGXXhaXcWkBI1mgiSClXiv8czIviWRWKmkHoObPNoA327AGhp7bOuWLdwBv xhy4pxVgl7sbeJci3+DoguY/hHCea8R6TJbt2UHJudqP53/dDnfMjnF+4oFZ44BsOSaeeZnHm2I /KBJp02W0C9EMADbH9YAeQMwA1XnyyfNvRGREr51/H X-Received: by 2002:a05:600c:6095:b0:480:4d39:84b3 with SMTP id 5b1f17b1804b1-480511e4ec0mr12497115e9.6.1769160981070; Fri, 23 Jan 2026 01:36:21 -0800 (PST) Received: from [10.0.1.22] (109-81-1-107.rct.o2.cz. [109.81.1.107]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-435b1f7b4d8sm5009841f8f.38.2026.01.23.01.36.20 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 23 Jan 2026 01:36:20 -0800 (PST) Message-ID: <198d1ca0-031f-459c-89bd-6d438a84fcb9@suse.com> Date: Fri, 23 Jan 2026 10:36:20 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [RFC PATCH 1/1] module: speed modprobe by adding name_crc to struct module To: Jim Cromie Cc: Luis Chamberlain , Daniel Gomez , Sami Tolvanen , Aaron Tomlin , linux-modules@vger.kernel.org, linux-kernel@vger.kernel.org References: <20260122234621.3403276-1-jim.cromie@gmail.com> Content-Language: en-US From: Petr Pavlu In-Reply-To: <20260122234621.3403276-1-jim.cromie@gmail.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 1/23/26 12:46 AM, Jim Cromie wrote: > "modprobe foo" currently does strcmp on the name, this can be improved. > > So this commit: > > 1. adds name_crc to struct module > 2. modpost.c computes the value and > 3. outputs it for "modinfo foo" to see/use. > > 4. adds hotpath to find_module_all() > this uses name_crc to do quick "name-check" > falls back to strcmp only to guard against collisions. > > This should significantly reduce modprobe workload, and shorten module > load-time. > > Since it alters struct module, its binary incompatible. This means: > > 1. RFC for its wide "blast radius". > 2. suitable for major version bump *only* > > 3. it opens door for further struct module reorg, to: > a. segregate fields by "temperature" > b. pack out paholes. > c. improve cache locality (by reordering coldest on bottom) > name should be cold now. > bikeshedding is appropriate here. > > NB: this isn't a substitute for CONFIG_MODULE_SIG. > It reimplements crc_le(), doesn't reuse kernel's version. > > CC: Luis Chamberlain > CC: Petr Pavlu > CC: Daniel Gomez > CC: Sami Tolvanen > CC: Aaron Tomlin > CC: linux-modules@vger.kernel.org > > Signed-off-by: Jim Cromie > > '#' will be ignored, and an empty message aborts the commit. This patch looks as if it were generated by AI. If so, please avoid sending such changes. Otherwise, the commit description should explain the affected workload. This should be backed up by actual measurements, showing how the change improves the situation. Implementation-wise, I don't think this is the right approach. If searching by a module name is a hot operation, a hash table can be added to speed it up. -- Cheers, Petr