Commit Graph

15 Commits

Author SHA1 Message Date
Kubernetes Prow Robot
5d6a793221
Merge pull request #96828 from panjf2000/opt-epoll-eventfd
kubelet/eviction: eliminate redundant allocations when handling eventfd
2022-03-01 13:59:54 -08:00
David Porter
f5140d3145 kubelet: cgroupv2 disable memcg notifications
The current memory notifier on cgroupv2 relies on reading
`cgroup.event_control` which is unsupported on cgroupv2. For now, let's
disable the feature on cgroupv2.
2021-11-10 15:40:59 -08:00
Andy Pan
3033a64135 kubelet/eviction: eliminate redundant allocations when handling eventfd 2021-11-04 15:41:46 +08:00
JunYang
af0b4c9031 Structured Logging migration: modify eviction part logs of kubelet.
Signed-off-by: JunYang <yang.jun22@zte.com.cn>
2021-02-21 08:36:14 +08:00
Davanum Srinivas
442a69c3bd
switch over k/k to use klog v2
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2020-05-16 07:54:27 -04:00
yuxiaobo
81e9f21f83 Correct spelling mistakes
Signed-off-by: yuxiaobo <yuxiaobogo@163.com>
2019-11-06 20:25:19 +08:00
Brian Goff
45b0261290 Use EPOLL/O_CLOEXEC in evicition notifier
This prevents fd's from leaking to subprocesses.
2019-07-09 10:03:31 -07:00
Davanum Srinivas
954996e231
Move from glog to klog
- Move from the old github.com/golang/glog to k8s.io/klog
- klog as explicit InitFlags() so we add them as necessary
- we update the other repositories that we vendor that made a similar
change from glog to klog
  * github.com/kubernetes/repo-infra
  * k8s.io/gengo/
  * k8s.io/kube-openapi/
  * github.com/google/cadvisor
- Entirely remove all references to glog
- Fix some tests by explicit InitFlags in their init() methods

Change-Id: I92db545ff36fcec83afe98f550c9e630098b3135
2018-11-10 07:50:31 -05:00
David Ashpole
93b6d026d9 fix memcg fd leak 2018-06-11 11:37:50 -07:00
David Ashpole
39d9fa60e8 refresh eviction interval periodically 2018-03-06 15:14:05 -08:00
Tobias Klauser
5acfb16023 Use Eventfd() from x/sys/unix
Use unix.Eventfd() instead of C.eventfd and also use the correct
corresponding unix.EFD_CLOEXEC flag. This allows to get rid of cgo.
2017-07-21 12:14:50 +02:00
Tobias Klauser
4a69005fa1 switch from package syscall to x/sys/unix
The syscall package is locked down and the comment in [1] advises to
switch code to use the corresponding package from golang.org/x/sys. Do
so and replace usage of package syscall with package
golang.org/x/sys/unix where applicable.

  [1] https://github.com/golang/go/blob/master/src/syscall/syscall.go#L21-L24

This will also allow to get updates and fixes for syscall wrappers
without having to use a new go version.

Errno, Signal and SysProcAttr aren't changed as they haven't been
implemented in /x/sys/. Stat_t from syscall is used if standard library
packages (e.g. os) require it. syscall.SIGTERM is used for
cross-platform files.
2017-07-21 12:14:42 +02:00
yaxinlx
c280b7cab7 There is a rule in using go channel: never close a channel in the
receiver side.

fix https://github.com/kubernetes/kubernetes/issues/45215

delete the channel close line

change the event channel element type to struct{}

go fmt

eventCh channel is not essential to be buffered
2017-05-11 10:19:28 +08:00
Andy Goldstein
89ea5ac9c1 Fix threshold notifier build tags
Fix threshold notifier build tags so the linux version is only built if cgo is
enabled, and the unsupported version is built if it's either not linux or not
cgo.
2016-12-12 11:56:07 -05:00
Derek Carr
1ec69f658c Fix cross-build for memcg notification 2016-11-23 12:36:04 -05:00