mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 03:41:45 +00:00
kubelet/eviction: eliminate redundant allocations when handling eventfd
This commit is contained in:
parent
8b2f5be319
commit
3033a64135
@ -107,6 +107,7 @@ func (n *linuxCgroupNotifier) Start(eventCh chan<- struct{}) {
|
||||
klog.Warningf("eviction manager: error adding epoll eventfd: %v", err)
|
||||
return
|
||||
}
|
||||
buf := make([]byte, eventSize)
|
||||
for {
|
||||
select {
|
||||
case <-n.stop:
|
||||
@ -122,7 +123,6 @@ func (n *linuxCgroupNotifier) Start(eventCh chan<- struct{}) {
|
||||
continue
|
||||
}
|
||||
// Consume the event from the eventfd
|
||||
buf := make([]byte, eventSize)
|
||||
_, err = unix.Read(n.eventfd, buf)
|
||||
if err != nil {
|
||||
klog.Warningf("eviction manager: error reading memcg events: %v", err)
|
||||
|
Loading…
Reference in New Issue
Block a user