From owner-svn-src-all@freebsd.org Mon Oct 15 19:19:26 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7EFA210C64E8; Mon, 15 Oct 2018 19:19:26 +0000 (UTC) (envelope-from glebius@freebsd.org) Received: from cell.glebi.us (glebi.us [198.45.61.253]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebi.us", Issuer "cell.glebi.us" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 020B5815D8; Mon, 15 Oct 2018 19:19:25 +0000 (UTC) (envelope-from glebius@freebsd.org) Received: from cell.glebi.us (localhost [127.0.0.1]) by cell.glebi.us (8.15.2/8.15.2) with ESMTPS id w9FJJOwI093783 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Mon, 15 Oct 2018 12:19:24 -0700 (PDT) (envelope-from glebius@freebsd.org) Received: (from glebius@localhost) by cell.glebi.us (8.15.2/8.15.2/Submit) id w9FJJOTm093782; Mon, 15 Oct 2018 12:19:24 -0700 (PDT) (envelope-from glebius@freebsd.org) X-Authentication-Warning: cell.glebi.us: glebius set sender to glebius@freebsd.org using -f Date: Mon, 15 Oct 2018 12:19:24 -0700 From: Gleb Smirnoff To: Mateusz Guzik Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r339349 - in head/sys/amd64: amd64 include Message-ID: <20181015191924.GF1044@FreeBSD.org> References: <201810132118.w9DLIW3R017391@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201810132118.w9DLIW3R017391@repo.freebsd.org> User-Agent: Mutt/1.10.0 (2018-05-17) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Oct 2018 19:19:26 -0000 Mateusz, On Sat, Oct 13, 2018 at 09:18:32PM +0000, Mateusz Guzik wrote: M> Return is almost always 0. The change replaces 3 branches with 1 in the common M> case. This isn't true. For a webserver working with blocking sockets returning EAGAIN for a very large number of syscalls is normal. I just dtraced on a random Netflix server and in our case we get 12% of syscalls with non zero error. But our clients are special, they request data in small chunks. I believe a regular web server that serves mostly open ended requests will have a greater ratio of non-zero returns, up to 50%. Here is script: #!/usr/sbin/dtrace -s fbt::cpu_set_syscall_retval:entry { @[args[1]] = count(); } I would be interested if anybody reports results on a busy web server running nginx. So, I doubt that using __predict_true() is an optimisation here. -- Gleb Smirnoff