Skip to content

Commit c85fec0

Browse files
committed
Cleanup
1 parent 7e4d1d6 commit c85fec0

File tree

2 files changed

+3
-8
lines changed

2 files changed

+3
-8
lines changed

packages/orchestrator/internal/sandbox/uffd/uffd.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -145,8 +145,6 @@ func (u *Uffd) handle(sandboxId string) error {
145145
}
146146
}()
147147

148-
fmt.Fprintf(os.Stderr, "uffd: serving: %d\n", len(m))
149-
150148
u.readyCh <- struct{}{}
151149

152150
err = uffd.Serve(
@@ -156,7 +154,6 @@ func (u *Uffd) handle(sandboxId string) error {
156154
zap.L().With(logger.WithSandboxID(sandboxId)),
157155
)
158156
if err != nil {
159-
fmt.Fprintf(os.Stderr, "serve error %v", err)
160157
return fmt.Errorf("failed handling uffd: %w", err)
161158
}
162159

packages/orchestrator/internal/sandbox/uffd/userfaultfd/serve.go

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ E -- write (WP|WRITE flag) --> F(remove WP) --> C
1414
import (
1515
"errors"
1616
"fmt"
17-
"os"
1817
"syscall"
1918
"unsafe"
2019

@@ -33,15 +32,14 @@ func (u *userfaultfd) Serve(
3332
fdExit *fdexit.FdExit,
3433
logger *zap.Logger,
3534
) error {
36-
defer fmt.Fprintf(os.Stderr, "exiting serve >>>>>>>>>>>>")
3735
pollFds := []unix.PollFd{
3836
{Fd: int32(u.fd), Events: unix.POLLIN},
3937
{Fd: int32(fdExit.Reader()), Events: unix.POLLIN},
4038
}
4139

4240
var eg errgroup.Group
4341

44-
missingChunksBeingHandled := map[int64]struct{}{}
42+
handledPages := map[int64]struct{}{}
4543

4644
outerLoop:
4745
for {
@@ -143,11 +141,11 @@ outerLoop:
143141
// This prevents serving missing pages multiple times.
144142
// For normal sized pages with swap on, the behavior seems not to be properly described in docs
145143
// and it's not clear if the missing can be legitimately triggered multiple times.
146-
if _, ok := missingChunksBeingHandled[offset]; ok {
144+
if _, ok := handledPages[offset]; ok {
147145
continue
148146
}
149147

150-
missingChunksBeingHandled[offset] = struct{}{}
148+
handledPages[offset] = struct{}{}
151149

152150
eg.Go(func() error {
153151
defer func() {

0 commit comments

Comments
 (0)