linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: ValdikSS <iam@valdikss.org.ru>
To: Barry Song <21cnbao@gmail.com>
Cc: Alexey Avramov <hakavlad@inbox.lv>, Linux-MM <linux-mm@kvack.org>,
	Linux Doc Mailing List <linux-doc@vger.kernel.org>,
	linux-fsdevel@vger.kernel.org,
	LKML <linux-kernel@vger.kernel.org>,
	Jonathan Corbet <corbet@lwn.net>,
	Andrew Morton <akpm@linux-foundation.org>,
	mcgrof@kernel.org, Kees Cook <keescook@chromium.org>,
	yzaikin@google.com, oleksandr@natalenko.name, kernel@xanmod.org,
	aros@gmx.com, hakavlad@gmail.com, Yu Zhao <yuzhao@google.com>
Subject: Re: [PATCH] mm/vmscan: add sysctl knobs for protecting the working set
Date: Tue, 25 Jan 2022 11:19:24 +0300	[thread overview]
Message-ID: <f6a335b7-9cd8-eb02-69b3-bdf15ebf69fa@valdikss.org.ru> (raw)
In-Reply-To: <CAGsJ_4zMoV6UJGC_X-VRM7p8w68a0Q8sLVfS3sRFxuQUtHoASw@mail.gmail.com>


[-- Attachment #1.1: Type: text/plain, Size: 3560 bytes --]

On 13.12.2021 11:38, Barry Song wrote:
> On Tue, Dec 7, 2021 at 5:47 AM ValdikSS <iam@valdikss.org.ru> 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.
>>
> 
> Can you please post your hardware information like what is the cpu, how much
> memory you have and also post your sysctl knobs, like how do you set
> vm.anon_min_kbytes,  vm.clean_low_kbytes and vm.clean_min_kbytes?

I have a typical office computer of year 2007:

* Motherboard: Gigabyte GA-945GCM-S2L (early LGA775 socket, GMA950 
integrated graphics, September 2007)
* 2 core 64 bit CPU: Intel® Core™2 Duo E4600 (2 cores, 2.4 GHz, late 2007)
* 2 GB of RAM (DDR2 667 MHz, single module)
* Very old and slow 160 GB Hard Disk: Samsung HD161HJ (SATA II, June 2007):
* No discrete graphics card

I used vm.clean_low_kbytes=384000 (384 MB) to keep most of file cache in 
memory, because the HDD is slow and every data re-read leads to 
uncomfortable freezes and slow work.

More information, including the video, is here: 
https://notes.valdikss.org.ru/linux-for-old-pc-from-2007/en/

> 
>> 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.
>>
> 
> Can you post the link of the similar file-locking patch?

Here's a patch: https://lkml.org/lkml/2010/10/28/289
Here's more in-depth description: https://lkml.org/lkml/2010/11/1/20

Please also note that another Google developer, Yu Zhao, has also made a 
modern version of this (ChromiumOS) patch called MGLRU, the goal of 
which is quite similar to le9 (the patch we're discussing here), but 
with "more brains":
https://lore.kernel.org/lkml/20220104202247.2903702-1-yuzhao@google.com/T/#m8fd2a29bc557d27d1000f837f65b6c930eef9dff

Please take a moment and read the information in the link above. Yu Zhao 
develops this patch for almost two years and knows the issue better than 
me, a casual user.


> 
>> 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/
>>
> 
> The video was captured before using this patch? what video says
> "the result of the test computer after the configuration", what does
> "the configuration" mean?

The video was captured after the patch. Before the patch, it's basically 
not possible to use Firefox only with 20+ tabs because the PC enters 
thrashing condition and reacts so slow that even mouse cursor freezes 
frequently. The PC is absolutely unusable for any decent work without 
the patch, regardless of swappiness, vm.min_free_kbytes or any other 
tunables.

The configuration is this patch with vm.clean_low_kbytes=384000 and 150% 
zram. More information is provided on the website.

> 
> Thanks
> Barry

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 840 bytes --]

  reply	other threads:[~2022-01-25  8:19 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20211130201652.2218636d@mail.inbox.lv>
2021-11-30 15:28 ` Luis Chamberlain
2021-11-30 18:56 ` Oleksandr Natalenko
2021-12-01 15:51   ` Alexey Avramov
2021-12-02 18:05 ` ValdikSS
2021-12-02 21:58   ` Andrew Morton
2021-12-03 11:59     ` Vlastimil Babka
2021-12-03 13:27       ` Alexey Avramov
2021-12-06  9:59         ` Michal Hocko
2022-01-09 22:59           ` Barry Song
2021-12-03 14:01     ` Oleksandr Natalenko
2021-12-12 20:15     ` Alexey Avramov
2021-12-13  9:06       ` Barry Song
2021-12-13  9:07       ` Michal Hocko
2021-12-13  8:38   ` Barry Song
2022-01-25  8:19     ` ValdikSS [this message]
2022-02-12  0:01       ` Barry Song

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f6a335b7-9cd8-eb02-69b3-bdf15ebf69fa@valdikss.org.ru \
    --to=iam@valdikss.org.ru \
    --cc=21cnbao@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=aros@gmx.com \
    --cc=corbet@lwn.net \
    --cc=hakavlad@gmail.com \
    --cc=hakavlad@inbox.lv \
    --cc=keescook@chromium.org \
    --cc=kernel@xanmod.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mcgrof@kernel.org \
    --cc=oleksandr@natalenko.name \
    --cc=yuzhao@google.com \
    --cc=yzaikin@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox