Uploaded image for project: 'Lustre'
  1. Lustre
  2. LU-21064

osc: max_cached_mb LRU counts one slot per cl_page, undercounts large folios

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Medium Medium
    • None
    • None
    • None
    • 3
    • 9223372036854775807

      The client osc LRU (max_cached_mb, osc_lru_alloc(), osc_lru_del(), osc_lru_add_batch(), osc_lru_shrink() in lustre/osc/osc_page.c) accounts one slot per cl_page. With large folio support (LU-19895, https://review.whamcloud.com/65094) one cl_page can cover a folio of many base pages (cp_npgs), so a large folio takes a single LRU slot whatever its size. Cached base pages can then exceed max_cached_mb by up to the folio size per page, for written folios as well as readahead folios (readahead ra_cur_pages is already accounted in base pages and returns folio_nr_pages() on read completion).

      The fix is to count LRU slots in base pages (cp_npgs) in all the osc LRU counters and in the LRU shrink/reclaim paths, with tests that fill max_cached_mb using large folios.

      Found while reviewing change 65094 (thread on lustre/llite/rw.c, readahead folio accounting), where Andreas Dilger asked for this as a follow-on to that patch.

            wc-triage WC Triage
            patrickbot Patrick Bot
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: