What happened in UBIFS during drop cache?

Today I want to know what happend in UBIFS during drop cache.

Drop cache is part of sysctl, you can get the details from Documentation/sysctl/vm.txt as below:

drop_caches

Writing to this will cause the kernel to drop clean caches, dentries and
inodes from memory, causing that memory to become free.

To free pagecache:
echo 1 > /proc/sys/vm/drop_caches
To free dentries and inodes:
echo 2 > /proc/sys/vm/drop_caches
To free pagecache, dentries and inodes:
echo 3 > /proc/sys/vm/drop_caches

As this is a non-destructive operation and dirty objects are not freeable, the
user should run `sync‘ first.

==============================================================

After echo N > /proc/sys/vm/drop_caches, kernel will call function drop_caches_sysctl_handler, this is the top interface to drop caches:

 1 int drop_caches_sysctl_handler(ctl_table *table, int write,
 2     void __user *buffer, size_t *length, loff_t *ppos)
 3 {
 4     int ret;
 5
 6     ret = proc_dointvec_minmax(table, write, buffer, length, ppos);
 7     if (ret)
 8         return ret;
 9     if (write) {
10         if (sysctl_drop_caches & 1)
11             iterate_supers(drop_pagecache_sb, NULL);
12         if (sysctl_drop_caches & 2)
13             drop_slab();
14     }
15     return 0;
16 }

fs/drop_caches.c

drop_slab will call all the shrinkers to free memory, like ubifs_shrinker.

In ubifs_shinker, will free the znodes and tnc tree. Details please refer to ubifs_shrinker in fs/ubifs/shrinker.c.

Author: Marty

Date: 2016-8-24

The end.

时间: 2024-08-24 19:37:55

What happened in UBIFS during drop cache?的相关文章

timesten 调整实例参数

--删除数据库实例 ttDestroy ttwind ---1.删除存在的cache group ttIsql "DSN=ttwind;UID=cacheuser;PWD=cacheuser;OraclePWD=cacheuser" drop Cache Group cachetblorders; call ttCachestop; exit; ttDestroy ttwind ---2.根据新的需求调整参数 vi /app/timesten/TimesTen/ttwind/info/

android 无法开机的uart log浅析

类似complex R/W mem test fail 在preloader阶段挂掉,请和弊司联系: [SD0] DAT CRC error,请打patch:ALPS00787669: NAND项目: init: command r=-1 ' mount ubifs [email protected] /system wait' init: command r=-1 ' mount ubifs [email protected] /data nosuid nodev wait' init: co

Linux -- dd 命令

11.2 `dd': Convert and copy a file================================== `dd' copies a file (from standard input to standard output, by default)with a changeable I/O block size, while optionally performingconversions on it.  Synopses: dd [OPERAND]...    

linux 手动添加swap

Linux手动添加swap分区 用法:dd [操作数] ... 或:dd 选项 Copy a file, converting and formatting according to the operands. bs=BYTES read and write up to BYTES bytes at a time cbs=BYTES convert BYTES bytes at a time conv=CONVS convert the file as per the comma separat

TimesTen 应用层数据库缓存学习:12. 管理缓存环境

缓存和复制代理的启停和状态查看 cache agent的作用是将监控Oracle中数据的变化,并更新到TimesTen.因此,对于只读和AWT缓存组,cache agent都是必需的. cache agent的启停 ttisql> call ttcachestart ttisql> call ttcachestop 或者 $ ttadmin -cachestart DSN $ ttadmin -cachestop DSN replication agent的启停 ttisql> call

Hadoop参数汇总

linux参数 以下参数最好优化一下: 文件描述符ulimit -n 用户最大进程 nproc (hbase需要 hbse book) 关闭swap分区 设置合理的预读取缓冲区 Linux的内核的IO调度器 JVM参数 JVM方面的优化项Hadoop Performance Tuning Guide Hadoop参数大全 适用版本:4.3.0 主要配置文件: core hdfs yarn mapred 重要性表示如下: 重要 一般 不重要 core-default.xml hadoop.comm

TimesTen 应用层数据库缓存学习:19. 理解AWT缓存组的三种模式

概述 本文很好的讲述了AWT三种缓存组的概念和区别,并给出了3种缓存组从建立到摧毁的完整过程. AWT缓存组有3中类型: 1. AWT 缺省 (Manually load) 2. AWT Dynamic 3. AWT Dynamic Globle (Cache Grid) 各种AWT类型的区别 AWT 缺省 (Manually load) TimesTen中inserted/updated/deleted的数据传递到Oracle Oracle中新增的数据通过"LOAD CACHE GROUP&q

hadoop参数配置

Hadoop参数汇总 linux参数 JVM参数 Hadoop参数大全 core-default.xml hdfs-default.xml yarn-default.xml Hadoop参数汇总 @(hadoop)[配置] linux参数 以下参数最好优化一下: 文件描述符ulimit -n 用户最大进程 nproc (hbase需要 hbse book) 关闭swap分区 设置合理的预读取缓冲区 Linux的内核的IO调度器 JVM参数 JVM方面的优化项Hadoop Performance

TimesTen学习系列之一:TT的迁移和备份

TimesTen可以使用ttMigrate进行迁移,类似于Oracle的exp/imp. 具体用法文档上写得非常详细了,或者可以执行ttMigrate --help查看. 我这里只对几个常见的使用场景进行记录. 1)导出单表: 可以使用下面格式: ttMigrate -c|-a DSN|ConnectStr 文件名 对象名 -c表示已创建的格式导出 -a表示追加导出 导出的对象可以是cachegroup/table/sequence/view等等 例如:导出某一个表 [[email protec