yahns Ruby server user/dev discussion
 help / color / mirror / code / Atom feed
From: Eric Wong <e@80x24.org>
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	[thread overview]
Message-ID: <20190105214332.2933-1-e@80x24.org> (raw)

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
       # 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/
   def atfork_child

                 reply	other threads:[~2019-01-05 21:43 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

  List information: https://yhbt.net/yahns/README

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190105214332.2933-1-e@80x24.org \
    --to=e@80x24.org \
    --cc=yahns-public@yhbt.net \


* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).