yahns Ruby server user/dev discussion
 help / color / mirror / code / Atom feed
* [PATCH] worker: rely on F_SETPIPE_SZ to set mininum value
@ 2019-01-05 21:43 Eric Wong
  0 siblings, 0 replies; only message in thread
From: Eric Wong @ 2019-01-05 21:43 UTC (permalink / raw)
  To: yahns-public

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


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2019-01-05 21:43 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-05 21:43 [PATCH] worker: rely on F_SETPIPE_SZ to set mininum value Eric Wong

Code repositories for project(s) associated with this public inbox

	https://yhbt.net/yahns.git/

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).