mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-22 19:31:44 +00:00
Merge pull request #96828 from panjf2000/opt-epoll-eventfd
kubelet/eviction: eliminate redundant allocations when handling eventfd
This commit is contained in:
commit
5d6a793221
@ -116,6 +116,7 @@ func (n *linuxCgroupNotifier) Start(eventCh chan<- struct{}) {
|
||||
klog.InfoS("Eviction manager: error adding epoll eventfd", "err", err)
|
||||
return
|
||||
}
|
||||
buf := make([]byte, eventSize)
|
||||
for {
|
||||
select {
|
||||
case <-n.stop:
|
||||
@ -131,7 +132,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.InfoS("Eviction manager: error reading memcg events", "err", err)
|
||||
|
Loading…
Reference in New Issue
Block a user