Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp2713833rwl; Sat, 1 Apr 2023 13:08:25 -0700 (PDT) X-Google-Smtp-Source: AKy350ZVI290oDIpj8t2ZanseI45cUJ9f+Bj5W/xUNKiFqx7yNFnJV3/DDGRUC5rDWS1sIOlT6uq X-Received: by 2002:a17:906:1d0a:b0:8b1:7b10:61d5 with SMTP id n10-20020a1709061d0a00b008b17b1061d5mr32999884ejh.33.1680379705633; Sat, 01 Apr 2023 13:08:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680379705; cv=none; d=google.com; s=arc-20160816; b=jg5/YDXF5cF3uvrl0m90d751bCWhDQJ5u2c8aaxxN2RGK8ASH8gP0xLETQrs+AB976 Ob0WdZXabzyPdn+McGiL3yHryMNf66aUmfCaBcLZ0jSgVAq1Z+zjQbTlBHt6RUWMnDr/ njB7RpdRSBzxF/xVoB3to3LmOf9IcLbkxOqzoV/kPm9ptkxeSsA0Ou3CHHvG9w4AUd67 40OHIy5xWlXP4JwN/rvy200uVs9VEpk5YjOC8IbXeSrgIpvscvowfDi0zZV6aKcwgiQ1 Bn7w5KgzF5Zp6uaJcDVB/L2/JmhPd0yH0XZ0AZHbFoCZyLI6JZMkCfjdZAXRh/RHKza9 syNg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=55VzfyOLyKrmQayXTe0Ok8WFjIJZ8kHqyvefO/NMooI=; b=AfXJX3dV5eRIxQ0Y0AVKb80Gbdr1iu9LQcqhDbunGd6c85cwx2Gat5X0H14uRnEWeI oK9hZCMhsn9Ni5Gs6iJi2iAuhLWDCj7Zj0HuFnPkrA03f70mNBdBlTHktz3nLIYfWogl /MekoOlNfIr6zRR8LBYKTo7gdRNrBv1wwOYtULbHch//IN1uvMNIG1csXs+2RiVK7LBm JYYGjSbzGR4TNbaBt7gDUccx4FpTi17RMK2Emt49bcbpNMb7UU2XTA1SN9eNL6JN+JNL Aky3GnslfNJFGVsgm0EdenPAL0c6+hVPB0Z0SsDHSKWRhi2idjTFbqQoEeQvaT5/tk0o nDNg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@isovalent.com header.s=google header.b=DLJRLpPz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=isovalent.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id gu23-20020a170906f29700b008cd525eac74si4415050ejb.836.2023.04.01.13.08.01; Sat, 01 Apr 2023 13:08:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@isovalent.com header.s=google header.b=DLJRLpPz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=isovalent.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229450AbjDAUHE (ORCPT + 99 others); Sat, 1 Apr 2023 16:07:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35674 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229722AbjDAUHC (ORCPT ); Sat, 1 Apr 2023 16:07:02 -0400 Received: from mail-pl1-x62b.google.com (mail-pl1-x62b.google.com [IPv6:2607:f8b0:4864:20::62b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0368BB76B for ; Sat, 1 Apr 2023 13:07:02 -0700 (PDT) Received: by mail-pl1-x62b.google.com with SMTP id f22so20456046plr.0 for ; Sat, 01 Apr 2023 13:07:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=isovalent.com; s=google; t=1680379621; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=55VzfyOLyKrmQayXTe0Ok8WFjIJZ8kHqyvefO/NMooI=; b=DLJRLpPzbqyNUw3Abs2sFgLvaXGi7PRyYhglY8RJuMhT2bGzYs13qdo9vcHy8Vbayb yqBSVM1y/zkE24q+o5FlsaacfP9aN6BG8wUosiwARFc0lqLqvuQ1i6grWf3G/8KWHbQf z3qjzED4miHFq/H8fCtMv1YkaRDARVK3SXKVlmfrToTx+VFIWzCH5u+/8jPKv8C9Ulla 6yGsfl2NxWg6ylwO8+M8rjmNYnaBZ/QurAjEFPa37ljGSwahhJRc8HNFQtKBiR+QUndY MoGDMhVxdRdoCOqzMlZkTIYAAc2iHTgt6uJMiZvVK07dyRtA/cbz3bYfRNiY0LIP6Q8h JhAw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680379621; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=55VzfyOLyKrmQayXTe0Ok8WFjIJZ8kHqyvefO/NMooI=; b=dywRArPPqdm1F8kTFKg8IIDGqfdSUA1z0b4iPr+asnqXPNVd+0n6bzg+uV3F5w5wCh XJg2ziJpRQobbjros0xEq05hZ/QGMg1jSkk8gK0SVv7bOSfBpmgRIxHbJDrMD3+jZpng EFbivshCRdMPyVZvt1y8W3T/NjWCLcEqdW4RxyWQv959Wd/CDwHbBIcXon2dwHREsqLq WScIN0FR1BxWwCqnUthZehGY0ECbvWngfhsNs/bFItlGBSGt47ah88/p7NUiFiag+EK3 3YV3lQLt8mNOpiHnE54jroU1nCVOGh1CJrTg2/TCJwc7Yxps9AbGxrRgjdRn83Jza1ZQ rRdQ== X-Gm-Message-State: AAQBX9c4bD7P1OPbQ0ner/TcTHPKZjeQB3f9rrR81L2k9MKcb89Oi2jA MyAPw1OTK+JJhEsNiJBxcygCbw== X-Received: by 2002:a17:90b:4c4a:b0:23b:bf03:397e with SMTP id np10-20020a17090b4c4a00b0023bbf03397emr36423906pjb.24.1680379621427; Sat, 01 Apr 2023 13:07:01 -0700 (PDT) Received: from carnotaurus.. (c-73-231-147-44.hsd1.ca.comcast.net. [73.231.147.44]) by smtp.gmail.com with ESMTPSA id x20-20020a17090300d400b0019f27fd7cecsm3715438plc.197.2023.04.01.13.06.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 01 Apr 2023 13:07:00 -0700 (PDT) From: Joe Stringer To: bpf@vger.kernel.org Cc: linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, ast@kernel.org, corbet@lwn.net, martin.lau@linux.dev, bagasdotme@gmail.com, maxtram95@gmail.com, john.fastabend@gmail.com Subject: [PATCH bpf-next v4 1/2] docs/bpf: Add table to describe LRU properties Date: Sat, 1 Apr 2023 13:06:50 -0700 Message-Id: <20230401200651.1022113-1-joe@isovalent.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Depending on the map type and flags for LRU, different properties are global or percpu. Add a table to describe these. Signed-off-by: Joe Stringer --- v4: Initial posting --- Documentation/bpf/map_hash.rst | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/Documentation/bpf/map_hash.rst b/Documentation/bpf/map_hash.rst index 8669426264c6..45d923cd16c4 100644 --- a/Documentation/bpf/map_hash.rst +++ b/Documentation/bpf/map_hash.rst @@ -29,7 +29,16 @@ will automatically evict the least recently used entries when the hash table reaches capacity. An LRU hash maintains an internal LRU list that is used to select elements for eviction. This internal LRU list is shared across CPUs but it is possible to request a per CPU LRU list with -the ``BPF_F_NO_COMMON_LRU`` flag when calling ``bpf_map_create``. +the ``BPF_F_NO_COMMON_LRU`` flag when calling ``bpf_map_create``. The +following table outlines the properties of LRU maps depending on the a +map type and the flags used to create the map. + +======================== ========================= ================================ +Flag ``BPF_MAP_TYPE_LRU_HASH`` ``BPF_MAP_TYPE_LRU_PERCPU_HASH`` +======================== ========================= ================================ +``BPF_F_NO_COMMON_LRU`` Per-CPU LRU, global map Per-CPU LRU, per-cpu map +``!BPF_F_NO_COMMON_LRU`` Global LRU, global map Global LRU, per-cpu map +======================== ========================= ================================ Usage ===== -- 2.34.1