[SCM] libmessage-passing-perl Debian packaging branch, master, updated. debian/0.111-3-14-g44f6e88

Tomas Doran bobtfish at bobtfish.net
Mon May 6 11:56:54 UTC 2013


The following commit has been merged in the master branch:
commit 609d49d91caaa7bd73e69855f7b686210e893810
Author: Tomas Doran <bobtfish at bobtfish.net>
Date:   Sun Apr 29 23:45:33 2012 +0100

    Try setting IO priorities

diff --git a/lib/Log/Stash.pm b/lib/Log/Stash.pm
index 3043d6c..e7b211e 100644
--- a/lib/Log/Stash.pm
+++ b/lib/Log/Stash.pm
@@ -94,9 +94,29 @@ foreach my $name (qw/ user pid_file /) {
     );
 }
 
+has io_priority => (
+    isa => enum([qw[ none be rt idle ]]),
+    is => 'ro',
+    predicate => "_has_io_priority",
+);
+
+sub set_io_priority_if_needed {
+    my $self = shiftl
+    return unless $self->_has_io_priority;
+    require Linux::IO_Prio;
+    my $sym = do {
+        no strict 'refs';
+        &{"Linux::IO_Prio::IOPRIO_CLASS_" . uc($self->io_priority)}();
+    };
+    Linux::IO_Prio::ioprio_set(Linux::IO_Prio::IOPRIO_WHO_PROCESS, $$,
+        Linux::IO_Prio::IOPRIO_PRIO_VALUE($sym, 0)
+    );
+}
+
 sub start {
     my $class = shift;
     my $instance = $class->new_with_options(@_);
+    $instance->set_io_priority_if_needed;
     $instance->change_uid_if_needed;
     $instance->deamonize_if_needed;
     run_log_server $instance->build_chain;

-- 
libmessage-passing-perl Debian packaging



More information about the Pkg-perl-cvs-commits mailing list