• Huang Ying's avatar
    cacheinfo: calculate size of per-CPU data cache slice · 94a3bfe4
    Huang Ying authored
    This can be used to estimate the size of the data cache slice that can be
    used by one CPU under ideal circumstances.  Both DATA caches and UNIFIED
    caches are used in calculation.  So, the users need to consider the impact
    of the code cache usage.
    
    Because the cache inclusive/non-inclusive information isn't available now,
    we just use the size of the per-CPU slice of LLC to make the result more
    predictable across architectures.  This may be improved when more cache
    information is available in the future.
    
    A brute-force algorithm to iterate all online CPUs is used to avoid to
    allocate an extra cpumask, especially in offline callback.
    
    Link: https://lkml.kernel.org/r/20231016053002.756205-3-ying.huang@intel.comSigned-off-by: default avatar"Huang, Ying" <ying.huang@intel.com>
    Acked-by: default avatarMel Gorman <mgorman@techsingularity.net>
    Cc: Sudeep Holla <sudeep.holla@arm.com>
    Cc: Vlastimil Babka <vbabka@suse.cz>
    Cc: David Hildenbrand <david@redhat.com>
    Cc: Johannes Weiner <jweiner@redhat.com>
    Cc: Dave Hansen <dave.hansen@linux.intel.com>
    Cc: Michal Hocko <mhocko@suse.com>
    Cc: Pavel Tatashin <pasha.tatashin@soleen.com>
    Cc: Matthew Wilcox <willy@infradead.org>
    Cc: Christoph Lameter <cl@linux.com>
    Cc: Arjan van de Ven <arjan@linux.intel.com>
    Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
    94a3bfe4
cacheinfo.c 24.4 KB