diff options
author | Andrei Vagin <avagin@google.com> | 2019-03-25 11:40:49 -0700 |
---|---|---|
committer | Shentubot <shentubot@google.com> | 2019-03-25 11:41:50 -0700 |
commit | ddc05e3053e387be9c81aa98c621b6fc92b01000 (patch) | |
tree | 405eb7901958aec9a73d32eac1f58c2536e4f9cc /pkg/sentry/kernel/epoll/BUILD | |
parent | b81bfd6013ce871524e493272ac36b134f7fbbdf (diff) |
epoll: use ilist:generic_list instead of ilist:ilist
ilist:generic_list works faster than ilist:ilist.
Here is a beanchmark test to measure performance of epoll_wait, when readyList
isn't empty. It shows about 30% better performance with these changes.
Benchmark Time(ns) CPU(ns) Iterations
Before:
BM_EpollAllEvents 46725 46899 14286
After:
BM_EpollAllEvents 33167 33300 18919
PiperOrigin-RevId: 240185278
Change-Id: I3e33f9b214db13ab840b91613400525de5b58d18
Diffstat (limited to 'pkg/sentry/kernel/epoll/BUILD')
-rw-r--r-- | pkg/sentry/kernel/epoll/BUILD | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/pkg/sentry/kernel/epoll/BUILD b/pkg/sentry/kernel/epoll/BUILD index 1567d5050..3ac59e13e 100644 --- a/pkg/sentry/kernel/epoll/BUILD +++ b/pkg/sentry/kernel/epoll/BUILD @@ -1,17 +1,30 @@ package(licenses = ["notice"]) +load("//tools/go_generics:defs.bzl", "go_template_instance") load("//tools/go_stateify:defs.bzl", "go_library", "go_test") +go_template_instance( + name = "epoll_list", + out = "epoll_list.go", + package = "epoll", + prefix = "pollEntry", + template = "//pkg/ilist:generic_list", + types = { + "Element": "*pollEntry", + "Linker": "*pollEntry", + }, +) + go_library( name = "epoll", srcs = [ "epoll.go", + "epoll_list.go", "epoll_state.go", ], importpath = "gvisor.googlesource.com/gvisor/pkg/sentry/kernel/epoll", visibility = ["//pkg/sentry:internal"], deps = [ - "//pkg/ilist", "//pkg/refs", "//pkg/sentry/context", "//pkg/sentry/fs", |