Subject: Re: [PATCH V11 1/5] mm/hotplug: Introduce arch callback validating the hot remove range

From: kbuild test robot <[email-masked]>
Date: Sun, 12 Jan 2020 03:49:23 +0800

Hi Anshuman,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on linus/master]
[also build test ERROR on v5.5-rc5 next-20200109]
[cannot apply to arm64/for-next/core robh/for-next linux/master]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]

url:    https://github.com/0day-ci/linux/commits/Anshuman-Khandual/arm64-mm-Enable-memory-hot-remove/20200111-003854
base:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 4a3033ef6e6bb4c566bd1d556de69b494d76976c
config: x86_64-randconfig-s1-20200111 (attached as .config)
compiler: gcc-4.9 (Debian 4.9.2-10+deb8u1) 4.9.2
reproduce:
        # save the attached .config to linux build tree
        make ARCH=x86_64 

If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <[email-masked]>

All errors (new ones prefixed by >>):

   mm/memory_hotplug.c: In function 'check_hotremove_memory_range':
>> mm/memory_hotplug.c:1027:2: error: implicit declaration of function 'arch_memory_removable' [-Werror=implicit-function-declaration]
     rc = arch_memory_removable(start, size);
     ^
   mm/memory_hotplug.c: At top level:
   mm/memory_hotplug.c:1017:12: warning: 'check_hotremove_memory_range' defined but not used [-Wunused-function]
    static int check_hotremove_memory_range(u64 start, u64 size)
               ^
   Cyclomatic Complexity 5 include/linux/compiler.h:__read_once_size
   Cyclomatic Complexity 5 include/linux/compiler.h:__write_once_size
   Cyclomatic Complexity 2 arch/x86/include/asm/bitops.h:arch_set_bit
   Cyclomatic Complexity 2 arch/x86/include/asm/bitops.h:arch_clear_bit
   Cyclomatic Complexity 1 arch/x86/include/asm/bitops.h:fls64
   Cyclomatic Complexity 1 include/linux/log2.h:__ilog2_u64
   Cyclomatic Complexity 1 include/linux/list.h:INIT_LIST_HEAD
   Cyclomatic Complexity 1 include/linux/percpu-defs.h:__this_cpu_preempt_check
   Cyclomatic Complexity 1 arch/x86/include/asm/atomic.h:arch_atomic_read
   Cyclomatic Complexity 1 arch/x86/include/asm/atomic.h:arch_atomic_set
   Cyclomatic Complexity 1 arch/x86/include/asm/atomic.h:arch_atomic_inc
   Cyclomatic Complexity 1 arch/x86/include/asm/atomic.h:arch_atomic_add_return
   Cyclomatic Complexity 1 arch/x86/include/asm/atomic.h:arch_atomic_sub_return
   Cyclomatic Complexity 1 arch/x86/include/asm/atomic64_64.h:arch_atomic64_add
   Cyclomatic Complexity 2 include/linux/jump_label.h:static_key_false
   Cyclomatic Complexity 3 include/linux/string.h:memset
   Cyclomatic Complexity 1 include/linux/err.h:ERR_PTR
   Cyclomatic Complexity 1 include/linux/err.h:PTR_ERR
   Cyclomatic Complexity 5 arch/x86/include/asm/preempt.h:__preempt_count_add
   Cyclomatic Complexity 5 arch/x86/include/asm/preempt.h:__preempt_count_sub
   Cyclomatic Complexity 1 include/linux/spinlock.h:spinlock_check
   Cyclomatic Complexity 1 include/linux/spinlock.h:spin_lock
   Cyclomatic Complexity 1 include/linux/spinlock.h:spin_unlock
   Cyclomatic Complexity 1 include/linux/spinlock.h:spin_unlock_irqrestore
   Cyclomatic Complexity 1 include/linux/seqlock.h:raw_write_seqcount_begin
   Cyclomatic Complexity 1 include/linux/seqlock.h:raw_write_seqcount_end
   Cyclomatic Complexity 1 include/linux/nodemask.h:node_state
   Cyclomatic Complexity 1 include/linux/nodemask.h:node_set_state
   Cyclomatic Complexity 2 include/linux/notifier.h:notifier_to_errno
   Cyclomatic Complexity 1 include/linux/page-flags.h:ClearPageReserved
   Cyclomatic Complexity 1 include/linux/page-flags.h:SetPagePrivate
   Cyclomatic Complexity 1 include/linux/page-flags.h:ClearPagePrivate
   Cyclomatic Complexity 1 include/linux/mmzone.h:zone_end_pfn
   Cyclomatic Complexity 1 include/linux/mmzone.h:zone_is_empty
   Cyclomatic Complexity 4 include/linux/mmzone.h:zone_intersects
   Cyclomatic Complexity 1 include/linux/mmzone.h:pgdat_end_pfn
   Cyclomatic Complexity 1 include/linux/memory_hotplug.h:generic_free_nodedata
   Cyclomatic Complexity 1 include/linux/memory_hotplug.h:arch_refresh_nodedata
   Cyclomatic Complexity 1 include/linux/memory_hotplug.h:pgdat_resize_unlock
   Cyclomatic Complexity 1 include/linux/mmzone.h:populated_zone
   Cyclomatic Complexity 1 include/linux/mmzone.h:zone_to_nid
   Cyclomatic Complexity 1 include/linux/mmzone.h:pfn_to_section_nr
   Cyclomatic Complexity 3 include/linux/mmzone.h:__nr_to_section
   Cyclomatic Complexity 1 include/linux/mmzone.h:__section_mem_map_addr
   Cyclomatic Complexity 3 include/linux/mmzone.h:valid_section
   Cyclomatic Complexity 3 include/linux/mmzone.h:online_section
   Cyclomatic Complexity 1 include/linux/mmzone.h:online_section_nr
   Cyclomatic Complexity 1 include/linux/mmzone.h:__pfn_to_section
   Cyclomatic Complexity 1 include/linux/ioport.h:resource_size
   Cyclomatic Complexity 1 include/linux/memremap.h:vmem_altmap_offset
   Cyclomatic Complexity 1 include/linux/mm.h:page_zonenum
   Cyclomatic Complexity 1 include/linux/mm.h:page_zone
   Cyclomatic Complexity 1 include/linux/node.h:link_mem_sections
   Cyclomatic Complexity 1 include/linux/node.h:__register_one_node
   Cyclomatic Complexity 1 include/linux/node.h:register_one_node
   Cyclomatic Complexity 1 include/linux/cpu.h:cpus_read_lock
   Cyclomatic Complexity 1 include/linux/cpu.h:cpus_read_unlock
   Cyclomatic Complexity 1 include/linux/compaction.h:kcompactd_run
   Cyclomatic Complexity 6 mm/memory_hotplug.c:update_pgdat_span
   Cyclomatic Complexity 4 mm/memory_hotplug.c:node_states_check_changes_online
   Cyclomatic Complexity 4 mm/memory_hotplug.c:node_states_set_node
   Cyclomatic Complexity 3 mm/memory_hotplug.c:resize_zone_range
   Cyclomatic Complexity 3 mm/memory_hotplug.c:resize_pgdat_range
   Cyclomatic Complexity 3 mm/memory_hotplug.c:default_kernel_zone_for_pfn
   Cyclomatic Complexity 4 mm/memory_hotplug.c:default_zone_for_pfn
   Cyclomatic Complexity 2 mm/memory_hotplug.c:reset_node_present_pages
   Cyclomatic Complexity 1 include/linux/seqlock.h:write_seqcount_begin_nested
   Cyclomatic Complexity 1 include/linux/seqlock.h:write_seqcount_begin
   Cyclomatic Complexity 1 include/linux/seqlock.h:write_seqlock
   Cyclomatic Complexity 1 include/linux/memory_hotplug.h:zone_span_writelock
   Cyclomatic Complexity 8 mm/memory_hotplug.c:find_smallest_section_pfn
   Cyclomatic Complexity 8 mm/memory_hotplug.c:find_biggest_section_pfn
   Cyclomatic Complexity 1 include/linux/err.h:IS_ERR
   Cyclomatic Complexity 69 include/asm-generic/getorder.h:get_order
   Cyclomatic Complexity 4 include/linux/rcu_sync.h:rcu_sync_is_idle
   Cyclomatic Complexity 2 include/linux/percpu-rwsem.h:percpu_down_read
   Cyclomatic Complexity 2 include/linux/percpu-rwsem.h:percpu_up_read
   Cyclomatic Complexity 1 include/linux/seqlock.h:write_seqcount_end
   Cyclomatic Complexity 1 include/linux/seqlock.h:write_sequnlock
   Cyclomatic Complexity 1 include/linux/memory_hotplug.h:zone_span_writeunlock
   Cyclomatic Complexity 11 mm/memory_hotplug.c:shrink_zone_span
   Cyclomatic Complexity 3 mm/memory_hotplug.c:setup_memhp_default_state
   Cyclomatic Complexity 1 include/asm-generic/bitops/instrumented-atomic.h:set_bit
   Cyclomatic Complexity 1 include/asm-generic/atomic-instrumented.h:atomic_inc
   Cyclomatic Complexity 1 include/asm-generic/atomic-instrumented.h:atomic_sub_return
   Cyclomatic Complexity 1 include/linux/atomic-fallback.h:atomic_dec_return
   Cyclomatic Complexity 1 include/asm-generic/bitops/instrumented-atomic.h:clear_bit
   Cyclomatic Complexity 1 include/asm-generic/atomic-instrumented.h:atomic_set
   Cyclomatic Complexity 1 include/asm-generic/atomic-instrumented.h:atomic64_add
   Cyclomatic Complexity 1 include/asm-generic/atomic-long.h:atomic_long_add
   Cyclomatic Complexity 1 include/linux/mm.h:totalram_pages_add
   Cyclomatic Complexity 2 include/linux/page_ref.h:page_ref_inc
   Cyclomatic Complexity 1 include/asm-generic/atomic-instrumented.h:atomic_read
   Cyclomatic Complexity 1 include/linux/jump_label.h:static_key_count

vim +/arch_memory_removable +1027 mm/memory_hotplug.c

  1016	
  1017	static int check_hotremove_memory_range(u64 start, u64 size)
  1018	{
  1019		int rc;
  1020	
  1021		BUG_ON(check_hotplug_memory_range(start, size));
  1022	
  1023		/*
  1024		 * First check if the platform is willing to have this
  1025		 * memory range removed else just abort.
  1026		 */
> 1027		rc = arch_memory_removable(start, size);
  1028		if (!rc)
  1029			return -EINVAL;
  1030	
  1031		return 0;
  1032	}
  1033	

---
0-DAY kernel test infrastructure                 Open Source Technology Center
https://lists.01.org/hyperkitty/list/[email-masked] Intel Corporation
_______________________________________________
linux-arm-kernel mailing list
[email-masked]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel