Code Monkey home page Code Monkey logo

meios's People

Contributors

harikrishnan94 avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

meios's Issues

Primary MiniUART for console logging

  • Detection and Initialisation via DTB
  • Poll mode & Interrupt mode
  • Kernel initialisation logs must goto this device
    • Basically this should provide println! support inside kernel

Slab Allocator

Goals

  • Serve as allocator for small objects in kernel.
  • Best case O(1) and Worst Case O(log n) on both alloc and free operation
  • Should provide Box/Rc/Arc implementation.
  • Usable by any Node based container.
  • Provide default set of size classes for General purpose usage
  • Support Custom Size classes for critical types.

Design

  • Default set of size classes are determined at build time
  • Each size class represents the object size and the page size from which each object is carved
  • Two strategies are supported.
    • Always choose a partially filled page with most amount of free blocks
      • Best for overall performance.
      • Subsequent allocations returns nearby blocks - Improves cache usage
      • SlabPool cache hit also increased due to using the same metadata over multiple allocations.
    • Always choose a partially filled page with least amount of free blocks.
      • Overall Memory Efficient.
      • Best for avoiding fragmentation (External)
      • Facilitates earlier release of free'd block to upstream allocator.
    • But once a page is choosen, it will be used until all its free blocks are exhausted.
  • 5 Levels (Watermarks) - used to approximate sorted blocks.
    • 5 levels after - fully empty (no free blocks) pages.
    • Atleast 1 free block to 20 % blocks free.
    • 20 - 40 % blocks free.
    • 40 - 60 % blocks free.
    • 60 - 80 % blocks free.
    • 80 - 100 % blocks free.
  • Metadata is stored externally outside the page to
    • Allow full utilization of page
    • Security purposes - memory corruption possibly won't corrupt Slab Metadata.
  • After mounting the kernel image, rest (Majority) of RAM is provided to SLAB manager
  • Memory for SLAB metadata is reserved and rest of the address range is provided to Buddy Allocator.
  • Empty pages are obtained from Buddy Allocator and it is also exposed outside as General Purpose page allocator.
  • Custom size classes are supported via RegisterSizeClass API.
    • Only the object size needs to be provided. Page size is automatically chosen.

Design Tasks

  • Determine API for SLAB initialization
  • Determine API Custom Size class Registration
  • Determine General purpose size classes and their page sizes
  • Determine object size to size class mapper
  • How to minimize Unsafe usage?

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.