From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.3 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 27D8BC433ED for ; Tue, 27 Apr 2021 11:52:08 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id EC51E613DE for ; Tue, 27 Apr 2021 11:52:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235446AbhD0Lwt (ORCPT ); Tue, 27 Apr 2021 07:52:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48114 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235410AbhD0Lws (ORCPT ); Tue, 27 Apr 2021 07:52:48 -0400 Received: from mail-qk1-x743.google.com (mail-qk1-x743.google.com [IPv6:2607:f8b0:4864:20::743]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DB734C061574 for ; Tue, 27 Apr 2021 04:52:04 -0700 (PDT) Received: by mail-qk1-x743.google.com with SMTP id 8so25852393qkv.8 for ; Tue, 27 Apr 2021 04:52:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mojatatu-com.20150623.gappssmtp.com; s=20150623; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=X2BjKbKMJR4ItsquQUqnKgfqPfYEx2HUH9Z/myAc97s=; b=xkGYMa3BL4EeMvVsjlHhv0PllBhdriJINPY3S9GAvDLtgzaozbq1F4UemPzr5emzUh ThXk2bM8Wd+/v6pDHYzRdLGSmH74/IYFLrI9VbEBlA2qMv35w7TsO/KkBWXopLPeexld 6K8T696BNBOsrUUStxO5EAaMIW6G4NkBtJV74MxDf3u+NTVcvfYO+Dp9aKiTf7zheqNE hbHdf1wQHiG6ixF87Xvn9+VjEjMyNiq5fcQFw5vLXGknON9xq51qaJ/o9SqnGJs2PPUK T7T0mZWJ3V6fqa8gyMHqgUEXVD3P0BDz5PMQ9iln+1ty8+itIu0nzIUgl3qNYfdWI3m7 fBjw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=X2BjKbKMJR4ItsquQUqnKgfqPfYEx2HUH9Z/myAc97s=; b=MFHiDccRRY0M2bycp/hdBOL5ScSKCPQG3JpOVZShzIyQYc1PCs1MbQsbhKMXzG5voZ nY2+f6rD+FOI6ubK5xNhJB9jPCv2QNYVaOZrCOXXlLbLpAEL4mek2DcKqf9pbWb5AU8A XIgGlp40ONQRV0i3bhXCJy+6v79+9b1CVM2fh+5yQLVb7/Yr+wyVi2n/+Aa79BPzusUg iagyb6XBkH1x5YltjMGxxcOJaNZjw5ge7SHP+FKjx+muNpN1ZTfFhcepmTwrHdGH71Kj a0i6wR6bj5aVk3URNdhSJzY9SmgdT6D0P16GfApOVHCK3xPGVO5+8OsbzSSF2ztuQdBz VEDg== X-Gm-Message-State: AOAM530jKuHiHmLAATwGH5VEbtFbAwFhhvlKI6nVNHgb7xd7UF+qslXr H13AfJouhKSGrL8yaDntN+vooQ== X-Google-Smtp-Source: ABdhPJzwOLNmn5EACDdBrjCcZQlfLnGlMB0aKEVG6ot4PM8WBuafOUaLIGtksb45XYrDFagj9K5K8A== X-Received: by 2002:a37:b987:: with SMTP id j129mr22130887qkf.174.1619524324141; Tue, 27 Apr 2021 04:52:04 -0700 (PDT) Received: from [192.168.1.79] (bras-base-kgtnon0881w-grc-68-142-114-51-86.dsl.bell.ca. [142.114.51.86]) by smtp.googlemail.com with ESMTPSA id d6sm13718272qtn.52.2021.04.27.04.52.02 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 27 Apr 2021 04:52:03 -0700 (PDT) Subject: Re: [RFC Patch bpf-next] bpf: introduce bpf timer To: Alexei Starovoitov , Cong Wang Cc: Linux Kernel Network Developers , bpf , Xiongchun Duan , Dongdong Wang , Muchun Song , Cong Wang , Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Martin KaFai Lau , Song Liu , Yonghong Song , Pedro Tammela References: <20210402192823.bqwgipmky3xsucs5@ast-mbp> <20210402234500.by3wigegeluy5w7j@ast-mbp> <20210412230151.763nqvaadrrg77kd@ast-mbp.dhcp.thefacebook.com> <20210427020159.hhgyfkjhzjk3lxgs@ast-mbp.dhcp.thefacebook.com> From: Jamal Hadi Salim Message-ID: <34af20ce-b749-7e37-2658-9aca6304614a@mojatatu.com> Date: Tue, 27 Apr 2021 07:52:02 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.9.0 MIME-Version: 1.0 In-Reply-To: <20210427020159.hhgyfkjhzjk3lxgs@ast-mbp.dhcp.thefacebook.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: bpf@vger.kernel.org On 2021-04-26 10:01 p.m., Alexei Starovoitov wrote: [..] >> >> They are already in CC from the very beginning. And our use case is >> public, it is Cilium conntrack: >> https://github.com/cilium/cilium/blob/master/bpf/lib/conntrack.h >> >> The entries of the code are: >> https://github.com/cilium/cilium/blob/master/bpf/bpf_lxc.c >> >> The maps for conntrack are: >> https://github.com/cilium/cilium/blob/master/bpf/lib/conntrack_map.h > > If that's the only goal then kernel timers are not needed. > cilium conntrack works well as-is. IIRC, the original patch from Cong was driven by need to scale said conntracking in presence of large number of flows. The arguement i heard from Cong is LRU doesnt scale in such a setup. I would argue timers generally are useful for a variety of house keeping purposes and they are currently missing from ebpf. This despite Cong's use case. Currently things in the datapath are triggered by either packets showing up or from a control plane perspective by user space polling. Our use case (honestly, not that it matters to justify why we need timers) is we want to periodically, if some condition is met in the kernel, to send unsolicited housekeeping events to user space. Hope that helps. cheers, jamal