From owner-freebsd-hackers@freebsd.org Wed Feb 24 15:26:32 2021 Return-Path: Delivered-To: freebsd-hackers@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 26DC95603C7 for ; Wed, 24 Feb 2021 15:26:32 +0000 (UTC) (envelope-from Walter.von.Entferndt@posteo.net) Received: from mout01.posteo.de (mout01.posteo.de [185.67.36.65]) (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 4Dm0Bb2Phdz3Qbs for ; Wed, 24 Feb 2021 15:26:31 +0000 (UTC) (envelope-from Walter.von.Entferndt@posteo.net) Received: from submission (posteo.de [89.146.220.130]) by mout01.posteo.de (Postfix) with ESMTPS id A563D160060 for ; Wed, 24 Feb 2021 16:26:28 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1614180388; bh=pZPhE3pIEhHh+Rmi941y/hnvNs+W5CyZdXRaZdefxe4=; h=From:To:Cc:Subject:Date:From; b=J3MudocWDhyfkZ/6CJp2Ff0mjzhtll/xSdeN+Urry8zBJAlS072o2lzt4dBAaoWp6 96apbjQENYFKKCHtTWE3GP68QNjkKlkmhcOq5eD1SBD/xqiZnDQ2XidENT6hwZdKGC pio/LcaK09NLmC+uOZm4sB9LUZkkleUI22ayGoPT/ibzWElPpOAgHZjx5lOnKh8TyT weBkiCUPwSvfv7e6od76fMHVaY5J8cdgSO3z3URK9myzO7vZHPbUlUUQP0Te9vIPz6 hWyfL2o8WyOAhvy38n/AVLWlL8tMryyGDMw8Xp5QOCuR93cXpN2wrEa9K4TkAcnGqi bnLbXjC2nXOKw== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4Dm0BW4vK4z6tmd; Wed, 24 Feb 2021 16:26:27 +0100 (CET) From: Walter von Entferndt To: freebsd-hackers@freebsd.org Cc: Alan Somers , Konstantin Belousov , Mark Millard Subject: Re: The out-of-swap killer makes poor choices Date: Wed, 24 Feb 2021 16:26:16 +0100 Message-ID: <9084784.RH3biPoPvx@t450s.local.lan> X-Face: #$[hC+4[4W*mS3hB&izisyT_#E]^Aq+7Isv`2Tu5q*1~jR@&['74B>Ibyrk]GTJ!j$ NjX=#L2#k2X7OnaaRM_Pd5`>`8OJ3; +I2 References: MIME-Version: 1.0 X-Rspamd-Queue-Id: 4Dm0Bb2Phdz3Qbs X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=posteo.net header.s=2017 header.b=J3MudocW; dmarc=pass (policy=none) header.from=posteo.net; spf=pass (mx1.freebsd.org: domain of Walter.von.Entferndt@posteo.net designates 185.67.36.65 as permitted sender) smtp.mailfrom=Walter.von.Entferndt@posteo.net X-Spamd-Result: default: False [-4.20 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:185.67.36.0/23]; RCVD_DKIM_ARC_DNSWL_MED(-0.50)[]; RCVD_COUNT_THREE(0.00)[3]; RCVD_IN_DNSWL_MED(-0.20)[185.67.36.65:from]; DKIM_TRACE(0.00)[posteo.net:+]; DMARC_POLICY_ALLOW(-0.50)[posteo.net,none]; NEURAL_HAM_SHORT(-1.00)[-1.000]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; CTE_CASE(0.50)[]; ASN(0.00)[asn:8495, ipnet:185.67.36.0/23, country:DE]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; R_DKIM_ALLOW(-0.20)[posteo.net:s=2017]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-hackers@freebsd.org]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RWL_MAILSPIKE_VERYGOOD(0.00)[185.67.36.65:from]; FREEMAIL_CC(0.00)[freebsd.org,gmail.com,yahoo.com]; RCVD_TLS_ALL(0.00)[]; MAILMAN_DEST(0.00)[freebsd-hackers] Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7Bit X-Content-Filtered-By: Mailman/MimeDel 2.1.34 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Technical discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Feb 2021 15:26:32 -0000 I'd like to suggest that it might be useful to add more (simple) criteria to apply ordered classes/queues to the list of processes that are candidates for beeing killed, similar to the time scheduler's runtime queues. Then the (e)uid of the process comes to mind. It's not expensive to check the processes' uid (or euid) and favour the so-called system users (usually uid <= 1000) over other (human) users; i.e. apply the order: [humans] < [system] < [trad. daemons (uid <124)] < [root]. Then kill from the lowest queue (humans) before the next etc.pp. Or use these classes to apply a weight to the processes' page count. OTT, maybe it's ok to kill jails (or processes therein) before the host. Such an addition could be simple, but efficiently give better choices. Regards -- =|o) "Stell' Dir vor es geht und keiner kriegt's hin." (Wolfgang Neuss)