CC: [email protected]
CC: [email protected]
CC: [email protected]
TO: Mel Gorman <[email protected]>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/mel/linux.git 
mm-reclaimcongest-v1r4
head:   07285068a0f1fb7bee052bf5a4b71c4d8d4b2f77
commit: a7f2d5fd13a3022b3906b6f849998b726fa3eb83 [1/5] mm/vmscan: Throttle 
reclaim until some writeback completes if congested
:::::: branch date: 7 weeks ago
:::::: commit date: 7 weeks ago
config: x86_64-randconfig-c007-20210927 (attached as .config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project 
dc6e8dfdfe7efecfda318d43a06fae18b40eb498)
reproduce (this is a W=1 build):
        wget 
https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O 
~/bin/make.cross
        chmod +x ~/bin/make.cross
        # 
https://git.kernel.org/pub/scm/linux/kernel/git/mel/linux.git/commit/?id=a7f2d5fd13a3022b3906b6f849998b726fa3eb83
        git remote add mel 
https://git.kernel.org/pub/scm/linux/kernel/git/mel/linux.git
        git fetch --no-tags mel mm-reclaimcongest-v1r4
        git checkout a7f2d5fd13a3022b3906b6f849998b726fa3eb83
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64 
clang-analyzer 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <[email protected]>


