* [akpm-mm:mm-unstable 263/270] mm/memory-tiers.c:769:13: warning: variable 'rc' set but not used
@ 2024-03-31 10:23 kernel test robot
2024-04-01 23:22 ` [External] " Ho-Ren (Jack) Chuang
0 siblings, 1 reply; 2+ messages in thread
From: kernel test robot @ 2024-03-31 10:23 UTC (permalink / raw)
To: Ho-Ren (Jack) Chuang
Cc: oe-kbuild-all, Andrew Morton, Linux Memory Management List,
Hao Xiang, Huang, Ying
tree: https://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm.git mm-unstable
head: 0cef2c0a2a356137b170c3cb46cb9c1dd2ca3e6b
commit: fbc8b54896eef0b4d9aaa793523867c7eb86e788 [263/270] memory tier: create CPUless memory tiers after obtaining HMAT info
config: x86_64-defconfig (https://download.01.org/0day-ci/archive/20240331/202403311826.SNOu8jAt-lkp@intel.com/config)
compiler: gcc-11 (Ubuntu 11.4.0-4ubuntu1) 11.4.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240331/202403311826.SNOu8jAt-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202403311826.SNOu8jAt-lkp@intel.com/
All warnings (new ones prefixed by >>):
mm/memory-tiers.c: In function 'mt_perf_to_adistance':
>> mm/memory-tiers.c:769:13: warning: variable 'rc' set but not used [-Wunused-but-set-variable]
769 | int rc = 0;
| ^~
vim +/rc +769 mm/memory-tiers.c
766
767 int mt_perf_to_adistance(struct access_coordinate *perf, int *adist)
768 {
> 769 int rc = 0;
770
771 mutex_lock(&default_dram_perf_lock);
772 if (default_dram_perf_error) {
773 rc = -EIO;
774 goto out;
775 }
776
777 if (perf->read_latency + perf->write_latency == 0 ||
778 perf->read_bandwidth + perf->write_bandwidth == 0) {
779 rc = -EINVAL;
780 goto out;
781 }
782
783 if (default_dram_perf_ref_nid == NUMA_NO_NODE) {
784 rc = -ENOENT;
785 goto out;
786 }
787 /*
788 * The abstract distance of a memory node is in direct proportion to
789 * its memory latency (read + write) and inversely proportional to its
790 * memory bandwidth (read + write). The abstract distance, memory
791 * latency, and memory bandwidth of the default DRAM nodes are used as
792 * the base.
793 */
794 *adist = MEMTIER_ADISTANCE_DRAM *
795 (perf->read_latency + perf->write_latency) /
796 (default_dram_perf.read_latency + default_dram_perf.write_latency) *
797 (default_dram_perf.read_bandwidth + default_dram_perf.write_bandwidth) /
798 (perf->read_bandwidth + perf->write_bandwidth);
799
800 out:
801 mutex_unlock(&default_dram_perf_lock);
802 return 0;
803 }
804 EXPORT_SYMBOL_GPL(mt_perf_to_adistance);
805
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [External] [akpm-mm:mm-unstable 263/270] mm/memory-tiers.c:769:13: warning: variable 'rc' set but not used
2024-03-31 10:23 [akpm-mm:mm-unstable 263/270] mm/memory-tiers.c:769:13: warning: variable 'rc' set but not used kernel test robot
@ 2024-04-01 23:22 ` Ho-Ren (Jack) Chuang
0 siblings, 0 replies; 2+ messages in thread
From: Ho-Ren (Jack) Chuang @ 2024-04-01 23:22 UTC (permalink / raw)
To: kernel test robot
Cc: oe-kbuild-all, Andrew Morton, Linux Memory Management List,
Hao Xiang, Huang, Ying
Will fix it in V10. Thanks,
On Sun, Mar 31, 2024 at 3:23 AM kernel test robot <lkp@intel.com> wrote:
>
> tree: https://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm.git mm-unstable
> head: 0cef2c0a2a356137b170c3cb46cb9c1dd2ca3e6b
> commit: fbc8b54896eef0b4d9aaa793523867c7eb86e788 [263/270] memory tier: create CPUless memory tiers after obtaining HMAT info
> config: x86_64-defconfig (https://download.01.org/0day-ci/archive/20240331/202403311826.SNOu8jAt-lkp@intel.com/config)
> compiler: gcc-11 (Ubuntu 11.4.0-4ubuntu1) 11.4.0
> reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240331/202403311826.SNOu8jAt-lkp@intel.com/reproduce)
>
> If you fix the issue in a separate patch/commit (i.e. not just a new version of
> the same patch/commit), kindly add following tags
> | Reported-by: kernel test robot <lkp@intel.com>
> | Closes: https://lore.kernel.org/oe-kbuild-all/202403311826.SNOu8jAt-lkp@intel.com/
>
> All warnings (new ones prefixed by >>):
>
> mm/memory-tiers.c: In function 'mt_perf_to_adistance':
> >> mm/memory-tiers.c:769:13: warning: variable 'rc' set but not used [-Wunused-but-set-variable]
> 769 | int rc = 0;
> | ^~
>
>
> vim +/rc +769 mm/memory-tiers.c
>
> 766
> 767 int mt_perf_to_adistance(struct access_coordinate *perf, int *adist)
> 768 {
> > 769 int rc = 0;
> 770
> 771 mutex_lock(&default_dram_perf_lock);
> 772 if (default_dram_perf_error) {
> 773 rc = -EIO;
> 774 goto out;
> 775 }
> 776
> 777 if (perf->read_latency + perf->write_latency == 0 ||
> 778 perf->read_bandwidth + perf->write_bandwidth == 0) {
> 779 rc = -EINVAL;
> 780 goto out;
> 781 }
> 782
> 783 if (default_dram_perf_ref_nid == NUMA_NO_NODE) {
> 784 rc = -ENOENT;
> 785 goto out;
> 786 }
> 787 /*
> 788 * The abstract distance of a memory node is in direct proportion to
> 789 * its memory latency (read + write) and inversely proportional to its
> 790 * memory bandwidth (read + write). The abstract distance, memory
> 791 * latency, and memory bandwidth of the default DRAM nodes are used as
> 792 * the base.
> 793 */
> 794 *adist = MEMTIER_ADISTANCE_DRAM *
> 795 (perf->read_latency + perf->write_latency) /
> 796 (default_dram_perf.read_latency + default_dram_perf.write_latency) *
> 797 (default_dram_perf.read_bandwidth + default_dram_perf.write_bandwidth) /
> 798 (perf->read_bandwidth + perf->write_bandwidth);
> 799
> 800 out:
> 801 mutex_unlock(&default_dram_perf_lock);
> 802 return 0;
> 803 }
> 804 EXPORT_SYMBOL_GPL(mt_perf_to_adistance);
> 805
>
> --
> 0-DAY CI Kernel Test Service
> https://github.com/intel/lkp-tests/wiki
--
Best regards,
Ho-Ren (Jack) Chuang
莊賀任
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-04-01 23:23 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-03-31 10:23 [akpm-mm:mm-unstable 263/270] mm/memory-tiers.c:769:13: warning: variable 'rc' set but not used kernel test robot
2024-04-01 23:22 ` [External] " Ho-Ren (Jack) Chuang
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox