From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-oa2-f34.google.com (mail-oa2-f34.google.com [74.125.231.98]) (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 415EC368277 for ; Sun, 4 Oct 2026 17:06:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.125.231.98 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1791133586; cv=none; b=BFtfRYRh0X/f4AppbohCaSFD/bQK4Xk8dWsBr45mCVIkw5RX80ZzL9HNvsoXj2hLpboKO8BEoLu0Waadx7Tgcf0uUPG86WpyVrHwPFHbKUAVOLoJx/YKLP2kbfvlN7kWutvZI3LSk6ErNKSBOiOpdIX44hmrg8gPeEXMHQO/2/k= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1791133586; c=relaxed/simple; bh=vEr4v5UzCxd7Q67cxL7C+j9r5X+UpcvxAXoDSa/XGrU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=OtpsMe9r4Jb9lGDoUW0DE930DRdU2AemBBUT6swscml3+Gh0SERoHyAGh3aRQaFnrcCo0It1tLoXleMOdF2E4Ci/A39hF6GoYFHzq8NuD1mW0BUA0IVPypkQBiIq8IN/B0cliWGxKmyXF+NgoS2HjQZj52sDja4nIeWDOOXp4No= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=RqlYikaO; arc=none smtp.client-ip=74.125.231.98 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="RqlYikaO" Received: by mail-oa2-f34.google.com with SMTP id 586e51a60fabf-49aa2fa57adso125688fac.0 for ; Sun, 04 Oct 2026 10:06:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1791133584; x=1791738384; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:content-type:references :in-reply-to:message-id:date:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to:content-type; bh=vEr4v5UzCxd7Q67cxL7C+j9r5X+UpcvxAXoDSa/XGrU=; b=RqlYikaOnxkDd6DbFJrHXtch1lcBXpVJyZqO2aJ7xM2QOZKTmcygg2u40hZOZgfs1N Mbm4jgiuGdCfyBS0VDO47O0OdRYuxAorVMYwiaWGtLlHz7oyFoEvwXZ2SbQkrueHhCT1 mTESKW+zVXxLk23BeLti6t0Ais8X6jGTdGD5HoGrnEQEHmBIBayZYgddExZopd0bJ/zD +hNqzxMW5p2aISIEsoR/fTHbyUpjVroqYb4ZBZZutAlqr4YRzH0fhWrV7S5mzMSMZWje DK3Bida6sorx1VAD5nQKGeqdzIar0Rakk9/I3C83446nIysUoNy1dGzGlFGJx8H0MMod seLQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1791133584; x=1791738384; h=content-transfer-encoding:mime-version:content-type:references :in-reply-to:message-id:date:subject:cc:to:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=vEr4v5UzCxd7Q67cxL7C+j9r5X+UpcvxAXoDSa/XGrU=; b=zPBt9ctApTwj8bC9q8ONNhI5dCI85ELCT0/7q+v1MeUIv670NveSsPWEtDnCR7jJfQ Z36TveKW3+xmvup+79WWuZkTdSTX8IGfUHUBaSiVnjeZdtSNG6RR8y8QlySg/wcrCzQp YMp8QIGjRBTSHfXmzg1jBFSfw3qWWv+otu5sG2jQ+792en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e51a60fabf-49e15e91b0fmr5947738fac.25.1791133584217; Sun, 04 Oct 2026 10:06:24 -0700 (PDT) Received: from starship.unifi.local (107-216-42-6.lightspeed.austtx.sbcglobal.net. [107.216.42.6]) by smtp.gmail.com with ESMTPSA id 586e51a60fabf-49e16545353sm7403626fac.0.2026.10.04.10.06.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 04 Oct 2026 10:06:22 -0700 (PDT) From: Lawrence Lin To: David Laight Cc: Steven Rostedt , Masami Hiramatsu , Mark Rutland , Mathieu Desnoyers , Petr Pavlu , linux-modules@vger.kernel.org, Stanislaw Gruszka , linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org Subject: Re: [PATCH] ftrace: Avoid quadratic symbol lookups in ftrace_module_enable() Date: Sun, 4 Oct 2026 12:05:59 -0500 Message-ID: <20261004170600.1541723-2-deduce@gmail.com> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20261004100030.189b1c3d@pumpkin> References: <20261003-ftrace-mod-bsearch-v1-1-92e2fd2d80ff@gmail.com> <20261004100030.189b1c3d@pumpkin> Content-Type: text/plain; charset="utf-8" Precedence: bulk X-Mailing-List: linux-modules@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit On Sun, 4 Oct 2026 10:00:30 +0100, David Laight wrote: > Surely it would be better to add the sorted index as part of module load > so that all symbol lookups could make use of it? A sorted index used by every lookup is roughly what [1] tried, and its review showed what that involves: aliases, livepatch's references into the symbol table, and the lookups by name. I'd rather leave that to the module maintainers. For this problem, Steve's reply suggests something smaller. The weak locations can be dropped once at module load, so ftrace no longer looks up symbols per record, and no index is needed. I'm prototyping that now.