Skip to content

Commit

Permalink
lib.ptree: fix a bug where bogus PID was logged
Browse files Browse the repository at this point in the history
  • Loading branch information
eugeneia committed Nov 17, 2022
1 parent 68cd6c4 commit 1553134
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
10 changes: 5 additions & 5 deletions src/lib/cpuset.lua
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,11 @@ function CPUSet:list ()
return list
end

function CPUSet:acquire_for_pci_addresses(addrs)
return self:acquire(numa.choose_numa_node_for_pci_addresses(addrs))
function CPUSet:acquire_for_pci_addresses(addrs, worker)
return self:acquire(numa.choose_numa_node_for_pci_addresses(addrs), worker)
end

function CPUSet:acquire(on_node)
function CPUSet:acquire(on_node, worker)
for node, cpus in pairs(self.by_node) do
if on_node == nil or on_node == node then
for cpu, avail in pairs(cpus) do
Expand All @@ -117,11 +117,11 @@ function CPUSet:acquire(on_node)
end
for node, cpus in pairs(self.by_node) do
print(("Warning: All assignable CPUs in use; "..
"leaving data-plane PID %d without assigned CPU."):format(S.getpid()))
"leaving data-plane worker '%s' without assigned CPU."):format(worker))
return
end
print(("Warning: No assignable CPUs declared; "..
"leaving data-plane PID %d without assigned CPU."):format(S.getpid()))
"leaving data-plane worker '%s' without assigned CPU."):format(worker))
end

function CPUSet:release(cpu)
Expand Down
3 changes: 2 additions & 1 deletion src/lib/ptree/ptree.lua
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,7 @@ end

function Manager:start ()
if self.name then engine.claim_name(self.name) end
self:info(("Manager has started (PID %d)"):format(S.getpid()))
self.cpuset:bind_to_numa_node()
require('lib.fibers.file').install_poll_io_handler()
self.sched = fiber.current_scheduler
Expand Down Expand Up @@ -368,7 +369,7 @@ function Manager:acquire_cpu_for_worker(id, app_graph)
end
end
end
return self.cpuset:acquire_for_pci_addresses(pci_addresses)
return self.cpuset:acquire_for_pci_addresses(pci_addresses, id)
end

function Manager:compute_scheduling_for_worker(id, app_graph)
Expand Down

0 comments on commit 1553134

Please sign in to comment.