clang-analyzer warnings: (new ones prefixed by >>)
   #define ch_map_key_clear(c)     hid_map_usage_clear(hi, usage, bit, max, \
                                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/hid.h:1035:2: note: Calling 'hid_map_usage'
           hid_map_usage(hidinput, usage, bit, max, type, c);
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/hid.h:982:2: note: 'input' initialized here
           struct input_dev *input = hidinput->input;
           ^~~~~~~~~~~~~~~~~~~~~~~
   include/linux/hid.h:986:2: note: Control jumps to 'case 1:'  at line 995
           switch (type) {
           ^
   include/linux/hid.h:998:3: note:  Execution continues on line 1005
                   break;
                   ^
   include/linux/hid.h:1005:15: note: 'c' is <= 'limit'
           if (unlikely(c > limit || !bmap)) {
                        ^
   include/linux/compiler.h:78:42: note: expanded from macro 'unlikely'
   # define unlikely(x)    __builtin_expect(!!(x), 0)
                                               ^
   include/linux/hid.h:1005:15: note: Left side of '||' is false
           if (unlikely(c > limit || !bmap)) {
                        ^
   include/linux/hid.h:1005:28: note: Assuming 'bmap' is null
           if (unlikely(c > limit || !bmap)) {
                                     ^
   include/linux/compiler.h:78:42: note: expanded from macro 'unlikely'
   # define unlikely(x)    __builtin_expect(!!(x), 0)
                                               ^
   include/linux/hid.h:1005:28: note: Assuming pointer value is null
           if (unlikely(c > limit || !bmap)) {
                                     ^
   include/linux/compiler.h:78:42: note: expanded from macro 'unlikely'
   # define unlikely(x)    __builtin_expect(!!(x), 0)
                                               ^
   include/linux/hid.h:1005:2: note: Taking true branch
           if (unlikely(c > limit || !bmap)) {
           ^
   include/linux/hid.h:1006:3: note: Assuming the condition is true
                   pr_warn_ratelimited("%s: Invalid code %d type %d\n",
                   ^
   include/linux/printk.h:656:2: note: expanded from macro 'pr_warn_ratelimited'
           printk_ratelimited(KERN_WARNING pr_fmt(fmt), ##__VA_ARGS__)
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/printk.h:639:6: note: expanded from macro 'printk_ratelimited'
           if (__ratelimit(&_rs))                                          \
               ^~~~~~~~~~~~~~~~~
   include/linux/ratelimit_types.h:41:28: note: expanded from macro 
'__ratelimit'
   #define __ratelimit(state) ___ratelimit(state, __func__)
                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/hid.h:1006:3: note: Taking true branch
                   pr_warn_ratelimited("%s: Invalid code %d type %d\n",
                   ^
   include/linux/printk.h:656:2: note: expanded from macro 'pr_warn_ratelimited'
           printk_ratelimited(KERN_WARNING pr_fmt(fmt), ##__VA_ARGS__)
           ^
   include/linux/printk.h:639:2: note: expanded from macro 'printk_ratelimited'
           if (__ratelimit(&_rs))                                          \
           ^
   include/linux/hid.h:1006:3: note: Loop condition is false.  Exiting loop
                   pr_warn_ratelimited("%s: Invalid code %d type %d\n",
                   ^
   include/linux/printk.h:656:2: note: expanded from macro 'pr_warn_ratelimited'
           printk_ratelimited(KERN_WARNING pr_fmt(fmt), ##__VA_ARGS__)
           ^
   include/linux/printk.h:640:3: note: expanded from macro 'printk_ratelimited'
                   printk(fmt, ##__VA_ARGS__);                             \
                   ^
   include/linux/printk.h:446:26: note: expanded from macro 'printk'
   #define printk(fmt, ...) printk_index_wrap(_printk, fmt, ##__VA_ARGS__)
                            ^
   include/linux/printk.h:417:3: note: expanded from macro 'printk_index_wrap'
                   __printk_index_emit(_fmt, NULL, NULL);                  \
                   ^
   include/linux/printk.h:392:34: note: expanded from macro 
'__printk_index_emit'
   #define __printk_index_emit(...) do {} while (0)
                                    ^
   include/linux/hid.h:1007:9: note: Access to field 'name' results in a 
dereference of a null pointer (loaded from variable 'input')
                                       input->name, c, type);
                                       ^
   include/linux/printk.h:656:49: note: expanded from macro 
'pr_warn_ratelimited'
           printk_ratelimited(KERN_WARNING pr_fmt(fmt), ##__VA_ARGS__)
                                                          ^~~~~~~~~~~
   include/linux/printk.h:640:17: note: expanded from macro 'printk_ratelimited'
                   printk(fmt, ##__VA_ARGS__);                             \
                                 ^~~~~~~~~~~
   include/linux/printk.h:446:60: note: expanded from macro 'printk'
   #define printk(fmt, ...) printk_index_wrap(_printk, fmt, ##__VA_ARGS__)
                                                              ^~~~~~~~~~~
   include/linux/printk.h:418:19: note: expanded from macro 'printk_index_wrap'
                   _p_func(_fmt, ##__VA_ARGS__);                           \
                                   ^~~~~~~~~~~
   1 warning generated.
   mm/oom_kill.c:258:17: warning: Value stored to 'highest_zoneidx' during its 
initialization is never read [clang-analyzer-deadcode.DeadStores]
           enum zone_type highest_zoneidx = gfp_zone(oc->gfp_mask);
                          ^~~~~~~~~~~~~~~   ~~~~~~~~~~~~~~~~~~~~~~
   mm/oom_kill.c:258:17: note: Value stored to 'highest_zoneidx' during its 
initialization is never read
           enum zone_type highest_zoneidx = gfp_zone(oc->gfp_mask);
                          ^~~~~~~~~~~~~~~   ~~~~~~~~~~~~~~~~~~~~~~
   4 warnings generated.
>> mm/vmscan.c:1023:2: warning: Value stored to 'ret' is never read 
>> [clang-analyzer-deadcode.DeadStores]
           ret = schedule_timeout(timeout);
           ^     ~~~~~~~~~~~~~~~~~~~~~~~~~
   mm/vmscan.c:1023:2: note: Value stored to 'ret' is never read
           ret = schedule_timeout(timeout);
           ^     ~~~~~~~~~~~~~~~~~~~~~~~~~
   mm/vmscan.c:1390:2: warning: Value stored to 'err' is never read 
[clang-analyzer-deadcode.DeadStores]
           err = migrate_pages(demote_pages, alloc_demote_page, NULL,
           ^     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   mm/vmscan.c:1390:2: note: Value stored to 'err' is never read
           err = migrate_pages(demote_pages, alloc_demote_page, NULL,
           ^     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   Suppressed 2 warnings (2 with check filters).
   1 warning generated.
   mm/shmem.c:1362:2: warning: Value stored to 'index' is never read 
[clang-analyzer-deadcode.DeadStores]
           index = page->index;
           ^       ~~~~~~~~~~~
   mm/shmem.c:1362:2: note: Value stored to 'index' is never read
           index = page->index;
           ^       ~~~~~~~~~~~
   1 warning generated.
   Suppressed 1 warnings (1 with check filters).
   6 warnings generated.
   Suppressed 6 warnings (6 in non-user code).
   Use -header-filter=.* to display errors from all non-system headers. Use 
-system-headers to display errors from system headers as well.
   2 warnings generated.
   drivers/hwmon/acpi_power_meter.c:882:2: warning: Call to function 'strcpy' 
is insecure as it does not provide bounding of the memory buffer. Replace 
unbounded copy functions with analogous functions that support length arguments 
such as 'strlcpy'. CWE-119 [clang-analyzer-security.insecureAPI.strcpy]
           strcpy(acpi_device_name(device), ACPI_POWER_METER_DEVICE_NAME);
           ^~~~~~
   drivers/hwmon/acpi_power_meter.c:882:2: note: Call to function 'strcpy' is 
insecure as it does not provide bounding of the memory buffer. Replace 
unbounded copy functions with analogous functions that support length arguments 
such as 'strlcpy'. CWE-119
           strcpy(acpi_device_name(device), ACPI_POWER_METER_DEVICE_NAME);
           ^~~~~~
   drivers/hwmon/acpi_power_meter.c:883:2: warning: Call to function 'strcpy' 
is insecure as it does not provide bounding of the memory buffer. Replace 
unbounded copy functions with analogous functions that support length arguments 
such as 'strlcpy'. CWE-119 [clang-analyzer-security.insecureAPI.strcpy]
           strcpy(acpi_device_class(device), ACPI_POWER_METER_CLASS);
           ^~~~~~
   drivers/hwmon/acpi_power_meter.c:883:2: note: Call to function 'strcpy' is 
insecure as it does not provide bounding of the memory buffer. Replace 
unbounded copy functions with analogous functions that support length arguments 
such as 'strlcpy'. CWE-119
           strcpy(acpi_device_class(device), ACPI_POWER_METER_CLASS);
           ^~~~~~
   3 warnings generated.
   drivers/hwmon/asus_atk0110.c:647:24: warning: Assigned value is garbage or 
undefined [clang-analyzer-core.uninitialized.Assign]
                   sensor->cached_value = *value;
                                        ^
   drivers/hwmon/asus_atk0110.c:219:30: note: Left side of '&&' is false
           struct atk_sensor_data *s = input_to_atk_sensor(attr);
                                       ^
   drivers/hwmon/asus_atk0110.c:205:2: note: expanded from macro 
'input_to_atk_sensor'
           container_of(attr, struct atk_sensor_data, input_attr)
           ^
   include/linux/kernel.h:495:61: note: expanded from macro 'container_of'
           BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) &&   \
                                                                      ^
   drivers/hwmon/asus_atk0110.c:219:30: note: Taking false branch
           struct atk_sensor_data *s = input_to_atk_sensor(attr);
                                       ^
   drivers/hwmon/asus_atk0110.c:205:2: note: expanded from macro 
'input_to_atk_sensor'
           container_of(attr, struct atk_sensor_data, input_attr)
           ^
   include/linux/kernel.h:495:2: note: expanded from macro 'container_of'
           BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) &&   \
           ^
   include/linux/build_bug.h:39:37: note: expanded from macro 'BUILD_BUG_ON_MSG'
   #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
                                       ^
   include/linux/compiler_types.h:322:2: note: expanded from macro 
'compiletime_assert'
           _compiletime_assert(condition, msg, __compiletime_assert_, 
__COUNTER__)
           ^
   include/linux/compiler_types.h:310:2: note: expanded from macro 
'_compiletime_assert'
           __compiletime_assert(condition, msg, prefix, suffix)
           ^
   include/linux/compiler_types.h:302:3: note: expanded from macro 
'__compiletime_assert'
                   if (!(condition))                                       \
                   ^
   drivers/hwmon/asus_atk0110.c:219:30: note: Loop condition is false.  Exiting 
loop
           struct atk_sensor_data *s = input_to_atk_sensor(attr);
                                       ^
   drivers/hwmon/asus_atk0110.c:205:2: note: expanded from macro 
'input_to_atk_sensor'
           container_of(attr, struct atk_sensor_data, input_attr)
           ^
   include/linux/kernel.h:495:2: note: expanded from macro 'container_of'
           BUILD_BUG_ON_MSG(!__same_type(*(ptr), ((type *)0)->member) &&   \
           ^
   include/linux/build_bug.h:39:37: note: expanded from macro 'BUILD_BUG_ON_MSG'
   #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
                                       ^
   include/linux/compiler_types.h:322:2: note: expanded from macro 
'compiletime_assert'
           _compiletime_assert(condition, msg, __compiletime_assert_, 
__COUNTER__)
           ^
   include/linux/compiler_types.h:310:2: note: expanded from macro 
'_compiletime_assert'
           __compiletime_assert(condition, msg, prefix, suffix)
           ^
   include/linux/compiler_types.h:300:2: note: expanded from macro 
'__compiletime_assert'
           do {                                                            \
           ^
   drivers/hwmon/asus_atk0110.c:220:2: note: 'value' declared without an 
initial value
           u64 value;
           ^~~~~~~~~
   drivers/hwmon/asus_atk0110.c:223:8: note: Calling 'atk_read_value'
           err = atk_read_value(s, &value);
                 ^~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/hwmon/asus_atk0110.c:635:6: note: Assuming field 'is_valid' is false
           if (!sensor->is_valid ||

vim +/ret +1023 mm/vmscan.c

^1da177e4c3f41 Linus Torvalds 2005-04-16  1008  
a7f2d5fd13a302 Mel Gorman     2021-09-15  1009  static void
a7f2d5fd13a302 Mel Gorman     2021-09-15  1010  reclaim_throttle(pg_data_t 
*pgdat, enum vmscan_throttle_state reason,
a7f2d5fd13a302 Mel Gorman     2021-09-15  1011                                  
                        long timeout)
a7f2d5fd13a302 Mel Gorman     2021-09-15  1012  {
a7f2d5fd13a302 Mel Gorman     2021-09-15  1013          wait_queue_head_t *wqh 
= &pgdat->reclaim_wait;
a7f2d5fd13a302 Mel Gorman     2021-09-15  1014          unsigned long start = 
jiffies;
a7f2d5fd13a302 Mel Gorman     2021-09-15  1015          long ret;
a7f2d5fd13a302 Mel Gorman     2021-09-15  1016          DEFINE_WAIT(wait);
a7f2d5fd13a302 Mel Gorman     2021-09-15  1017  
a7f2d5fd13a302 Mel Gorman     2021-09-15  1018          
atomic_inc(&pgdat->nr_reclaim_throttled);
a7f2d5fd13a302 Mel Gorman     2021-09-15  1019          
WRITE_ONCE(pgdat->nr_reclaim_start,
a7f2d5fd13a302 Mel Gorman     2021-09-15  1020                   
node_page_state(pgdat, NR_THROTTLED_WRITTEN));
a7f2d5fd13a302 Mel Gorman     2021-09-15  1021  
a7f2d5fd13a302 Mel Gorman     2021-09-15  1022          prepare_to_wait(wqh, 
&wait, TASK_INTERRUPTIBLE);
a7f2d5fd13a302 Mel Gorman     2021-09-15 @1023          ret = 
schedule_timeout(timeout);
a7f2d5fd13a302 Mel Gorman     2021-09-15  1024          finish_wait(wqh, &wait);
a7f2d5fd13a302 Mel Gorman     2021-09-15  1025          
atomic_dec(&pgdat->nr_reclaim_throttled);
a7f2d5fd13a302 Mel Gorman     2021-09-15  1026  
a7f2d5fd13a302 Mel Gorman     2021-09-15  1027          
trace_mm_vmscan_throttled(pgdat->node_id, jiffies_to_usecs(timeout),
a7f2d5fd13a302 Mel Gorman     2021-09-15  1028                                  
jiffies_to_usecs(jiffies - start),
a7f2d5fd13a302 Mel Gorman     2021-09-15  1029                                  
reason);
a7f2d5fd13a302 Mel Gorman     2021-09-15  1030  }
a7f2d5fd13a302 Mel Gorman     2021-09-15  1031  

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/[email protected]

Attachment: .config.gz
Description: application/gzip

_______________________________________________
kbuild mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to