From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-3.9 required=3.0 tests=ALL_TRUSTED,AWL,BAYES_00 shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 20F4720A1E for ; Thu, 13 Dec 2018 10:10:03 +0000 (UTC) From: Eric Wong To: yahns-public@yhbt.net Subject: [PATCH] yahns/worker: shrink pipe under Linux Date: Thu, 13 Dec 2018 10:10:03 +0000 Message-Id: <20181213101003.22863-1-e@80x24.org> List-Id: We use eventfd whereever possible, but workers still require a pipe to the parent for death detection. --- lib/yahns/worker.rb | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/yahns/worker.rb b/lib/yahns/worker.rb index 9192803..1b65e3d 100644 --- a/lib/yahns/worker.rb +++ b/lib/yahns/worker.rb @@ -9,6 +9,14 @@ class Yahns::Worker # :nodoc: def initialize(nr) @nr = nr @to_io, @wr = Kgio::Pipe.new + + # Seems it's only alpha with a != 4K page size on Linux + begin + # F_SETPIPE_SZ = 1031, PAGE_SIZE = 4096 + @to_io.fcntl(1031, 4096) + rescue Errno::EINVAL + # old kernel + end if RUBY_PLATFORM =~ /\blinux\b/ && RUBY_PLATFORM !~ /alpha/ end def atfork_child