Giter Site home page Giter Site logo

kernel_exploring's People

Contributors

richardweiyang 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar

kernel_exploring's Issues

why preempt_disable() in __raw_spin_lock_irqsave()

__raw_spin_lock_irqsave()
    local_irq_save()
    preempt_disable()
    do_raw_spin_lock()

We disable irq, this means on one would interrupt us to do schedule.
And then grab a spinlock, which imply we can't sleep or it is a bad thing to sleep/scheduler by ourself.

Based on this, why we need to disable preempt?

Why skip readahead when swap_slot_cache is disabled

commit ba81f83842549871cbd7226fc11530dc464500bb
Author: Huang Ying [email protected]
Date: Wed Feb 22 15:45:46 2017 -0800

mm/swap: skip readahead only when swap slot cache is enabled

Because during swap off, a swap entry may have swap_map[] ==
SWAP_HAS_CACHE (for example, just allocated).  If we return NULL in
__read_swap_cache_async(), the swap off will abort.  So when swap slot
cache is disabled, (for swap off), we will wait for page to be put into
swap cache in such race condition.  This should not be a problem for swap
slot cache, because swap slot cache should be drained after clearing
swap_slot_cache_enabled.

Not get the point yet.

why we need to do swapcache_prepare() in __read_swap_cache_async()?

swapcache_prepare() is used to set SWAP_HAS_CACHE if there is no cache and entry is used.

While I am confused why this could happen? From SWAP_HAS_CACHE point of view, there is only two possibilities: 1. get_swap_page() with SWAP_HAS_CACHE set; 2. get_swap_page_of_type() leave SWAP_HAS_CACHE cleared.

When we get this point, __read_swap_cache_async(), it means we already get an swap entry and looking for it. The comment mentioned "Swap entry may have been freed since our caller observed it."

Why would be have an entry with SWAP_HAS_CACHE cleared at this point?

What's the meaning of PageSwapBacked()

I thought it means this page has backup in swap, like it does in swapin_readahead().

But it seems not, since page_add_new_anon_rmap() would set it too. And even shmem has this set.

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.