From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.128.42 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1794394154; b=ZY5Nwd+Zu/OqxQ0ACAon5482N7PvoNC57lt8t0HO/zdNVB9mTDf4uHydSShbo4gtG+e2 kYybR7tBp6DHLkpaWh+oAzUODbVG7NvotGTrQBh7/tqFs0BX9aG55iXjpUVghhqJBuAbX KyT6SzksZd7kb//Y6D5mSNEP77aIde1QwoQDHBdBlvPBMjpe6DrOfTAgbwNKNa6tzoxQZ 2/+TDw1gZ05tg8+mVgzOP8Bt4yLT4uU/nwKcS2vU8KwkhuOla3Uypvji9nCJizjcE8+C1 ZHxlZTLVBNjy7zKZ53Hx7PH5sTa6Y/YZnjDROz+DDXUwYsNOqrb5y3Iv2ZhYYZZeS4Q== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1794394154; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received: From:X-Google-Original-From:Date:To:Cc:Subject:Message-ID:References: MIME-Version:Content-Type:Content-Disposition: Content-Transfer-Encoding:In-Reply-To; bh=fkkdgBcWl/gXMWZL41R2xtfz4IY0JzduuuEbE0bKcow=; b=ybEMI56IXiem8QUE7Q/BNKslsep5+UhyAfqehutz338RRYzDDXrUM04OBMNzKIA/M+Pm e/wYbH68zD0kfKsKxMQzj6fNqVzghrBnB232fYeiKDIf7KPUm3zzt/UIONTNeAEEaA16t 3IWJAMkk5My33qagxZvSR6gdi1+momjwWscIJkJH8RRLdShvVSql9wTxfIOZ/clxjyfTW nvoPVSZBfLzUtY7it5rqfbrD/k6vSwmZ8kKM6NzMMChZGaqzrRAY8ZYURDfo8xQ6wQJHB d3j9qtKzjQ1pja+gbKyoOTzajH1sMG3zPXKXbsCDMkHgj4n2PJtwZSwPfmveHNcbxMw== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=oooZo4JY; arc=none smtp.remote-ip=209.85.128.42 Received: from mail-wm1-f42.google.com (mail-wm1-f42.google.com [209.85.128.42]) (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 893A2606A89E for ; Wed, 11 Nov 2026 10:49:14 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 893A2606A89E 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.a=rsa-sha256 header.s=20260707 header.b=oooZo4JY Received: by mail-wm1-f42.google.com with SMTP id 5b1f17b1804b1-4a1b07c3c5fso29050965e9.1 for ; Wed, 11 Nov 2026 02:49:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1794394153; x=1794998953; darn=vger.kernel.org; h=in-reply-to:content-transfer-encoding:content-disposition :content-type:mime-version:references:message-id:subject:cc:to:date :from:from:to:cc:subject:date:message-id:reply-to:content-type; bh=fkkdgBcWl/gXMWZL41R2xtfz4IY0JzduuuEbE0bKcow=; b=oooZo4JYlJ2CA1rNGsEhbm/Vh1zARDhdjXBHBkBQFL9enJyj+XofgSJLMeZ9+GKxbo xok/3WGW+7zKaDcdDmW6AmGqsymXOQ6yiG/TEMbbbrEyTpuEH96hQdA2JsfLDtw41Eyr Sq2XWmm/XXn4bmWMceYyGu6JBYckHG8RS4VEVfx00q48LCt7osTBKv7fub58aMqyjRoZ nslXmn7Y+YxO6NwpCpCXO3PtFaKh9qhBufe4ceuiQ2H30+4TNUaM/4xKC0tBs6QDF1P7 vrmAAtrDs3bzYwahjECqPBoax5ttmw1jsuUmag3V4MtFo5Y25+V2ukVgT+hGMBD5uaJB CsVQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1794394153; x=1794998953; h=in-reply-to:content-transfer-encoding:content-disposition :content-type:mime-version:references:message-id:subject:cc:to:date :from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to:content-type; bh=fkkdgBcWl/gXMWZL41R2xtfz4IY0JzduuuEbE0bKcow=; b=t3XBDLhbrfA+1r3Q/PpAsqHIs1mprwCGlcYtp+MEJ4N4spvp3iHGiWlU8/HY9us5Pw UMxvS5GYGUHMGtqPozKgbeDLLt5W+vBRRkN6AywuvHeCifbpG0SK2k3pMkGbsJ9EMZk5 ClYMGfMyv3aCn06qDjzhIaqmJxiJRuIm0kMR+4/O2aukarvp+Y+FT+pBrrWwWn2+UwRt /UtezBiKfV2hUaSb/XoECnV4pEszTFmpW2slbTuJ9W0eSBllzuVdv3nO2HA/hM003DzX pOkZk49wOEHN4qNx8KgC2XMfz948+JJpfQCdk+U7EqZhRrm179SgDxWzxKqwIZ8QOhOP kscA== X-Forwarded-Encrypted: i=1; AL+hErEqSmIPI1tgGt0FSwpam4Yzy+PjSvEKXcrrSu5MxjiPzvi677fzgsrxaSwpcWYRiduyTLfrRUd8i1qA6C4=@vger.kernel.org X-Gm-Message-State: APuU4Z/UrbgESIODXQAqbXM/ETJbunfgw5Hvn536Te7CTEhV7aQ8uhuf 4tJ/m1ytOCRsFlcRvVQwcgP9HTIKRY3HXuBxMD+4C1d5OPOZXvwhLXd3 X-Gm-Gg: AYBFou2qeIYkaiB/qTBZgvmtxwFZCnKKFCXuh+5/s6OF39+9hnTi2RWOA4hmNkDg0Fs nDQBvZJqS6pI78vhvbNLBZpiIN++OuKreMn13AhJsCgxSE1y9CQeGXgKOSFHMRXl4TYEYYfGTc5 Trp6Rs+kbXlXQog1AExlzu8fKZwyb+lsZzbPJlEwxc//ajHbfTcCDqv6DwwW2T9JCuHGpRLDkI0 DOVN4rsqnkDKEwqLXm+mrxsSxx3NWToyTPhtdZR0f0HLQd9aFvedlVqnn7jCuEFxs9CCYXpcC1H DPByD5WyCZtYA45QmMx4DVTOCxpualXI6q6Mhu2esSivY6/0UkvrecDvDtS/Wy0p2hsLXwhauDP tpbJUQjlqlQ6uWwjcXMR80vYGpTkM0TxVII6fVoCq6AMtP+diJy5kQr6M7C1zFVK/lSqx8nDryu x9i+5pnQVYosgTJy7bZaHWVpc+fcvRD976MxixZf/sag5ygpKlDBSP6Imt2yR3PLuO711pgNNyI 6xYSaUR63CVfBZ7dtI56ajH2icY0FHuGdBQEM2dZz53DHbc15az25dh4KrIHLw8393QwwHzWm7w S9M= X-Received: by 2002:a05:600c:19d0:b0:4ac:aae6:6401 with SMTP id 5b1f17b1804b1-4ba09375031mr37014455e9.12.1794394152548; Wed, 11 Nov 2026 02:49:12 -0800 (PST) Received: from krava ([2a02:8308:a00c:e200::25dc]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-49835d2c05dsm10153242f8f.25.2026.11.11.02.49.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Nov 2026 02:49:12 -0800 (PST) From: Jiri Olsa X-Google-Original-From: Jiri Olsa Date: Wed, 11 Nov 2026 11:49:10 +0100 To: "Masami Hiramatsu (Google)" Cc: Jiri Olsa , Naveen N Rao , "David S. Miller" , Peter Zijlstra , Josh Poimboeuf , Jason Baron , Alice Ryhl , Steven Rostedt , Ard Biesheuvel , Thomas Gleixner , Ingo Molnar , Alan Maguire , x86@kernel.org, linux-trace-kernel@vger.kernel.org, linux-kernel@vger.kernel.org, bpf@vger.kernel.org Subject: Re: [PATCH 04/13] kprobes: Maintain an rbtree of registered probes Message-ID: References: <20261109194916.1089703-1-jolsa@kernel.org> <20261109195517.1090787-1-jolsa@kernel.org> 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 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: On Wed, Nov 11, 2026 at 12:38:03AM +0900, Masami Hiramatsu (Google) wrote: > On Tue, 10 Nov 2026 11:37:38 +0100, Jiri Olsa wrote: > > On Tue, Nov 10, 2026 at 08:12:19AM +0000, Masami Hiramatsu (Google) wrote: > > > On Mon, 9 Nov 2026 20:55:17 +0100, Jiri Olsa wrote: > > > > Add an address-ordered rbtree for registered probes. Keep it synchronized > > > > with the hash table when probes are added, removed, or replaced by > > > > aggregator probes. > > > > > > Could you tell me why don't you use hlist (get_kprobe) instead? > > > I would NOT like 2 different lists which is basically doing the > > > same thing. > > > > The speedup comes from finding the first relevant kprobe, then iterating > > over the remaining probes in address order. The hash table supports > > exact-address lookups, but it doesn’t provide that ordering. > > > > I agree that maintaining both indexes is less convenient. What do you think > > about centralizing their updates as in the change below? untested > > If you can replace the hash table with other faster design, it is OK to me. > But I would like to avoid this simple-adding another lookup table for the > rare usage case (because of the maintenance cost, and duplicating a list > makes it difficult to handle cases where discrepancies arise between the > two lists.) > > Can you change the size of the hashtable and measure how the performance > is changed? I need more options. yep, I'll check on that jirka