memcg: remove unneeded header files

Message ID 20230617072658.1826560-1-linmiaohe@huawei.com
State New
Headers
Series memcg: remove unneeded header files |

Commit Message

Miaohe Lin June 17, 2023, 7:26 a.m. UTC
  Remove some unneeded header files. No functional change intended.

Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
---
 mm/memcontrol.c | 5 -----
 1 file changed, 5 deletions(-)
  

Comments

kernel test robot June 17, 2023, 9:12 a.m. UTC | #1
Hi Miaohe,

kernel test robot noticed the following build errors:

[auto build test ERROR on akpm-mm/mm-everything]
[also build test ERROR on linus/master v6.4-rc6 next-20230616]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Miaohe-Lin/memcg-remove-unneeded-header-files/20230617-152922
base:   https://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm.git mm-everything
patch link:    https://lore.kernel.org/r/20230617072658.1826560-1-linmiaohe%40huawei.com
patch subject: [PATCH] memcg: remove unneeded header files
config: nios2-randconfig-r004-20230617 (https://download.01.org/0day-ci/archive/20230617/202306171649.O90yt13M-lkp@intel.com/config)
compiler: nios2-linux-gcc (GCC) 12.3.0
reproduce: (https://download.01.org/0day-ci/archive/20230617/202306171649.O90yt13M-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/202306171649.O90yt13M-lkp@intel.com/

All errors (new ones prefixed by >>):

   mm/memcontrol.c: In function 'mem_cgroup_css_offline':
>> mm/memcontrol.c:5447:9: error: implicit declaration of function 'wb_memcg_offline' [-Werror=implicit-function-declaration]
    5447 |         wb_memcg_offline(memcg);
         |         ^~~~~~~~~~~~~~~~
   mm/memcontrol.c: In function 'mem_cgroup_move_account':
>> mm/memcontrol.c:5788:29: error: implicit declaration of function 'mapping_can_writeback'; did you mean 'mapping_map_writable'? [-Werror=implicit-function-declaration]
    5788 |                         if (mapping_can_writeback(mapping)) {
         |                             ^~~~~~~~~~~~~~~~~~~~~
         |                             mapping_map_writable
   cc1: some warnings being treated as errors


vim +/wb_memcg_offline +5447 mm/memcontrol.c

8cdea7c0545426 Balbir Singh      2008-02-07  5424  
eb95419b023aba Tejun Heo         2013-08-08  5425  static void mem_cgroup_css_offline(struct cgroup_subsys_state *css)
df878fb04dea04 KAMEZAWA Hiroyuki 2008-02-07  5426  {
eb95419b023aba Tejun Heo         2013-08-08  5427  	struct mem_cgroup *memcg = mem_cgroup_from_css(css);
3bc942f372af38 Tejun Heo         2013-11-22  5428  	struct mem_cgroup_event *event, *tmp;
79bd9814e5ec9a Tejun Heo         2013-11-22  5429  
79bd9814e5ec9a Tejun Heo         2013-11-22  5430  	/*
79bd9814e5ec9a Tejun Heo         2013-11-22  5431  	 * Unregister events and notify userspace.
79bd9814e5ec9a Tejun Heo         2013-11-22  5432  	 * Notify userspace about cgroup removing only after rmdir of cgroup
79bd9814e5ec9a Tejun Heo         2013-11-22  5433  	 * directory to avoid race between userspace and kernelspace.
79bd9814e5ec9a Tejun Heo         2013-11-22  5434  	 */
4ba9515d32bac1 Shakeel Butt      2021-09-02  5435  	spin_lock_irq(&memcg->event_list_lock);
fba94807837850 Tejun Heo         2013-11-22  5436  	list_for_each_entry_safe(event, tmp, &memcg->event_list, list) {
79bd9814e5ec9a Tejun Heo         2013-11-22  5437  		list_del_init(&event->list);
79bd9814e5ec9a Tejun Heo         2013-11-22  5438  		schedule_work(&event->remove);
79bd9814e5ec9a Tejun Heo         2013-11-22  5439  	}
4ba9515d32bac1 Shakeel Butt      2021-09-02  5440  	spin_unlock_irq(&memcg->event_list_lock);
ec64f51545fffb KAMEZAWA Hiroyuki 2009-04-02  5441  
bf8d5d52ffe89a Roman Gushchin    2018-06-07  5442  	page_counter_set_min(&memcg->memory, 0);
230671533d6463 Roman Gushchin    2018-06-07  5443  	page_counter_set_low(&memcg->memory, 0);
63677c745d63ba Roman Gushchin    2017-09-06  5444  
567e9ab2e614e5 Johannes Weiner   2016-01-20  5445  	memcg_offline_kmem(memcg);
a178015cde6998 Yang Shi          2021-05-04  5446  	reparent_shrinker_deferred(memcg);
52ebea749aaed1 Tejun Heo         2015-05-22 @5447  	wb_memcg_offline(memcg);
e4dde56cd20867 Yu Zhao           2022-12-21  5448  	lru_gen_offline_memcg(memcg);
73f576c04b9410 Johannes Weiner   2016-07-20  5449  
591edfb10a949d Roman Gushchin    2018-10-26  5450  	drain_all_stock(memcg);
591edfb10a949d Roman Gushchin    2018-10-26  5451  
73f576c04b9410 Johannes Weiner   2016-07-20  5452  	mem_cgroup_id_put(memcg);
df878fb04dea04 KAMEZAWA Hiroyuki 2008-02-07  5453  }
df878fb04dea04 KAMEZAWA Hiroyuki 2008-02-07  5454
  
kernel test robot June 17, 2023, 9:24 a.m. UTC | #2
Hi Miaohe,

kernel test robot noticed the following build errors:

[auto build test ERROR on akpm-mm/mm-everything]
[also build test ERROR on linus/master v6.4-rc6 next-20230616]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Miaohe-Lin/memcg-remove-unneeded-header-files/20230617-152922
base:   https://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm.git mm-everything
patch link:    https://lore.kernel.org/r/20230617072658.1826560-1-linmiaohe%40huawei.com
patch subject: [PATCH] memcg: remove unneeded header files
config: i386-randconfig-i012-20230617 (https://download.01.org/0day-ci/archive/20230617/202306171711.3ZCE2wVo-lkp@intel.com/config)
compiler: clang version 15.0.7 (https://github.com/llvm/llvm-project.git 8dfdcc7b7bf66834a761bd8de445840ef68e4d1a)
reproduce: (https://download.01.org/0day-ci/archive/20230617/202306171711.3ZCE2wVo-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/202306171711.3ZCE2wVo-lkp@intel.com/

All errors (new ones prefixed by >>):

>> mm/memcontrol.c:5447:2: error: call to undeclared function 'wb_memcg_offline'; ISO C99 and later do not support implicit function declarations [-Werror,-Wimplicit-function-declaration]
           wb_memcg_offline(memcg);
           ^
>> mm/memcontrol.c:5788:8: error: call to undeclared function 'mapping_can_writeback'; ISO C99 and later do not support implicit function declarations [-Werror,-Wimplicit-function-declaration]
                           if (mapping_can_writeback(mapping)) {
                               ^
   mm/memcontrol.c:5788:8: note: did you mean 'mapping_map_writable'?
   include/linux/fs.h:545:19: note: 'mapping_map_writable' declared here
   static inline int mapping_map_writable(struct address_space *mapping)
                     ^
   2 errors generated.


vim +/wb_memcg_offline +5447 mm/memcontrol.c

8cdea7c0545426 Balbir Singh      2008-02-07  5424  
eb95419b023aba Tejun Heo         2013-08-08  5425  static void mem_cgroup_css_offline(struct cgroup_subsys_state *css)
df878fb04dea04 KAMEZAWA Hiroyuki 2008-02-07  5426  {
eb95419b023aba Tejun Heo         2013-08-08  5427  	struct mem_cgroup *memcg = mem_cgroup_from_css(css);
3bc942f372af38 Tejun Heo         2013-11-22  5428  	struct mem_cgroup_event *event, *tmp;
79bd9814e5ec9a Tejun Heo         2013-11-22  5429  
79bd9814e5ec9a Tejun Heo         2013-11-22  5430  	/*
79bd9814e5ec9a Tejun Heo         2013-11-22  5431  	 * Unregister events and notify userspace.
79bd9814e5ec9a Tejun Heo         2013-11-22  5432  	 * Notify userspace about cgroup removing only after rmdir of cgroup
79bd9814e5ec9a Tejun Heo         2013-11-22  5433  	 * directory to avoid race between userspace and kernelspace.
79bd9814e5ec9a Tejun Heo         2013-11-22  5434  	 */
4ba9515d32bac1 Shakeel Butt      2021-09-02  5435  	spin_lock_irq(&memcg->event_list_lock);
fba94807837850 Tejun Heo         2013-11-22  5436  	list_for_each_entry_safe(event, tmp, &memcg->event_list, list) {
79bd9814e5ec9a Tejun Heo         2013-11-22  5437  		list_del_init(&event->list);
79bd9814e5ec9a Tejun Heo         2013-11-22  5438  		schedule_work(&event->remove);
79bd9814e5ec9a Tejun Heo         2013-11-22  5439  	}
4ba9515d32bac1 Shakeel Butt      2021-09-02  5440  	spin_unlock_irq(&memcg->event_list_lock);
ec64f51545fffb KAMEZAWA Hiroyuki 2009-04-02  5441  
bf8d5d52ffe89a Roman Gushchin    2018-06-07  5442  	page_counter_set_min(&memcg->memory, 0);
230671533d6463 Roman Gushchin    2018-06-07  5443  	page_counter_set_low(&memcg->memory, 0);
63677c745d63ba Roman Gushchin    2017-09-06  5444  
567e9ab2e614e5 Johannes Weiner   2016-01-20  5445  	memcg_offline_kmem(memcg);
a178015cde6998 Yang Shi          2021-05-04  5446  	reparent_shrinker_deferred(memcg);
52ebea749aaed1 Tejun Heo         2015-05-22 @5447  	wb_memcg_offline(memcg);
e4dde56cd20867 Yu Zhao           2022-12-21  5448  	lru_gen_offline_memcg(memcg);
73f576c04b9410 Johannes Weiner   2016-07-20  5449  
591edfb10a949d Roman Gushchin    2018-10-26  5450  	drain_all_stock(memcg);
591edfb10a949d Roman Gushchin    2018-10-26  5451  
73f576c04b9410 Johannes Weiner   2016-07-20  5452  	mem_cgroup_id_put(memcg);
df878fb04dea04 KAMEZAWA Hiroyuki 2008-02-07  5453  }
df878fb04dea04 KAMEZAWA Hiroyuki 2008-02-07  5454
  
kernel test robot June 17, 2023, 10:58 a.m. UTC | #3
Hi Miaohe,

kernel test robot noticed the following build errors:

[auto build test ERROR on akpm-mm/mm-everything]
[also build test ERROR on linus/master v6.4-rc6 next-20230616]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Miaohe-Lin/memcg-remove-unneeded-header-files/20230617-152922
base:   https://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm.git mm-everything
patch link:    https://lore.kernel.org/r/20230617072658.1826560-1-linmiaohe%40huawei.com
patch subject: [PATCH] memcg: remove unneeded header files
config: hexagon-randconfig-r045-20230617 (https://download.01.org/0day-ci/archive/20230617/202306171859.y5wGpmlD-lkp@intel.com/config)
compiler: clang version 17.0.0 (https://github.com/llvm/llvm-project.git 4a5ac14ee968ff0ad5d2cc1ffa0299048db4c88a)
reproduce: (https://download.01.org/0day-ci/archive/20230617/202306171859.y5wGpmlD-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/202306171859.y5wGpmlD-lkp@intel.com/

All errors (new ones prefixed by >>):

   In file included from mm/memcontrol.c:29:
   In file included from include/linux/memcontrol.h:13:
   In file included from include/linux/cgroup.h:26:
   In file included from include/linux/kernel_stat.h:9:
   In file included from include/linux/interrupt.h:11:
   In file included from include/linux/hardirq.h:11:
   In file included from ./arch/hexagon/include/generated/asm/hardirq.h:1:
   In file included from include/asm-generic/hardirq.h:17:
   In file included from include/linux/irq.h:20:
   In file included from include/linux/io.h:13:
   In file included from arch/hexagon/include/asm/io.h:334:
   include/asm-generic/io.h:547:31: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
     547 |         val = __raw_readb(PCI_IOBASE + addr);
         |                           ~~~~~~~~~~ ^
   include/asm-generic/io.h:560:61: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
     560 |         val = __le16_to_cpu((__le16 __force)__raw_readw(PCI_IOBASE + addr));
         |                                                         ~~~~~~~~~~ ^
   include/uapi/linux/byteorder/little_endian.h:37:51: note: expanded from macro '__le16_to_cpu'
      37 | #define __le16_to_cpu(x) ((__force __u16)(__le16)(x))
         |                                                   ^
   In file included from mm/memcontrol.c:29:
   In file included from include/linux/memcontrol.h:13:
   In file included from include/linux/cgroup.h:26:
   In file included from include/linux/kernel_stat.h:9:
   In file included from include/linux/interrupt.h:11:
   In file included from include/linux/hardirq.h:11:
   In file included from ./arch/hexagon/include/generated/asm/hardirq.h:1:
   In file included from include/asm-generic/hardirq.h:17:
   In file included from include/linux/irq.h:20:
   In file included from include/linux/io.h:13:
   In file included from arch/hexagon/include/asm/io.h:334:
   include/asm-generic/io.h:573:61: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
     573 |         val = __le32_to_cpu((__le32 __force)__raw_readl(PCI_IOBASE + addr));
         |                                                         ~~~~~~~~~~ ^
   include/uapi/linux/byteorder/little_endian.h:35:51: note: expanded from macro '__le32_to_cpu'
      35 | #define __le32_to_cpu(x) ((__force __u32)(__le32)(x))
         |                                                   ^
   In file included from mm/memcontrol.c:29:
   In file included from include/linux/memcontrol.h:13:
   In file included from include/linux/cgroup.h:26:
   In file included from include/linux/kernel_stat.h:9:
   In file included from include/linux/interrupt.h:11:
   In file included from include/linux/hardirq.h:11:
   In file included from ./arch/hexagon/include/generated/asm/hardirq.h:1:
   In file included from include/asm-generic/hardirq.h:17:
   In file included from include/linux/irq.h:20:
   In file included from include/linux/io.h:13:
   In file included from arch/hexagon/include/asm/io.h:334:
   include/asm-generic/io.h:584:33: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
     584 |         __raw_writeb(value, PCI_IOBASE + addr);
         |                             ~~~~~~~~~~ ^
   include/asm-generic/io.h:594:59: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
     594 |         __raw_writew((u16 __force)cpu_to_le16(value), PCI_IOBASE + addr);
         |                                                       ~~~~~~~~~~ ^
   include/asm-generic/io.h:604:59: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
     604 |         __raw_writel((u32 __force)cpu_to_le32(value), PCI_IOBASE + addr);
         |                                                       ~~~~~~~~~~ ^
>> mm/memcontrol.c:5447:2: error: call to undeclared function 'wb_memcg_offline'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
    5447 |         wb_memcg_offline(memcg);
         |         ^
>> mm/memcontrol.c:5788:8: error: call to undeclared function 'mapping_can_writeback'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
    5788 |                         if (mapping_can_writeback(mapping)) {
         |                             ^
   mm/memcontrol.c:5788:8: note: did you mean 'mapping_map_writable'?
   include/linux/fs.h:545:19: note: 'mapping_map_writable' declared here
     545 | static inline int mapping_map_writable(struct address_space *mapping)
         |                   ^
   6 warnings and 2 errors generated.


vim +/wb_memcg_offline +5447 mm/memcontrol.c

8cdea7c0545426 Balbir Singh      2008-02-07  5424  
eb95419b023aba Tejun Heo         2013-08-08  5425  static void mem_cgroup_css_offline(struct cgroup_subsys_state *css)
df878fb04dea04 KAMEZAWA Hiroyuki 2008-02-07  5426  {
eb95419b023aba Tejun Heo         2013-08-08  5427  	struct mem_cgroup *memcg = mem_cgroup_from_css(css);
3bc942f372af38 Tejun Heo         2013-11-22  5428  	struct mem_cgroup_event *event, *tmp;
79bd9814e5ec9a Tejun Heo         2013-11-22  5429  
79bd9814e5ec9a Tejun Heo         2013-11-22  5430  	/*
79bd9814e5ec9a Tejun Heo         2013-11-22  5431  	 * Unregister events and notify userspace.
79bd9814e5ec9a Tejun Heo         2013-11-22  5432  	 * Notify userspace about cgroup removing only after rmdir of cgroup
79bd9814e5ec9a Tejun Heo         2013-11-22  5433  	 * directory to avoid race between userspace and kernelspace.
79bd9814e5ec9a Tejun Heo         2013-11-22  5434  	 */
4ba9515d32bac1 Shakeel Butt      2021-09-02  5435  	spin_lock_irq(&memcg->event_list_lock);
fba94807837850 Tejun Heo         2013-11-22  5436  	list_for_each_entry_safe(event, tmp, &memcg->event_list, list) {
79bd9814e5ec9a Tejun Heo         2013-11-22  5437  		list_del_init(&event->list);
79bd9814e5ec9a Tejun Heo         2013-11-22  5438  		schedule_work(&event->remove);
79bd9814e5ec9a Tejun Heo         2013-11-22  5439  	}
4ba9515d32bac1 Shakeel Butt      2021-09-02  5440  	spin_unlock_irq(&memcg->event_list_lock);
ec64f51545fffb KAMEZAWA Hiroyuki 2009-04-02  5441  
bf8d5d52ffe89a Roman Gushchin    2018-06-07  5442  	page_counter_set_min(&memcg->memory, 0);
230671533d6463 Roman Gushchin    2018-06-07  5443  	page_counter_set_low(&memcg->memory, 0);
63677c745d63ba Roman Gushchin    2017-09-06  5444  
567e9ab2e614e5 Johannes Weiner   2016-01-20  5445  	memcg_offline_kmem(memcg);
a178015cde6998 Yang Shi          2021-05-04  5446  	reparent_shrinker_deferred(memcg);
52ebea749aaed1 Tejun Heo         2015-05-22 @5447  	wb_memcg_offline(memcg);
e4dde56cd20867 Yu Zhao           2022-12-21  5448  	lru_gen_offline_memcg(memcg);
73f576c04b9410 Johannes Weiner   2016-07-20  5449  
591edfb10a949d Roman Gushchin    2018-10-26  5450  	drain_all_stock(memcg);
591edfb10a949d Roman Gushchin    2018-10-26  5451  
73f576c04b9410 Johannes Weiner   2016-07-20  5452  	mem_cgroup_id_put(memcg);
df878fb04dea04 KAMEZAWA Hiroyuki 2008-02-07  5453  }
df878fb04dea04 KAMEZAWA Hiroyuki 2008-02-07  5454
  
Miaohe Lin June 19, 2023, 1:38 a.m. UTC | #4
On 2023/6/17 17:12, kernel test robot wrote:
> Hi Miaohe,
> 
> kernel test robot noticed the following build errors:
> 
> [auto build test ERROR on akpm-mm/mm-everything]
> [also build test ERROR on linus/master v6.4-rc6 next-20230616]
> [If your patch is applied to the wrong git tree, kindly drop us a note.
> And when submitting patch, we suggest to use '--base' as documented in
> https://git-scm.com/docs/git-format-patch#_base_tree_information]
> 
> url:    https://github.com/intel-lab-lkp/linux/commits/Miaohe-Lin/memcg-remove-unneeded-header-files/20230617-152922
> base:   https://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm.git mm-everything
> patch link:    https://lore.kernel.org/r/20230617072658.1826560-1-linmiaohe%40huawei.com
> patch subject: [PATCH] memcg: remove unneeded header files
> config: nios2-randconfig-r004-20230617 (https://download.01.org/0day-ci/archive/20230617/202306171649.O90yt13M-lkp@intel.com/config)
> compiler: nios2-linux-gcc (GCC) 12.3.0
> reproduce: (https://download.01.org/0day-ci/archive/20230617/202306171649.O90yt13M-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/202306171649.O90yt13M-lkp@intel.com/

Many thanks for report. Will fix it.
  
Michal Hocko June 19, 2023, 7:19 a.m. UTC | #5
On Sat 17-06-23 15:26:58, Miaohe Lin wrote:
> Remove some unneeded header files. No functional change intended.

Header inclusion cleanups are certainly welcome but it would be much
more preferred to explain why those are not needed. As build test follow
ups show this is much more subtle than it seems.
> 
> Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
> ---
>  mm/memcontrol.c | 5 -----
>  1 file changed, 5 deletions(-)
> 
> diff --git a/mm/memcontrol.c b/mm/memcontrol.c
> index d42742edfeac..a2c82a18745d 100644
> --- a/mm/memcontrol.c
> +++ b/mm/memcontrol.c
> @@ -30,14 +30,10 @@
>  #include <linux/cgroup.h>
>  #include <linux/pagewalk.h>
>  #include <linux/sched/mm.h>
> -#include <linux/shmem_fs.h>
> -#include <linux/hugetlb.h>
>  #include <linux/pagemap.h>
>  #include <linux/vm_event_item.h>
>  #include <linux/smp.h>
>  #include <linux/page-flags.h>
> -#include <linux/backing-dev.h>
> -#include <linux/bit_spinlock.h>
>  #include <linux/rcupdate.h>
>  #include <linux/limits.h>
>  #include <linux/export.h>
> @@ -66,7 +62,6 @@
>  #include <linux/sched/isolation.h>
>  #include "internal.h"
>  #include <net/sock.h>
> -#include <net/ip.h>
>  #include "slab.h"
>  #include "swap.h"
>  
> -- 
> 2.27.0
  
Miaohe Lin June 19, 2023, 7:42 a.m. UTC | #6
On 2023/6/19 15:19, Michal Hocko wrote:
> On Sat 17-06-23 15:26:58, Miaohe Lin wrote:
>> Remove some unneeded header files. No functional change intended.
> 
> Header inclusion cleanups are certainly welcome but it would be much
> more preferred to explain why those are not needed. As build test follow
> ups show this is much more subtle than it seems.

Will make it clear in v2. Thanks for comment.
  

Patch

diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index d42742edfeac..a2c82a18745d 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -30,14 +30,10 @@ 
 #include <linux/cgroup.h>
 #include <linux/pagewalk.h>
 #include <linux/sched/mm.h>
-#include <linux/shmem_fs.h>
-#include <linux/hugetlb.h>
 #include <linux/pagemap.h>
 #include <linux/vm_event_item.h>
 #include <linux/smp.h>
 #include <linux/page-flags.h>
-#include <linux/backing-dev.h>
-#include <linux/bit_spinlock.h>
 #include <linux/rcupdate.h>
 #include <linux/limits.h>
 #include <linux/export.h>
@@ -66,7 +62,6 @@ 
 #include <linux/sched/isolation.h>
 #include "internal.h"
 #include <net/sock.h>
-#include <net/ip.h>
 #include "slab.h"
 #include "swap.h"