From owner-svn-src-head@freebsd.org Thu Mar 5 13:15:17 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E71C2269602; Thu, 5 Mar 2020 13:15:17 +0000 (UTC) (envelope-from ypankov@fastmail.com) Received: from wnew2-smtp.messagingengine.com (wnew2-smtp.messagingengine.com [64.147.123.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 48YB7R2jyxz4dXx; Thu, 5 Mar 2020 13:15:15 +0000 (UTC) (envelope-from ypankov@fastmail.com) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailnew.west.internal (Postfix) with ESMTP id 73F307BD; Thu, 5 Mar 2020 08:15:13 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Thu, 05 Mar 2020 08:15:13 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastmail.com; h= subject:to:references:from:message-id:date:mime-version :in-reply-to:content-type:content-transfer-encoding; s=fm2; bh=G 3RLCM3ca/b9Gzw2kTccvTnHdLVIKCm7YZZV/Ezbw0I=; b=xM6fYNga/pGicliWQ 9qMABz0QcmKSrUqH7JuKdC/lIwafGHO8ftXZ+HeKzczN9WP3meK80yzQjJA7xI6A pRunlo3w1CtiRwmLNQk6J7gq6eCagfiH8TQBMwcDFAZVqJZKb5Cy58fR38mbYeS7 QaFtoQWWACfcbLowgRxAjgjQbH3cljq9L0BB64WtqqHjKMQBcq6R5SqTymmOx5Gt 42pnfZYq/dAw2rshP+YYb+OZgVrtLkDFLecoIWYNo8VR9j0LPZQvfYT8zkI0JK+S QAIW+At/4JasUX+bwKo4rNKtuEHBEw5OIeUSaDtOqLY/LhhNc58038VzMlJV3FJQ YQ65g== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm2; bh=G3RLCM3ca/b9Gzw2kTccvTnHdLVIKCm7YZZV/Ezbw 0I=; b=sOrp2tBus6DIT7fbiyQ9Cg4jDoNqa6VnKK8tzn2hu+H1AP2KbPeD3Ahc3 q3jOfuC8VANTi+DeK+ALCStuIYaVdkmf8xMZUx5+YfeXXNJwRdb4Kz5TiJOIyAKZ vYMt4tzAEKy2NvWpTDSK8KJdET6uj5Ji8NZ0BP9yr2F6y0+WTZnsGu5YcjJOVne/ tpMbQBYc3ojZNwAKHxejRGqI4JF5czbEI1zRsky+GtyrW1EUnaLjpqEVVADqL7dH d0c4zlBNOZc3OtWZ0eSrwUCL+JtuC+DF4J3/TgYWSO1OzaRyCZ3YFFIz/H07cm4p wpvosP5PwSdVT9hRrk061jDoMlwfw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedugedruddutddghedvucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepuffvfhfhkffffgggjggtgfesthejredttdefjeenucfhrhhomhepjghurhhi ucfrrghnkhhovhcuoeihphgrnhhkohhvsehfrghsthhmrghilhdrtghomheqnecuffhomh grihhnpehfrhgvvggsshgurdhorhhgpdhlihhnuhigrdhmrghpnecukfhppeehrddufeel rdduledtrddukeeinecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilh hfrhhomhephihprghnkhhovhesfhgrshhtmhgrihhlrdgtohhm X-ME-Proxy: Received: from mercury.lan (unknown [5.139.190.186]) by mail.messagingengine.com (Postfix) with ESMTPA id 120DA30612AF; Thu, 5 Mar 2020 08:15:11 -0500 (EST) Subject: Re: svn commit: r358483 - head/sys/compat/linux To: Tijl Coosemans , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <202003011312.021DC4vh022404@repo.freebsd.org> From: Yuri Pankov Message-ID: Date: Thu, 5 Mar 2020 16:15:10 +0300 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:68.0) Gecko/20100101 Thunderbird/68.5.0 MIME-Version: 1.0 In-Reply-To: <202003011312.021DC4vh022404@repo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 48YB7R2jyxz4dXx X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=fastmail.com header.s=fm2 header.b=xM6fYNga; dkim=pass header.d=messagingengine.com header.s=fm2 header.b=sOrp2tBu; dmarc=pass (policy=none) header.from=fastmail.com; spf=pass (mx1.freebsd.org: domain of ypankov@fastmail.com designates 64.147.123.27 as permitted sender) smtp.mailfrom=ypankov@fastmail.com X-Spamd-Result: default: False [-3.09 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_DKIM_ALLOW(-0.20)[fastmail.com:s=fm2,messagingengine.com:s=fm2]; NEURAL_HAM_MEDIUM(-0.99)[-0.991,0]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+ip4:64.147.123.27]; FREEMAIL_FROM(0.00)[fastmail.com]; MIME_GOOD(-0.10)[text/plain]; MIME_TRACE(0.00)[0:+]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; RCVD_COUNT_THREE(0.00)[4]; RCVD_TLS_LAST(0.00)[]; DKIM_TRACE(0.00)[fastmail.com:+,messagingengine.com:+]; DMARC_POLICY_ALLOW(-0.50)[fastmail.com,none]; IP_SCORE(0.00)[ip: (-9.71), ipnet: 64.147.123.0/24(-4.92), asn: 11403(-2.69), country: US(-0.05)]; IP_SCORE_FREEMAIL(0.00)[]; RCVD_IN_DNSWL_LOW(-0.10)[27.123.147.64.list.dnswl.org : 127.0.5.1]; FROM_EQ_ENVFROM(0.00)[]; FREEMAIL_ENVFROM(0.00)[fastmail.com]; ASN(0.00)[asn:11403, ipnet:64.147.123.0/24, country:US]; MID_RHS_MATCH_FROM(0.00)[]; RECEIVED_SPAMHAUS_PBL(0.00)[186.190.139.5.khpj7ygk5idzvmvt5x4ziurxhy.zen.dq.spamhaus.net : 127.0.0.11] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Mar 2020 13:15:18 -0000 Tijl Coosemans wrote: > Author: tijl > Date: Sun Mar 1 13:12:04 2020 > New Revision: 358483 > URL: https://svnweb.freebsd.org/changeset/base/358483 > > Log: > linuxulator: Map scheduler priorities to Linux priorities. > > On Linux the valid range of priorities for the SCHED_FIFO and SCHED_RR > scheduling policies is [1,99]. For SCHED_OTHER the single valid priority is > 0. On FreeBSD it is [0,31] for all policies. Programs are supposed to > query the valid range using sched_get_priority_(min|max), but of course some > programs assume the Linux values are valid. > > This commit adds a tunable compat.linux.map_sched_prio. When enabled > sched_get_priority_(min|max) return the Linux values and sched_setscheduler > and sched_(get|set)param translate between FreeBSD and Linux values. > > Because there are more Linux levels than FreeBSD levels, multiple Linux > levels map to a single FreeBSD level, which means pre-emption might not > happen as it does on Linux, so the tunable allows to disable this behaviour. > It is enabled by default because I think it is unlikely that anyone runs > real-time software under Linux emulation on FreeBSD that critically relies > on correct pre-emption. > > This fixes FMOD, a commercial sound library used by several games. > > PR: 240043 > Tested by: Alex S > Reviewed by: dchagin > MFC after: 2 weeks > Differential Revision: https://reviews.freebsd.org/D23790 > > Modified: > head/sys/compat/linux/linux_misc.c > head/sys/compat/linux/linux_misc.h > > Modified: head/sys/compat/linux/linux_misc.c > ============================================================================== > --- head/sys/compat/linux/linux_misc.c Sun Mar 1 12:34:27 2020 (r358482) > +++ head/sys/compat/linux/linux_misc.c Sun Mar 1 13:12:04 2020 (r358483) > @@ -144,6 +144,11 @@ struct l_pselect6arg { > l_size_t ss_len; > }; > > +static bool map_sched_prio = true; > +SYSCTL_BOOL(_compat_linux, OID_AUTO, map_sched_prio, CTLFLAG_RDTUN, > + &map_sched_prio, 0, "Map scheduler priorities to Linux priorities " > + "(not POSIX compliant)"); I'm seeing the following in the log: sysctl_warn_reuse: can't re-use a leaf (compat.linux.map_sched_prio)! Should this be done for both linux and linux32 (when one exists) or made to install one time only?