GithubHelp home page GithubHelp logo

Long start time on bpf-next (6.4-rc3) about pwru HOT 5 CLOSED

brb avatar brb commented on May 26, 2024
Long start time on bpf-next (6.4-rc3)

from pwru.

Comments (5)

lmb avatar lmb commented on May 26, 2024
(pprof) top -cum
Showing nodes accounting for 2.86s, 1.68% of 169.87s total
Dropped 361 nodes (cum <= 0.85s)
Showing top 10 nodes out of 104
      flat  flat%   sum%        cum   cum%
         0     0%     0%     98.79s 58.16%  main.main
         0     0%     0%     98.79s 58.16%  runtime.main
     2.86s  1.68%  1.68%     88.28s 51.97%  github.com/cilium/ebpf/btf.copier.copy
         0     0%  1.68%     88.24s 51.95%  github.com/cilium/ebpf.(*CollectionSpec).LoadAndAssign
         0     0%  1.68%     88.24s 51.95%  github.com/cilium/ebpf.(*CollectionSpec).LoadAndAssign.func1
         0     0%  1.68%     88.24s 51.95%  github.com/cilium/ebpf.(*collectionLoader).loadProgram
         0     0%  1.68%     88.24s 51.95%  github.com/cilium/ebpf.assignValues
         0     0%  1.68%     88.23s 51.94%  github.com/cilium/ebpf.newProgramWithOptions
         0     0%  1.68%     88.20s 51.92%  github.com/cilium/ebpf.applyRelocations
         0     0%  1.68%     88.20s 51.92%  github.com/cilium/ebpf/btf.CORERelocate

Ouch! 😅 Definitely a cilium/ebpf issue. Mind moving the issue?

NVM, I'll create a new one.

from pwru.

Asphaltt avatar Asphaltt commented on May 26, 2024

I also confirm that github.com/cilium/ebpf/btf.Copy() consumes most of loading time.

It consumes 10m1.519248586s of 10m21.610184033s bpfSpec.LoadAndAssign() running time.

My running env is 6.2 kernel on Ubuntu 23.04 VM built from server ISO (#201 env info).

pwru.run.log

from pwru.

brb avatar brb commented on May 26, 2024

Whoa, nice finding!

As a temp solution, we can disable the field access via CO-RE. The field positions are very unlikely to change between different kernel versions.

from pwru.

Asphaltt avatar Asphaltt commented on May 26, 2024

Furthermore, I add a fmt log in github.com/cilium/ebpf/btf.Copy():

func Copy(typ Type, transform Transformer) Type {
	defer functrace.Trace()()
	fmt.Printf("Copy type: %s, %+v\n", typ.TypeName(), typ)
	copies := make(copier)
	copies.copy(&typ, transform)
	return typ
}

Here is the log file: pwru.run.log.

Then, dump the copying structs info from vmlinux: btf.vmlinux.structs.txt by bpftool btf dump file /sys/kernel/btf/vmlinux format raw | grep -E "'(iphdr|ipv6hdr|net|net_device|pt_regs|sk_buff|sock|tcphdr|udphdr)'" > btf.vmlinux.structs.txt.

Hopefully, it can help to solve this issue.

from pwru.

brb avatar brb commented on May 26, 2024

Fixed by #220.

from pwru.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.