diff options
author | Jacek Masiulaniec <jacekm@cvs.openbsd.org> | 2009-05-24 14:22:25 +0000 |
---|---|---|
committer | Jacek Masiulaniec <jacekm@cvs.openbsd.org> | 2009-05-24 14:22:25 +0000 |
commit | 576522606d25ccb68ce580aa9b2d77ae382c9c2d (patch) | |
tree | f88ad8bb62fe63d49e1c80739d0ac06c72e5c269 /usr.sbin/smtpd/runner.c | |
parent | 1d52421f171ee8c2a55ae5923fae4352e1f531fb (diff) |
Instead of keeping stats private to each process, and querying every
process individually whenever stats need to be fetched, keep stats
in MAP_ANON shared memory allocated by parent.
This means control has direct access to stats and can respond very
quickly without troubling any other daemon processes.
ok gilles@
Diffstat (limited to 'usr.sbin/smtpd/runner.c')
-rw-r--r-- | usr.sbin/smtpd/runner.c | 17 |
1 files changed, 3 insertions, 14 deletions
diff --git a/usr.sbin/smtpd/runner.c b/usr.sbin/smtpd/runner.c index 8394f0a4928..c242f44b82b 100644 --- a/usr.sbin/smtpd/runner.c +++ b/usr.sbin/smtpd/runner.c @@ -1,4 +1,4 @@ -/* $OpenBSD: runner.c,v 1.46 2009/05/19 11:24:24 jacekm Exp $ */ +/* $OpenBSD: runner.c,v 1.47 2009/05/24 14:22:23 jacekm Exp $ */ /* * Copyright (c) 2008 Gilles Chehade <gilles@openbsd.org> @@ -82,8 +82,6 @@ struct batch *batch_lookup(struct smtpd *, struct message *); int runner_force_envelope_schedule(char *); int runner_force_message_schedule(char *); -struct s_runner s_runner; - void runner_sig_handler(int sig, short event, void *p) { @@ -194,15 +192,6 @@ runner_dispatch_control(int sig, short event, void *p) case IMSG_MTA_RESUME: env->sc_opts &= ~SMTPD_MTA_PAUSED; break; - case IMSG_STATS: { - struct stats *s = imsg.data; - - IMSG_SIZE_CHECK(s); - - s->u.runner = s_runner; - imsg_compose(ibuf, IMSG_STATS, 0, 0, -1, s, sizeof(*s)); - break; - } case IMSG_RUNNER_SCHEDULE: { struct sched *s = imsg.data; @@ -268,7 +257,7 @@ runner_dispatch_queue(int sig, short event, void *p) IMSG_SIZE_CHECK(m); - s_runner.active--; + env->stats->runner.active--; queue_message_update(m); break; } @@ -936,7 +925,7 @@ batch_record(struct smtpd *env, struct message *messagep) } TAILQ_INSERT_TAIL(&batchp->messages, messagep, entry); - s_runner.active++; + env->stats->runner.active++; return batchp; } |