Code Monkey home page Code Monkey logo

mg-lru-helper's Introduction

Enable or disable multigenerational LRU

There are simple shell scripts and oneshot systemd services to enable or disable multigenerational LRU at boot time or on the fly, and to get the current state of mg-LRU.

MGLRU Patches Merged To "mm-stable" Ahead Of Linux 6.1

Usage

Run mglru (get the current state), set_mglru N (enable/disable mg-LRU), and set_min_ttl_ms M. You can add the oneshot service to startup.

Get the current state:

$ mglru
#!/bin/sh -ev
cat /sys/kernel/mm/lru_gen/enabled
0x0007
cat /sys/kernel/mm/lru_gen/min_ttl_ms
1000

Disable multigenerational LRU:

$ set_mglru 0
#!/bin/sh -ev
echo $1 | sudo tee /sys/kernel/mm/lru_gen/enabled
0

Enable multigenerational LRU:

$ set_mglru 1
#!/bin/sh -ev
echo $1 | sudo tee /sys/kernel/mm/lru_gen/enabled
1

Apply all the multigenerational LRU features:

$ set_mglru y
#!/bin/sh -ev
echo $1 | sudo tee /sys/kernel/mm/lru_gen/enabled
y

set_mglru takes values from 0 to 7 and [yYnN] (since MGLRU v7). Most users should enable or disable all the features unless some of them have unforeseen side effects.

Set min_ttl_ms:

$ set_min_ttl_ms 2000
#!/bin/sh -v
echo $1 | sudo tee /sys/kernel/mm/lru_gen/min_ttl_ms
2000

Enable/disable multigenerational LRU during system boot:

$ sudo systemctl enable mglru.service

By default it sets /sys/kernel/mm/lru_gen/enabled to Y and /sys/kernel/mm/lru_gen/min_ttl_ms to 1000.

Edit the unit file using systemctl (to change enabled and min_ttl_ms values):

$ sudo systemctl edit mglru.service --full

Installation

Install

$ git clone https://github.com/hakavlad/mg-lru-helper.git
$ cd mg-lru-helper
$ sudo make install

Uninstall

$ sudo make uninstall

Kernels with mg-LRU

Resources

Multigenerational LRU Framework at LKML:

Multigenerational LRU Framework at LWN.net:

Multigenerational LRU Framework at phoronix:

Multigenerational LRU Framework at linux.org.ru:

mg-lru-helper's People

Contributors

hakavlad avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.