Giter VIP home page Giter VIP logo

dcache's Introduction

Linux Directory Cache (dcache) Optimization

For more details about the principles and designs of this optimization, please see this paper:

How to Get More Value From Your File System Directory Cache
download
Chia-Che Tsai, Yang Zhan, Jayashree Reddy, Yizheng Jiao, Tao Zhang, Donald E. Porter (Stony Brook University)
Published in SOSP 2015

This code is a optimized design of Linux directory cache, to improve hit latency for path lookup, and reduce cache miss for directory listing and unique file creation.

Building instructions

This optimization is implemented on top of Linux 3.14 kernel, with changes in the dcache source code, including:

  • include/linux/types.h
  • include/linux/dcache.h
  • include/linux/namei.h
  • fs/dcache.c
  • fs/namei.c
  • fs/namespace.c

To build the kernel, use make menuconfig or copy a old Linux 3.14 config file into the linux-3.14 directory. By default, the dcache optimization is enabled, and set to default options. For more tuning in the dcache optimization, change the options in make menuconfig:

  -> File systems
      -> dcache optimization

After setting up the kernel options, use make and make install, or building tools such as make-kpkg to build and install the kernel. Basic knowledge and experience about building, installing and booting alternative Linux kernel is required.

dcache's People

Contributors

chiache avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

dcache's Issues

Kernel Oops when mount NTFS partition with dcache

Hi,

I'm trying dcache and encounter kernel oops when mount a NTFS partition. The configs are default.

[ 192.985965] ------------[ cut here ]------------
[ 192.985999] kernel BUG at fs/fast_dcache/namei.c:1121!
[ 192.986025] invalid opcode: 0000 [#1] SMP
[ 192.986051] Modules linked in: xfs libcrc32c pmem(O) snd_hda_codec_hdmi snd_hda_codec_realtek snd_hda_codec_generic snd_hda_intel snd_hda_codec snd_hwdep snd_pcm intel_rapl x86_pkg_temp_thermal intel_powerclamp coretemp kvm_intel kvm crct10dif_pclmul crc32_pclmul ghash_clmulni_intel bnep rfcomm bluetooth 6lowpan_iphc snd_seq_midi snd_seq_midi_event snd_rawmidi hid_logitech_dj joydev aesni_intel aes_x86_64 lrw gf128mul glue_helper ablk_helper cryptd snd_seq serio_raw snd_seq_device i915 snd_timer drm_kms_helper snd drm nuvoton_cir rc_core i2c_algo_bit soundcore mei_me mac_hid shpchp mei lpc_ich intel_smartconnect video binfmt_misc parport_pc ppdev lp parport hid_generic usbhid hid psmouse r8169 ahci mii libahci
[ 192.986554] CPU: 7 PID: 3680 Comm: pool Tainted: G O 3.14.0 #1
[ 192.986603] Hardware name: To Be Filled By O.E.M. To Be Filled By O.E.M./B75 Pro3-M, BIOS P1.40 05/11/2012
[ 192.986670] task: ffff880609792fd0 ti: ffff88049f45c000 task.ti: ffff88049f45c000
[ 192.986722] RIP: 0010:[] [] link_path_walk_fast+0xad4/0xae0
[ 192.986796] RSP: 0018:ffff88049f45d840 EFLAGS: 00010246
[ 192.986836] RAX: ffff8805fa2924c0 RBX: ffff8805c5557060 RCX: 0000000100160016
[ 192.986889] RDX: 000060f9e1a00e70 RSI: 0000000000160016 RDI: ffff8805c5557060
[ 192.986940] RBP: ffff88049f45d908 R08: ffff8800b8ba103f R09: ffff8805c5557060
[ 192.986975] R10: ffff8805fa2924c0 R11: 00000000801800c4 R12: ffff8806093c0000
[ 192.987007] R13: 0000000000000000 R14: ffff88049f45d9e0 R15: ffff88049f45d9e0
[ 192.987041] FS: 00007feb3d29f700(0000) GS:ffff88061e3c0000(0000) knlGS:0000000000000000
[ 192.987080] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ 192.987121] CR2: 00007feb4a76b000 CR3: 00000005c6286000 CR4: 00000000001407e0
[ 192.987155] Stack:
[ 192.987167] 0000000031da9c35 0000000000000002 ffff8805fa2924c0 ffff8805c5557060
[ 192.987215] ffff8800b8ba1021 0000000000000000 ffff88049f45dac0 00000008c5557060
[ 192.987269] 0000000800000008 0000000000000000 ffff8805c5557001 ffff8800b8ba103f
[ 192.987311] Call Trace:
[ 192.987331] [] ? lookup_dcache+0x87/0x150
[ 192.987361] [] ? lockref_put_or_lock+0x50/0x90
[ 192.987390] [] ? dput+0x51/0xb0
[ 192.987416] [] path_lookupat+0x105/0xa50
[ 192.987445] [] ? ima_file_check+0x54/0x180
[ 192.987475] [] ? mntput+0x24/0x40
[ 192.987501] [] ? kmem_cache_alloc+0x31/0x140
[ 192.987530] [] ? getname_flags+0x4b/0x180
[ 192.987566] [] filename_lookup+0x2a/0xd0
[ 192.987610] [] user_path_at_empty+0x54/0xb0
[ 192.987653] [] ? cpumask_next_and+0x30/0x50
[ 192.987699] [] ? load_balance+0x1ce/0x8b0
[ 192.987748] [] ? update_rq_clock.part.72+0x18/0x40
[ 192.987793] [] ? native_sched_clock+0x2e/0xa0
[ 192.987823] [] ? sched_clock+0x9/0x10
[ 192.987850] [] ? sched_clock_cpu+0x9d/0xb0
[ 192.987882] [] ? __switch_to+0x1ab/0x500
[ 192.987912] [] ? gup_pud_range+0xfb/0x1c0
[ 192.987940] [] ? get_user_pages_fast+0xa2/0x190
[ 192.987972] [] ? unlock_page+0x23/0x30
[ 192.988001] [] ? get_futex_key+0x1cf/0x2b0
[ 192.988030] [] ? futex_wake+0x71/0x140
[ 192.988057] [] ? do_futex+0x10a/0xc40
[ 192.988084] [] user_path_at+0x11/0x20
[ 192.988111] [] vfs_fstatat+0x52/0xa0
[ 192.988138] [] SYSC_newlstat+0x22/0x40
[ 192.988165] [] ? SyS_futex+0x76/0x170
[ 192.988193] [] ? fillonedir+0xd0/0xd0
[ 192.988220] [] SyS_newlstat+0xe/0x10
[ 192.988248] [] system_call_fastpath+0x1a/0x1f
[ 192.988286] Code: ff ff ff 4c 89 54 24 10 48 89 4c 24 18 e9 b2 f8 ff ff b8 f7 ff ff ff e9 4b fb ff ff b8 f5 ff ff ff e9 41 fb ff ff 49 89 c4 eb 9c <0f> 0b 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 55 48 89 e5
[ 192.988558] RIP [] link_path_walk_fast+0xad4/0xae0
[ 192.988598] RSP
[ 193.000736] ---[ end trace ec0e4c9b6d67adda ]---

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.