• Daniel Black's avatar
    MDEV-25341: innodb buffer pool soft decommit of memory · 16c97187
    Daniel Black authored
    When InnoDB isn't using memory its polite to other system
    processes to allow that memory to be used.
    
    Create buf_page_t::set_os_unused, to madvise(MADV_FREE)/
    DiscardVirtualMemory innodb buffer pool pages to keep
    virtual mapping but allow kernel to reclaim memory.
    
    set_os_unused is called by buf_LRU_block_free_non_file_page
    for flushing deallocations to free up memory.
    
    set_os_used is called by buf_block_t::initialise (used by
    buf_page_create_low and buf_LRU_get_free_only.
    
    Move MSan (memory sanitizer) directive to be associated with
    set_os_{un,}used so that the correctness can be determined by
    instrumentation and test cases rather than relying on OS behaviour
    at specific times.
    
    Remove existing page information poisoning in
    buf_LRU_block_free_non_file_page.
    
    Tested by: Matthias Leich
    Reviewer: Marko Mäkelä
    Windows Review: Vladislav Vaintroub
    16c97187
buf0buf.cc 118 KB