From patchwork Sat Apr 1 20:06:50 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joe Stringer X-Patchwork-Id: 78175 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp1412623vqo; Sat, 1 Apr 2023 13:18:45 -0700 (PDT) X-Google-Smtp-Source: AKy350bL2JjfAKrqtRkvk4QgZ8bamsZ33ZC5tblM5qKoNcZs5ofsgTHJWgMOWfcnJEKcev7dS5pt X-Received: by 2002:a17:903:41d1:b0:19a:b6bf:1df6 with SMTP id u17-20020a17090341d100b0019ab6bf1df6mr39042874ple.20.1680380324735; Sat, 01 Apr 2023 13:18:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680380324; cv=none; d=google.com; s=arc-20160816; b=Prm0tviCreWSu12SAn7VGS+U74oGwxvopGdc8O3m7c/mcIzhW6WmCvXD5Ng32+lIe3 vDdRXOdRmE/ObYk+mYgEUTLeCNsUGTZ6E6yDr9p9X5EFFl9YYQ2oeulu+LiNpDakLUIc dPlNBVH+YAl2KmxcUNLbaroUMOZZZOgrHxrvtyq6TCYuZENMZeos3sQL6oZAeWRXNBk+ Yy8gYtHWhgwGUn66072j8MQiu6DGr6+JDNMoPwJI3gWhb5AAb04Nz97kHOtrF1n8KoQb mTT2U0+awP5AweLTHpQ0MRT4gSabmM3VXQAUKzgq7fCB5GHqUeOIoy2+qr+3lMcvPavb pLdQ== 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d12-20020a170902cecc00b001a29ce664a1si5169228plg.366.2023.04.01.13.18.29; Sat, 01 Apr 2023 13:18:44 -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 S229789AbjDAUHE (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 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1762006479044889671?= X-GMAIL-MSGID: =?utf-8?q?1762006479044889671?= 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 =====