lkml.org 
[lkml]   [2022]   [May]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    From
    Date
    SubjectRe: [PATCH bpf-next v1 2/5] cgroup: bpf: add cgroup_rstat_updated() and cgroup_rstat_flush() kfuncs
    On Fri, May 20, 2022 at 12:24 AM Tejun Heo <tj@kernel.org> wrote:
    >
    > On Fri, May 20, 2022 at 01:21:30AM +0000, Yosry Ahmed wrote:
    > > Add cgroup_rstat_updated() and cgroup_rstat_flush() kfuncs to bpf
    > > tracing programs. bpf programs that make use of rstat can use these
    > > functions to inform rstat when they update stats for a cgroup, and when
    > > they need to flush the stats.
    > >
    > > Signed-off-by: Yosry Ahmed <yosryahmed@google.com>
    >
    > Do patch 1 and 2 need to be separate? Also, can you explain and comment why
    > it's __weak?

    I will squash them in the next version.

    As for the declaration, I took the __weak annotation from Alexei's
    reply to the previous version. I thought it had something to do with
    how fentry progs attach to functions with BTF and all.
    When I try the same code with a static noinline declaration instead,
    fentry attachment fails to find the BTF type ID of bpf_rstat_flush.
    When I try it with just noinline (without __weak), the fentry program
    attaches, but is never invoked. I tried looking at the attach code but
    I couldn't figure out why this happens.

    In retrospect, I should have given this more thought. It would be
    great if Alexei could shed some light on this.

    >
    > Thanks.


    >
    > --
    > tejun

    \
     
     \ /
      Last update: 2022-05-20 11:14    [W:3.852 / U:0.548 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site