Commit a530bbc5 authored by Huang Ying's avatar Huang Ying Committed by Andrew Morton

memory tiers: use default_dram_perf_ref_source in log message

Commit 3718c02d ("acpi, hmat: calculate abstract distance with HMAT")
added a default_dram_perf_ref_source variable that was initialized but
never used.  This causes kmemleak to report the following memory leak:

unreferenced object 0xff11000225a47b60 (size 16):
  comm "swapper/0", pid 1, jiffies 4294761654
  hex dump (first 16 bytes):
    41 43 50 49 20 48 4d 41 54 00 c1 4b 7d b7 75 7c  ACPI HMAT..K}.u|
  backtrace (crc e6d0e7b2):
    [<ffffffff95d5afdb>] __kmalloc_node_track_caller_noprof+0x36b/0x440
    [<ffffffff95c276d6>] kstrdup+0x36/0x60
    [<ffffffff95dfabfa>] mt_set_default_dram_perf+0x23a/0x2c0
    [<ffffffff9ad64733>] hmat_init+0x2b3/0x660
    [<ffffffff95203cec>] do_one_initcall+0x11c/0x5c0
    [<ffffffff9ac9cfc4>] do_initcalls+0x1b4/0x1f0
    [<ffffffff9ac9d52e>] kernel_init_freeable+0x4ae/0x520
    [<ffffffff97c789cc>] kernel_init+0x1c/0x150
    [<ffffffff952aecd1>] ret_from_fork+0x31/0x70
    [<ffffffff9520b18a>] ret_from_fork_asm+0x1a/0x30

This reminds us that we forget to use the performance data source
information.  So, use the variable in the error log message to help
identify the root cause of inconsistent performance number.

Link: https://lkml.kernel.org/r/87y13mvo0n.fsf@yhuang6-desk2.ccr.corp.intel.com
Fixes: 3718c02d ("acpi, hmat: calculate abstract distance with HMAT")
Signed-off-by: default avatar"Huang, Ying" <ying.huang@intel.com>
Reported-by: default avatarWaiman Long <longman@redhat.com>
Acked-by: default avatarWaiman Long <longman@redhat.com>
Cc: Alistair Popple <apopple@nvidia.com>
Cc: Dave Jiang <dave.jiang@intel.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
parent c509f67d
...@@ -768,10 +768,10 @@ int mt_set_default_dram_perf(int nid, struct access_coordinate *perf, ...@@ -768,10 +768,10 @@ int mt_set_default_dram_perf(int nid, struct access_coordinate *perf,
pr_info( pr_info(
"memory-tiers: the performance of DRAM node %d mismatches that of the reference\n" "memory-tiers: the performance of DRAM node %d mismatches that of the reference\n"
"DRAM node %d.\n", nid, default_dram_perf_ref_nid); "DRAM node %d.\n", nid, default_dram_perf_ref_nid);
pr_info(" performance of reference DRAM node %d:\n", pr_info(" performance of reference DRAM node %d from %s:\n",
default_dram_perf_ref_nid); default_dram_perf_ref_nid, default_dram_perf_ref_source);
dump_hmem_attrs(&default_dram_perf, " "); dump_hmem_attrs(&default_dram_perf, " ");
pr_info(" performance of DRAM node %d:\n", nid); pr_info(" performance of DRAM node %d from %s:\n", nid, source);
dump_hmem_attrs(perf, " "); dump_hmem_attrs(perf, " ");
pr_info( pr_info(
" disable default DRAM node performance based abstract distance algorithm.\n"); " disable default DRAM node performance based abstract distance algorithm.\n");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment