Received: by 2002:a05:6358:16cd:b0:dc:6189:e246 with SMTP id r13csp2695264rwl; Sat, 5 Nov 2022 10:12:08 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6ZeiJDC/TnBYS3TO5hO1Dpt3IZQ8E13jOg5HSy5ssFYLAe2etEUrsp5CF0+4mpGyxDA9JD X-Received: by 2002:a17:907:72cf:b0:7ad:7e95:69d7 with SMTP id du15-20020a17090772cf00b007ad7e9569d7mr38020310ejc.97.1667668328035; Sat, 05 Nov 2022 10:12:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667668328; cv=none; d=google.com; s=arc-20160816; b=TBSvDB+RGqgYyHNWs1sYthLTjXs1qNIllMQJDYD0aJHHOmBRVENTaeDvdq8ui3D8Hu cRNHow1Eyxx2B/E9Mfeq6zjZKO+4yZ9GeGViM0XZjwWbrsrs+0v5rpcCZeWo9DEU8pkm O4mOcpjXDCtgWrp0cegiv9eKGZmx9mk37jJ+GiHkkCnRzKC8/yyRLw0tRPfKBEySbBCl zB1VKRiRIQItRN6bXF1P15vpoJwExaZ82DjZTrPedUXsb7+tlQ4PdZxpXs5HrzDzMlAI /v2O8m/araIRjwKKU8GuXKGAV7cfRbKaVh9kfq/pIZ/BxPM9rjJIIQ+Ymo3iz/qKBy7G vDWg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=srQ3lTh3ov/uW1CynRa0KjN77ReKbgwHiOujQ3nMVGI=; b=VyqZpAp5Nay6ZGdN1VKq/42Q0F4o9TON5e3WU2Okxq/v/NT48B/L5Ed3pPUqpaPU04 FavfY+G3qGGkLBMVmw56mv7EPluQYFM6W82dHVnwmJmzculKlOXbrFtxMfuRVPgodGp6 01adptQjkxJ9N0rcQfwxinvGv1ADW6ak+gZfaepw5LAamDFXK5M0cAugl9pflbWaTUUb NcIfJu5FBvN2xUQmfAIOx6T25VamT5Vvm77nzw2lValvnv9Mgx4LXw3p4VLpxi0o4NCO 8g7Ez54zAxcShGngv7QsSaFx6Ulz/LvB3Z+O7La6TswspiXe8hW1FAnJ8pwCcenLgZAf VBQA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=P0kLwQwY; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id wu14-20020a170906eece00b0078d484e0e79si3402622ejb.481.2022.11.05.10.11.44; Sat, 05 Nov 2022 10:12:08 -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=@gmail.com header.s=20210112 header.b=P0kLwQwY; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230015AbiKEQUj (ORCPT + 97 others); Sat, 5 Nov 2022 12:20:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46590 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229776AbiKEQUh (ORCPT ); Sat, 5 Nov 2022 12:20:37 -0400 Received: from mail-ed1-x531.google.com (mail-ed1-x531.google.com [IPv6:2a00:1450:4864:20::531]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 60AC61A3AC; Sat, 5 Nov 2022 09:20:36 -0700 (PDT) Received: by mail-ed1-x531.google.com with SMTP id v17so11650529edc.8; Sat, 05 Nov 2022 09:20:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=srQ3lTh3ov/uW1CynRa0KjN77ReKbgwHiOujQ3nMVGI=; b=P0kLwQwYClIZzoWMQF0niGOEZY4ILluvbFpoIzNEfGSiaBf5YEbKrtilG8yOZt23rS A9Vn4TNmkIG8F/Z4HcJKJDpzol0995YgFK9jc/y9B+yZZWZv3sE6Q+tDvgndaqqA8tUa GBpk7naq0m1IqFdv0pbGxcfdRsz4I9XaPo0zt2YVWaQFjQ16FTBxaHdpFw/y0izCcaEf oSaYqWxONukSWy28TM0SRTQyooBPLQeQKL1DxvUuvEI00eHM33jFhETT2xm6tzTXGmwY O1RaLVhp/FW7yx2zx0x9KAWRtwguiW83/3ZEaOUVaVPx4HoKCop39fY8BUTvITaxccsp st1w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=srQ3lTh3ov/uW1CynRa0KjN77ReKbgwHiOujQ3nMVGI=; b=E9vVk8RXVOmGELl63j9QVDIKz0oEMf4Akj95O+VoAwrfat0qSa8hDdwlC/XWa1H8mv ool3eplXKN8lDD9bxIFLdDL6Y3Ux3JWUWfPS5aN1Rk75EUV53t6juzXaPlqXki0Klqfy shRJ/7eBbpr6Cq5DtnaKTcxiFfyt36CV1Rbvk0Cn8fPv+ND3yGEb6uBOHNLDUm3r9lHD B5igVF6hha87e5NrCSz+GaQ7XKaU8MD8bsXlMCPOJNCLgmtOL/ds+okcXJHKzLBJNrCK 98b9GqDD/QPU8VP8MMptWeAeO0R6GMInLZuIwUwMQo1p7YfYTKOC9JqYMNPjQQ1l+ukJ gbfQ== X-Gm-Message-State: ACrzQf0xAgfL6Z5DPXjoPh7rE7frbNZRe/Th3F0DR+9/G79f3xB12RIT +/4/XJO2cxw8G2RXa0H6+lmLd95Eow2VqPXe4iLXy2pJ X-Received: by 2002:a05:6402:5406:b0:452:1560:f9d4 with SMTP id ev6-20020a056402540600b004521560f9d4mr41547613edb.333.1667665234700; Sat, 05 Nov 2022 09:20:34 -0700 (PDT) MIME-Version: 1.0 References: <20221105025146.238209-1-horenchuang@bytedance.com> In-Reply-To: <20221105025146.238209-1-horenchuang@bytedance.com> From: Alexei Starovoitov Date: Sat, 5 Nov 2022 09:20:23 -0700 Message-ID: Subject: Re: [PATCH bpf-next v1 0/4] Add BPF htab map's used size for monitoring To: "Ho-Ren (Jack) Chuang" Cc: Alexei Starovoitov , Hao Luo , Jiri Olsa , Jiri Olsa , Andrii Nakryiko , Daniel Borkmann , John Fastabend , Martin KaFai Lau , Song Liu , Yonghong Song , KP Singh , Stanislav Fomichev , Quentin Monnet , Mykola Lysenko , Shuah Khan , Nathan Chancellor , Nick Desaulniers , Tom Rix , Joanne Koong , Kui-Feng Lee , Lorenzo Bianconi , Maxim Mikityanskiy , Hao Xiang , Punit Agrawal , Yifei Ma , Xiaoning Ding , bpf , Ho-Ren Chuang , LKML , "open list:KERNEL SELFTEST FRAMEWORK" , clang-built-linux Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham 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 On Fri, Nov 4, 2022 at 7:52 PM Ho-Ren (Jack) Chuang wrote: > > Hello everyone, > > We have prepared patches to address an issue from a previous discussion. > The previous discussion email thread is here: https://lore.kernel.org/all/CAADnVQLBt0snxv4bKwg1WKQ9wDFbaDCtZ03v1-LjOTYtsKPckQ@mail.gmail.com/ Rephrasing what was said earlier. We're not keeping the count of elements in a preallocated hash map and we are not going to add one. The bpf prog needs to do the accounting on its own if it needs this kind of statistics. Keeping the count for non-prealloc is already significant performance overhead. We don't trade performance for stats.