1
0
mirror of https://github.com/systemd/systemd.git synced 2024-10-28 20:25:38 +03:00

logind: process session/inhibitor fds at higher priority

Let's make sure we process session and inhibitor pipe fds (that signal
sessions/inhibtors going away) at a higher priority
than new bus calls that might create new sessions or inhibitors. This helps
ensuring that the number of open sessions stays minimal.
This commit is contained in:
Lennart Poettering 2016-05-04 19:01:56 +02:00
parent 89f193fac8
commit e11544a830
3 changed files with 5 additions and 3 deletions

View File

@ -317,7 +317,7 @@ int inhibitor_create_fifo(Inhibitor *i) {
if (r < 0)
return r;
r = sd_event_source_set_priority(i->event_source, SD_EVENT_PRIORITY_IDLE);
r = sd_event_source_set_priority(i->event_source, SD_EVENT_PRIORITY_IDLE-10);
if (r < 0)
return r;
}

View File

@ -897,7 +897,9 @@ int session_create_fifo(Session *s) {
if (r < 0)
return r;
r = sd_event_source_set_priority(s->fifo_event_source, SD_EVENT_PRIORITY_IDLE);
/* Let's make sure we noticed dead sessions before we process new bus requests (which might create new
* sessions). */
r = sd_event_source_set_priority(s->fifo_event_source, SD_EVENT_PRIORITY_NORMAL-10);
if (r < 0)
return r;
}

View File

@ -687,7 +687,7 @@ static int manager_connect_bus(Manager *m) {
if (r < 0)
return log_error_errno(r, "Failed to register name: %m");
r = sd_bus_attach_event(m->bus, m->event, 0);
r = sd_bus_attach_event(m->bus, m->event, SD_EVENT_PRIORITY_NORMAL);
if (r < 0)
return log_error_errno(r, "Failed to attach bus to event loop: %m");