From nobody Fri Dec 29 12:08:56 2023 X-Original-To: dev-commits-doc-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4T1kgX41PYz55yml for ; Fri, 29 Dec 2023 12:08:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4T1kgX3Yy0z3RNd; Fri, 29 Dec 2023 12:08:56 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703851736; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jujQCcu9rlWL/cBA3dlky+gc+pNoSKXOa7XvPztT0ic=; b=P7ZXWa+3HhMciXIrn0kBO1bj5AIM6KfTqm50aCebTsrr9w2YRYS/3n3nxc2G2VXLI99c/s F76jRcyutaolOgtic776laNr8jGk0ygwms/nq+tlSABINE/8EGCQxu3hAGRA6nfKjtj24p bppr3vFFYBSdHKdLQolASM2WlfF3ViA8n5/OWCVXMYKYJp2XeNqghYrZgktnMFsEfBv1NH gppsK2pEglXoGfQM7Lg/DMqP5f39sNQtx8QqWsxPqCLj0jf8oUF/EWqfPVHCRhEoZxMAQa 2rnRVLyChkOcRbg8jYL5e4+kB7Clfjffmy1sGP0+yfK3KniTL1wPZc3dBzIXbw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1703851736; a=rsa-sha256; cv=none; b=xNIyc3HEfOz/o3KfzP1ZDYSHBq3TOudxyfmjbxmjqdLTui4qxoktv1VIRG83FINgnwLIFB R80UhuDOF5t0HflGx0jMFwNI3pyNyo5e+ywDw5jBso0pfWtG4Nzbc3vyPwxDvjsOtB4NXE 8mIBZqY0j9WjrihTqiAfTTzhh7UgeGyjtY/J6+y0NmSFiTVfh96WvjJB4w/uCNoJQIIieW kqf9GP2tOnVmaLxfE7T2O0/ElSIwODI4K33uLoJj+uuR4k3C4aSV6/Dioy4MsDGlVbz4to 2tIGh2X8Z2SBSr1uVeKpkrB7NUQYvekDeVxhbLGA4CvkXOEkEU8vuvnAfiI7Vg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703851736; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=jujQCcu9rlWL/cBA3dlky+gc+pNoSKXOa7XvPztT0ic=; b=gbC4Mgrg5aTHyCWOXqaF1SNDoOHEqj+punpam1DwcrHWUsVHDHXRB1f6EhI3gLQ5WVx9du o9eedrk8mm+Ve5XD1pKD4zZ/8VjrRGR6lOZx58WLvluSs6Lq0m6nwOwPABe63uekIQiGLs 0W0f6YF4NvxRwev+aJmYCj4REcsJ+71/Qyyj0xqOjENAOsJr0Yml8k5K4ws33/NMg3SHeT ZElCYOzTYfDEC7mXAaSPnn7EgF/UZtsrGRh5abfRZ9SkwTPXguBH8gJMO/nl5ZN5lKwvdA N9v5C++o0G/wxdPr+thXAmXfkpxeUxUJTgf8PQlen7dF/tS9ubxbtQ083SRDRQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4T1kgX2gt8z14xR; Fri, 29 Dec 2023 12:08:56 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BTC8uIT066806; Fri, 29 Dec 2023 12:08:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BTC8utQ066803; Fri, 29 Dec 2023 12:08:56 GMT (envelope-from git) Date: Fri, 29 Dec 2023 12:08:56 GMT Message-Id: <202312291208.3BTC8utQ066803@gitrepo.freebsd.org> To: doc-committers@FreeBSD.org, dev-commits-doc-all@FreeBSD.org From: Benedict Reuschling Subject: git: fa54965290 - main - Whitespace fixes at the end of some lines List-Id: Commit messages for all branches of the doc repository List-Archive: https://lists.freebsd.org/archives/dev-commits-doc-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-doc-all@freebsd.org X-BeenThere: dev-commits-doc-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bcr X-Git-Repository: doc X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: fa549652903da7e23e93fca258b4786a74904213 Auto-Submitted: auto-generated The branch main has been updated by bcr: URL: https://cgit.FreeBSD.org/doc/commit/?id=fa549652903da7e23e93fca258b4786a74904213 commit fa549652903da7e23e93fca258b4786a74904213 Author: Benedict Reuschling AuthorDate: 2023-12-29 12:08:42 +0000 Commit: Benedict Reuschling CommitDate: 2023-12-29 12:08:42 +0000 Whitespace fixes at the end of some lines --- .../content/en/articles/linux-emulation/_index.adoc | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/documentation/content/en/articles/linux-emulation/_index.adoc b/documentation/content/en/articles/linux-emulation/_index.adoc index daf9c0ff1d..a252df5f54 100644 --- a/documentation/content/en/articles/linux-emulation/_index.adoc +++ b/documentation/content/en/articles/linux-emulation/_index.adoc @@ -61,7 +61,7 @@ toc::[] In the last few years the open source UNIX(R) based operating systems started to be widely deployed on server and client machines. Among these operating systems I would like to point out two: FreeBSD, for its BSD heritage, time proven code base and many interesting features and Linux(R) for its wide user base, enthusiastic open developer community and support from large companies. -FreeBSD tends to be used on server class machines serving heavy duty networking tasks with less usage on desktop class machines for ordinary users. +FreeBSD tends to be used on server class machines serving heavy duty networking tasks with less usage on desktop class machines for ordinary users. While Linux(R) has the same usage on servers, but it is used much more by home based users. This leads to a situation where there are many binary only programs available for Linux(R) that lack support for FreeBSD. @@ -219,7 +219,7 @@ The parameters to the actual syscall handler are passed in the form of `struct t Handling of traps in FreeBSD is similar to the handling of syscalls. Whenever a trap occurs, an assembler handler is called. It is chosen between alltraps, alltraps with regs pushed or calltrap depending on the type of the trap. -This handler prepares arguments for a call to a C function `trap()` (defined in [.filename]#sys/i386/i386/trap.c#), which then processes the occurred trap. +This handler prepares arguments for a call to a C function `trap()` (defined in [.filename]#sys/i386/i386/trap.c#), which then processes the occurred trap. After the processing it might send a signal to the process and/or exit to userland using `userret()`. [[freebsd-exits]] @@ -793,7 +793,7 @@ Also `PT_SYSCALL` is not implemented. [[traps]] === Traps -Whenever a Linux(R) process running in the emulation layer traps the trap itself is handled transparently with the only exception of the trap translation. +Whenever a Linux(R) process running in the emulation layer traps the trap itself is handled transparently with the only exception of the trap translation. Linux(R) and FreeBSD differs in opinion on what a trap is so this is dealt with here. The code is actually very short: @@ -851,7 +851,7 @@ Then we talk briefly about some syscalls. One of the major areas of progress in development of Linux(R) 2.6 was threading. Prior to 2.6, the Linux(R) threading support was implemented in the linuxthreads library. The library was a partial implementation of POSIX(R) threading. -The threading was implemented using separate processes for each thread using the `clone` syscall to let them share the address space (and other things). +The threading was implemented using separate processes for each thread using the `clone` syscall to let them share the address space (and other things). The main weaknesses of this approach was that every thread had a different PID, signal handling was broken (from the pthreads perspective), etc. Also the performance was not very good (use of `SIGUSR` signals for threads synchronization, kernel resource consumption, etc.) so to overcome these problems a new threading system was developed and named NPTL. @@ -954,7 +954,7 @@ More about locking later. [[pid-mangling]] ==== PID mangling -As there is a difference in view as what to the idea of a process ID and thread ID is between FreeBSD and Linux(R) we have to translate the view somehow. +As there is a difference in view as what to the idea of a process ID and thread ID is between FreeBSD and Linux(R) we have to translate the view somehow. We do it by PID mangling. This means that we fake what a PID (=TGID) and TID (=PID) is between kernel and userland. The rule of thumb is that in kernel (in Linuxulator) PID = PID and TGID = shared -> group pid and to userland we present `PID = shared -> group_pid` and `TID = proc -> p_pid`. @@ -1006,7 +1006,7 @@ Newer glibc in a case of 2.6 kernel uses `clone` to implement man:fork[2] and ma ==== Locking The locking is implemented to be per-subsystem because we do not expect a lot of contention on these. -There are two locks: `emul_lock` used to protect manipulating of `linux_emuldata` and `emul_shared_lock` used to manipulate `linux_emuldata_shared`. +There are two locks: `emul_lock` used to protect manipulating of `linux_emuldata` and `emul_shared_lock` used to manipulate `linux_emuldata_shared`. The `emul_lock` is a nonsleepable blocking mutex while `emul_shared_lock` is a sleepable blocking `sx_lock`. Due to of the per-subsystem locking we can coalesce some locks and that is why the em find offers the non-locking access. @@ -1392,7 +1392,7 @@ We are able to run the most used applications like package:www/linux-firefox[], Some of the programs exhibit bad behavior under 2.6 emulation but this is currently under investigation and hopefully will be fixed soon. The only big application that is known not to work is the Linux(R) Java(TM) Development Kit and this is because of the requirement of `epoll` facility which is not directly related to the Linux(R) kernel 2.6. -We hope to enable 2.6.16 emulation by default some time after FreeBSD 7.0 is released at least to expose the 2.6 emulation parts for some wider testing. +We hope to enable 2.6.16 emulation by default some time after FreeBSD 7.0 is released at least to expose the 2.6 emulation parts for some wider testing. Once this is done we can switch to Fedora Core 6 linux_base, which is the ultimate plan. [[future-work]]