From owner-freebsd-questions@freebsd.org Sun Jul 26 15:38:38 2020 Return-Path: Delivered-To: freebsd-questions@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 64863363818 for ; Sun, 26 Jul 2020 15:38:38 +0000 (UTC) (envelope-from aryeh.friedman@gmail.com) Received: from mail-io1-xd33.google.com (mail-io1-xd33.google.com [IPv6:2607:f8b0:4864:20::d33]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BF6Xs1rNGz3Syq for ; Sun, 26 Jul 2020 15:38:36 +0000 (UTC) (envelope-from aryeh.friedman@gmail.com) Received: by mail-io1-xd33.google.com with SMTP id s189so7226737iod.2 for ; Sun, 26 Jul 2020 08:38:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Qc/rhsLUiFxPjJXbKlmv0znD+Sn6iY7gNvnzOCd2rlQ=; b=NORICJO3ucco7yf20b3O+1AUoduNocuKRrOsRryl+iiMpL875JhI5b1sk7+mVNHyM7 9yk+aoo9MnPWQPsuOzJ2qffXI5OQSJfE4vx+jqw3AyQa3flw5jOvaVs8U1pAbUywI6Uk WJvLwAexDxxT+G0zzaB+xOIPDflgszpeB4y1S+qkjsNjKtN9N2cDM/xJH+DvuUpjifnI as+qYxmq44Ky1Ewr1pHJy3A2rTpbVIuteDTzyTF5Jy2SjobFxqIlUEq/Ogu9m+3WtScL ObUUtNsV/VTNALAbcbGRn5Vq+/PzzkjZaL050r5vfpcNL8odFWljcqdtwNtGCsbSFnTF skIg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Qc/rhsLUiFxPjJXbKlmv0znD+Sn6iY7gNvnzOCd2rlQ=; b=hW619e8uLf3+kIlXLLn4Srke0JR8jbo+/NVPrp4ZsA0rJnlxewlt+mJn7ZZwAG9Lwi IzpZ5DOorLALuj5Njx9TlAau+u1bqwDEBPE+xi0OaLd0mBxG1WQrM18QvywL9LWFAWjn p2/ERCMpaAT561/ICOAmoRLJpk/wEqJX2uhZjqXASBxch0F8ma6L2dYa0TS1Ly4rPLAL ec3/wlAHqEjOFbaTW/Mv+CY8LCIdoX9sxrgSZJMIH87eikRKRJsJAh0/ZQ7n4GFpCaC4 KDzvMnzdWeuCKZ+y/dmDwnLCMbt9v6icNopTcXcEn+rpnxR+PAzds1ef4ySTGIdmFxUt vwZw== X-Gm-Message-State: AOAM532lHw6QawcAnY/iNjOH31Wz/8PfDGsAS8f0Y2jHK4BOTQVVtuX5 4fOj77XTovn9aNdsL4TclSSBiT3jGUgIRk3UPqNP691c X-Google-Smtp-Source: ABdhPJz6JhRRdKjRAN25PHPSvhObw5ct3hupaCoEpe8aYFoaYxR0DxtegNx0VZkO20YVftn6Ug75mjNKIRbaGSrO2rw= X-Received: by 2002:a05:6638:2653:: with SMTP id n19mr6837506jat.34.1595777915443; Sun, 26 Jul 2020 08:38:35 -0700 (PDT) MIME-Version: 1.0 References: <20200725152412.GJ92589@admin.sibptus.ru> <20200725162403.GA4721@admin.sibptus.ru> <20200725182554.deffc63058a7c9f6d343ef06@sohara.org> <04df312d-9b2b-1873-2117-79a49e089bd9@kicp.uchicago.edu> <20200726063256.GA22924@admin.sibptus.ru> <20200726093909.ee5e14e643d31da4dad5c804@sohara.org> <20200726151835.GA35966@admin.sibptus.ru> In-Reply-To: <20200726151835.GA35966@admin.sibptus.ru> From: Aryeh Friedman Date: Sun, 26 Jul 2020 11:38:24 -0400 Message-ID: Subject: Re: Ask stupid questions and you'll get a stupid answers, was: Technological advantages over Linux To: Victor Sudakov Cc: FreeBSD Mailing List X-Rspamd-Queue-Id: 4BF6Xs1rNGz3Syq X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=NORICJO3; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of aryehfriedman@gmail.com designates 2607:f8b0:4864:20::d33 as permitted sender) smtp.mailfrom=aryehfriedman@gmail.com X-Spamd-Result: default: False [-3.70 / 15.00]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; NEURAL_HAM_MEDIUM(-1.00)[-1.003]; FROM_HAS_DN(0.00)[]; FREEMAIL_FROM(0.00)[gmail.com]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-questions@freebsd.org]; NEURAL_HAM_LONG(-1.03)[-1.032]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; RCPT_COUNT_TWO(0.00)[2]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::d33:from]; NEURAL_HAM_SHORT(-0.67)[-0.668]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; TAGGED_FROM(0.00)[]; RCVD_TLS_ALL(0.00)[]; RCVD_COUNT_TWO(0.00)[2] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.33 X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Jul 2020 15:38:38 -0000 On Sun, Jul 26, 2020 at 11:18 AM Victor Sudakov wrote: > Steve O'Hara-Smith wrote: > > > > > FreeBSD freezes, then kills some innocent random processes like > > > local_unbound, then it may slowly recover. Sometimes it guesses > > > correctly and kills the offender (firefox most often). > > > > What else would you have it do ? Kill the largest process ? Kill > > the last process to call malloc ? There is no good response to OOM. The > OS > > has no way to know which processes you care about most. > > AFAIK the Linux OOM killer uses multiple weighted criteria to decide > which process to kill. Each process has an oom_score showing its > eligibility to be killed. > > So at least Linux attemps intelligent killing. What about FreeBSD? > Every time a piece of software and/or algorithm attempts to be "intelligent" the only thing it succeeds in doing is being "too smart for its own good" (there will always be exceptions and odds are the first/normal real world use of it will be just such an exception, but the algorithm thinks it knows best and does the wrong thing). Thus using the simplest measure (like last reference or cpu usage is a good measure [assuming it is not using the cpu due to I/O waiting]) is likely the best and that's what FreeBSD does. Note except for the case of bugs (like the one being discussed in the other subthread) it is very unlikely that you will ever encounter OOM on a real machine these days and if you have an app that might cause an OOM due to its nature then that program almost always has its own swap like feature that it manages on its own. Good example is vi and large files, vi does not keep the whole file in memory, but only window on the current cursor position. -- Aryeh M. Friedman, Lead Developer, http://www.PetiteCloud.org