From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 63DC2C433EF for ; Thu, 2 Dec 2021 21:58:50 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id B47786B0072; Thu, 2 Dec 2021 16:58:39 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id ACD816B0074; Thu, 2 Dec 2021 16:58:39 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 947BB6B0075; Thu, 2 Dec 2021 16:58:39 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0186.hostedemail.com [216.40.44.186]) by kanga.kvack.org (Postfix) with ESMTP id 7E0466B0072 for ; Thu, 2 Dec 2021 16:58:39 -0500 (EST) Received: from smtpin02.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 320F2180E4EE9 for ; Thu, 2 Dec 2021 21:58:29 +0000 (UTC) X-FDA: 78874218738.02.22EB38C Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf09.hostedemail.com (Postfix) with ESMTP id 27D693000104 for ; Thu, 2 Dec 2021 21:58:29 +0000 (UTC) Received: from mail.kernel.org (unknown [198.145.29.99]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id C455962825; Thu, 2 Dec 2021 21:58:27 +0000 (UTC) Received: by mail.kernel.org (Postfix) with ESMTPSA id 9F1B760E0B; Thu, 2 Dec 2021 21:58:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1638482307; bh=u54M8TvqFCoqyWizAXfj0p458N8cswh37sQPhuz+PE8=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=gRmuD2cdMj0JpWJeCh8p6a6Bco8m3d04KtZ8Kd+lRiv0KNpbc5QDnURexbd5oeFqK hjvtOIAthwV4+RummH/wrQf59WNK6NBbdnu+FVNXQ+164xA8DRwsskjqDPshxg9uKX zMEACX/Rr8Fh+5Fwymwac7m8oa/bN1rwC0xjXqbU= Date: Thu, 2 Dec 2021 13:58:24 -0800 From: Andrew Morton To: ValdikSS Cc: Alexey Avramov , linux-mm@kvack.org, linux-doc@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, corbet@lwn.net, mcgrof@kernel.org, keescook@chromium.org, yzaikin@google.com, oleksandr@natalenko.name, kernel@xanmod.org, aros@gmx.com, hakavlad@gmail.com, Yu Zhao Subject: Re: [PATCH] mm/vmscan: add sysctl knobs for protecting the working set Message-Id: <20211202135824.33d2421bf5116801cfa2040d@linux-foundation.org> In-Reply-To: <2dc51fc8-f14e-17ed-a8c6-0ec70423bf54@valdikss.org.ru> References: <20211130201652.2218636d@mail.inbox.lv> <2dc51fc8-f14e-17ed-a8c6-0ec70423bf54@valdikss.org.ru> X-Mailer: Sylpheed 3.5.1 (GTK+ 2.24.31; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Rspamd-Server: rspam11 X-Rspamd-Queue-Id: 27D693000104 X-Stat-Signature: knwaaz31d68mfegnufx5fy99fbmqnej3 Authentication-Results: imf09.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=korg header.b=gRmuD2cd; spf=pass (imf09.hostedemail.com: domain of akpm@linux-foundation.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=akpm@linux-foundation.org; dmarc=none X-HE-Tag: 1638482309-660002 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Thu, 2 Dec 2021 21:05:01 +0300 ValdikSS wrote: > This patchset is surprisingly effective and very useful for low-end PC > with slow HDD, single-board ARM boards with slow storage, cheap Android > smartphones with limited amount of memory. It almost completely prevents > thrashing condition and aids in fast OOM killer invocation. > > The similar file-locking patch is used in ChromeOS for nearly 10 years > but not on stock Linux or Android. It would be very beneficial for > lower-performance Android phones, SBCs, old PCs and other devices. > > With this patch, combined with zram, I'm able to run the following > software on an old office PC from 2007 with __only 2GB of RAM__ > simultaneously: > > * Firefox with 37 active tabs (all data in RAM, no tab unloading) > * Discord > * Skype > * LibreOffice with the document opened > * Two PDF files (14 and 47 megabytes in size) > > And the PC doesn't crawl like a snail, even with 2+ GB in zram! > Without the patch, this PC is barely usable. > Please watch the video: > https://notes.valdikss.org.ru/linux-for-old-pc-from-2007/en/ > This is quite a condemnation of the current VM. It shouldn't crawl like a snail. The patch simply sets hard limits on page reclaim's malfunctioning. I'd prefer that reclaim not malfunction :( That being said, I can see that a blunt instrument like this would be useful. I don't think that the limits should be "N bytes on the current node". Nodes can have different amounts of memory so I expect it should scale the hard limits on a per-node basis. And of course, the various zones have different size as well. We do already have a lot of sysctls for controlling these sort of things. Was much work put into attempting to utilize the existing sysctls to overcome these issues?