14 Matching Annotations
  1. Oct 2024
    1. Please include text about each experiment called for in this section, and include any graphs, tables or other data to make your point clearly and concisely. As always, report your experimental platform. You should find out what kind of CPU you have, its level 1 data cache capacity and associativity, and its data TLB capacity and associativity. Does your TLB have a second level? If so, describe it. Put all this information about your hardware in your report.

      More enviroment

    1. #define ZSWAP_NR_ZPOOLS 32

      More configuration policy, as per the comment, this is an empirical number.

    2. static unsigned int zswap_max_pool_percent = 20;

      maximum percentage of memory that the compresses pool can occupy

    3. static bool zswap_enabled = IS_ENABLED(CONFIG_ZSWAP_DEFAULT_ON);

      Since zswap will be part of decisions on the swap flow the this config is policy.

    1. if (!chunk->isolated && chunk->free_bytes == pcpu_unit_size) { struct pcpu_chunk *pos; list_for_each_entry(pos, &pcpu_chunk_lists[pcpu_free_slot], list) if (pos != chunk) { need_balance = true; break; } } else if (pcpu_should_reclaim_chunk(chunk)) { pcpu_isolate_chunk(chunk); need_balance = true; }

      When freeing memory determine whether to balance or not.

    2. static void pcpu_balance_workfn(struct work_struct *work)

      Manage free chunks and populated pages. It does so by first reclaiming all fully free chunks regardless of the number of populated pages. Then rebalancing and finally cleaning.

    3. if (freed_page_start < freed_page_end) {

      Batching TLB flushes to amortize cost. The threashold is also a heuristic.

    4. int __init pcpu_page_first_chunk(size_t reserved_size, pcpu_fc_cpu_to_node_fn_t cpu_to_nd_fn)

      Static allocation policy is used here for the first chunk per cpu.

    5. if (pcpu_nr_empty_pop_pages < PCPU_EMPTY_POP_PAGES_HIGH) { reintegrate = true; break; }

      Heuristic to stop reclaiming if empty fall below threshold that would cause atomic alloc failures.

    6. static void pcpu_balance_populated(void)

      Maintain a certain amount of populated pages to satisfy atomic allocations.

    7. if (pcpu_nr_empty_pop_pages < PCPU_EMPTY_POP_PAGES_LOW)

      Heuristic to determine when to rebalance when allocating pages. If the number of pages are below the PCPU_EMPTY_POP_PAGES_LOW threashold then rebalancer is called.

    8. if (!pcpu_check_block_hint(chunk_md, alloc_bits, align))

      As the comment said this is a heuristic to stop finding chunks when true.

    9. static void pcpu_block_update_hint_free(struct pcpu_chunk *chunk, int bit_off, int bits)

      Update metadate hints (for policy).

    10. if (contig == block->contig_hint) { if (block->contig_hint_start && (!start || __ffs(start) > __ffs(block->contig_hint_start))) { /* start has a better alignment so use it */ block->contig_hint_start = start; if (start < block->scan_hint_start && block->contig_hint > block->scan_hint) block->scan_hint = 0; } else if (start > block->scan_hint_start || block->contig_hint > block->scan_hint) { /* * Knowing contig == contig_hint, update the scan_hint * if it is farther than or larger than the current * scan_hint. */ block->scan_hint_start = start; block->scan_hint = contig; }

      Heuristic when contig hints are equal to choose the "best" starting offset.