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=-4.0 required=3.0 tests=ALL_TRUSTED,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 6DCAC211B4 for ; Sat, 5 Jan 2019 21:43:32 +0000 (UTC) From: Eric Wong To: yahns-public@yhbt.net Subject: [PATCH] worker: rely on F_SETPIPE_SZ to set mininum value Date: Sat, 5 Jan 2019 21:43:32 +0000 Message-Id: <20190105214332.2933-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: Old kernels running on alpha may EINVAL, here; but modern kernels will automatically increase the passed value to the minimum size supported by the kernel. This only affects alpha, since all other arches use 4K page size on Linux. --- lib/yahns/worker.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/yahns/worker.rb b/lib/yahns/worker.rb index 1b65e3d..0355629 100644 --- a/lib/yahns/worker.rb +++ b/lib/yahns/worker.rb @@ -10,13 +10,13 @@ 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 + # (fcntl will handle minimum size on platforms where PAGE_SIZE > 4096) @to_io.fcntl(1031, 4096) rescue Errno::EINVAL # old kernel - end if RUBY_PLATFORM =~ /\blinux\b/ && RUBY_PLATFORM !~ /alpha/ + end if RUBY_PLATFORM =~ /\blinux\b/ end def atfork_child -- EW