Received: by 2002:a05:7412:6592:b0:d7:7d3a:4fe2 with SMTP id m18csp684190rdg; Thu, 10 Aug 2023 16:34:53 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHjaSRaahxDES9bhnHGvru9YI2WIQEo0QpF+b+bskK/8UABAICOM3KJhP2tDDinokTOE1pL X-Received: by 2002:a17:90b:1884:b0:263:311f:9bcc with SMTP id mn4-20020a17090b188400b00263311f9bccmr73914pjb.35.1691710493258; Thu, 10 Aug 2023 16:34:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691710493; cv=none; d=google.com; s=arc-20160816; b=ca3RizUQQL+TDBQvtdYP9BRcFAJWwT98v0i+Mre6DwDUYv/t4d3rq+ZVjMEq2lrK4Q Oz+gXIoJ6Mx9Dj52elxigA+Nz1SlUMMJbkMsrP77kKKSf0asdf9bomSq+VFIWvvxjSUZ v+sMMMyvITw7SxvdQv49Hld0dsXWjkUqvrB3K/bhiBC4XK0Pu2lyGLsLsHaDdyWnPEzM W0/eIplGPbZLZ6iAinrustWnzX4HALOKDeCvJEPGfyZLEtKzoQYE1s1QQmpmjFIpxgsF e0e+kSHEUZaV4YWGz33cGqnOKdhPXQ1T4HcKtdDfYyQXv3GYAJupkqenFiHMe1S/pmF8 lvpQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:from:subject:message-id:references :mime-version:in-reply-to:date:dkim-signature; bh=xjd4vkpdCNZjHu9BtGW8X6WGb20e5wp6H/aYsqXsyEQ=; fh=0e0F3v/QV/8CM8uynfi5WLs08KhQlogVZaX5jsbazyU=; b=Ux7LCI0rBMZPOgQID20nmIyLfVQbUNdh4snUPlZCEUwR/bg0L0Qd0+UQLKK/O1KZQj dz6p/fzMc6eLteldJILqG79KmVQy0xbpgY8l5lcV4Kqr7++l6LlGAs00nIvrsexuCoEN M/z+tWUNyIwekRcX9DxjHXPSCkstqO8FIfyjQ4dUbIcQoeE4RJDPASyqfrHIb5jnwQC3 Gg44CKO3FLAxWRNreO6s0MS2CYKzG5bsZsBnTn44RbGM/Aud5Ebha6AZUjJQdAfHfp8G p9K8oZclrhsuGmrPoEwGTNuI86O0I+EEWH36KycECC50DdFq0YXz545fYUsPLHtCzexq lU1Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20221208 header.b="vuxVUQS/"; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w15-20020a17090aaf8f00b00269154848b3si2293851pjq.39.2023.08.10.16.34.41; Thu, 10 Aug 2023 16:34:53 -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=@google.com header.s=20221208 header.b="vuxVUQS/"; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230027AbjHJWqW (ORCPT + 99 others); Thu, 10 Aug 2023 18:46:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36922 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229718AbjHJWqV (ORCPT ); Thu, 10 Aug 2023 18:46:21 -0400 Received: from mail-yw1-x1149.google.com (mail-yw1-x1149.google.com [IPv6:2607:f8b0:4864:20::1149]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BAB07272E for ; Thu, 10 Aug 2023 15:46:20 -0700 (PDT) Received: by mail-yw1-x1149.google.com with SMTP id 00721157ae682-5897d05e878so18061217b3.3 for ; Thu, 10 Aug 2023 15:46:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1691707580; x=1692312380; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=xjd4vkpdCNZjHu9BtGW8X6WGb20e5wp6H/aYsqXsyEQ=; b=vuxVUQS/Rd+IBKBm1b7ikeBESL4jyxpR8mKK8cQmpQ+hmVJHXNQjOsb5p6NReTCEhM igBaQaVx6ysaNlCaP8vRvg3YEouXmY7Y+9yOdNEpgrMyk9kUzP5kQzNIgv5xJHtJdlwc kpW63jCiWVKAiyvbhJi6fXJZbABZguB1XML+0jfYC3kd5xeiOvQDwXMnUyyOFwJDmFfA DS7IVEibz0kQAN8dXFuPkmgDa8GIR7fHDANa362Jmqzwt01IxSo8b+kNKWy7wNCj1zNT Po/ySyBdBUGf2JhqrHxzwxht/rjqP0vn2uXGS0PtjW89+U8p9q35C+Oim+S6FawDN2Qq ze0Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691707580; x=1692312380; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=xjd4vkpdCNZjHu9BtGW8X6WGb20e5wp6H/aYsqXsyEQ=; b=a10nh22238Ll6QYNWuCRjQXJhvHy/1ODjN9sMCpmK/vSXGG5e8aPHkkXC019kpqfNA 9u9UgFlqZzw1EkWfdJA15U76SNwFG20IavYs4HzOOM1FRcmlJPuQ5Awv2fADwZ3R3h80 1Xk6ZLPMk9dEBWqCcv4/JFd7HHXXRoozy2XqbYt8ks1ygP40PEYzaoomNvPPwOzHjH+a 6JJcYnafAvlsYkompfOCZYXSzN2HIpVcmLOuR2izUQouZ57hpSho23yMLFvS1XDjKBhE UdBV6GQCYqF+shqb3kpPWoDqU+nsMiB6qawItpLs0H6fD+TBP3naS6YZG0zDLRBOqH2S AZjQ== X-Gm-Message-State: AOJu0YyL7ymtLOBVM2M+T6O0fzAYlpmcy9r/3+gtAAe2HKC3bTiqo4TQ y2gqLb58EETeJBRUQtK/Zfj6cJ4= X-Received: from sdf.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:5935]) (user=sdf job=sendgmr) by 2002:a81:b654:0:b0:586:a6e3:88cd with SMTP id h20-20020a81b654000000b00586a6e388cdmr6521ywk.5.1691707580066; Thu, 10 Aug 2023 15:46:20 -0700 (PDT) Date: Thu, 10 Aug 2023 15:46:18 -0700 In-Reply-To: <20230810220456.521517-1-void@manifault.com> Mime-Version: 1.0 References: <20230810220456.521517-1-void@manifault.com> Message-ID: Subject: Re: [PATCH bpf-next] bpf: Support default .validate() and .update() behavior for struct_ops links From: Stanislav Fomichev To: David Vernet Cc: bpf@vger.kernel.org, ast@kernel.org, daniel@iogearbox.net, andrii@kernel.org, martin.lau@linux.dev, song@kernel.org, yhs@fb.com, john.fastabend@gmail.com, kpsingh@kernel.org, haoluo@google.com, jolsa@kernel.org, linux-kernel@vger.kernel.org, kernel-team@meta.com, tj@kernel.org, clm@meta.com, thinker.li@gmail.com Content-Type: text/plain; charset="utf-8" X-Spam-Status: No, score=-9.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS,USER_IN_DEF_DKIM_WL 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 08/10, David Vernet wrote: > Currently, if a struct_ops map is loaded with BPF_F_LINK, it must also > define the .validate() and .update() callbacks in its corresponding > struct bpf_struct_ops in the kernel. Enabling struct_ops link is useful > in its own right to ensure that the map is unloaded if an application > crashes. For example, with sched_ext, we want to automatically unload > the host-wide scheduler if the application crashes. We would likely > never support updating elements of a sched_ext struct_ops map, so we'd > have to implement these callbacks showing that they _can't_ support > element updates just to benefit from the basic lifetime management of > struct_ops links. > > Let's enable struct_ops maps to work with BPF_F_LINK even if they > haven't defined these callbacks, by assuming that a struct_ops map > element cannot be updated by default. Any reason this is not part of sched_ext series? As you mention, we don't seem to have such users in the three?