UPF Process Leads to 100% CPU Core Utilization

Hello all,

I found that a UPF process leads to 100% cpu core utilization and
this is caused by reading non-blocking message queue in a infinity loop (eventComsumere()
on free5gc/src/upf/src/upf.c).

static void eventConsumer() {
    Status status;
    Event event;

    while (1) {
        UTLT_Info("DBG:dbg1"); 
        status = EventRecv(Self()->eventQ, &event);   # return quickly anytime.
        if (status != STATUS_OK) {
            if (status == STATUS_EAGAIN) {
                continue;
            } else {
                UTLT_Assert(0, break, "Event receive fail");
            }
        }

        UpfDispatcher(&event);
    }
}

This is because the eventQ is a non-blocking mode queue.
After changing the queue mode to blocking, cpu utilization of the UPF process was decreased significantly.

Could you let me know why the event queue is in blocking mode?

What I would like to know is if I can change the queue to blocking mode w/o any bad impact.

Hi,

Thanks for the report. We’ll change the message queue to blocking in the next stage.