Re: [PATCH v2 5/5] memcg, inode: protect page cache from freeing inode

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Yafang,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on linus/master]
[also build test ERROR on v5.5-rc3 next-20191219]
[cannot apply to mmotm/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/Yafang-Shao/protect-page-cache-from-freeing-inode/20191225-193636
base:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 46cf053efec6a3a5f343fead837777efe8252a46
config: um-x86_64_defconfig (attached as .config)
compiler: gcc-7 (Debian 7.5.0-3) 7.5.0
reproduce:
        # save the attached .config to linux build tree
        make ARCH=um SUBARCH=x86_64

If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp@xxxxxxxxx>

All errors (new ones prefixed by >>):

   In file included from include/linux/swap.h:9:0,
                    from mm/vmscan.c:22:
   include/linux/memcontrol.h:872:23: error: conflicting types for 'memcg'
            struct inode *memcg)
                          ^~~~~
   include/linux/memcontrol.h:871:63: note: previous definition of 'memcg' was here
    static inline bool memcg_can_reclaim_inode(struct mem_cgroup *memcg,
                                                                  ^~~~~
   mm/vmscan.c: In function 'shrink_node_memcgs':
>> mm/vmscan.c:2670:9: error: dereferencing pointer to incomplete type 'struct mem_cgroup'
       memcg->in_low_reclaim = 1;
            ^~
--
   In file included from include/linux/swap.h:9:0,
                    from fs/inode.c:11:
   include/linux/memcontrol.h:872:23: error: conflicting types for 'memcg'
            struct inode *memcg)
                          ^~~~~
   include/linux/memcontrol.h:871:63: note: previous definition of 'memcg' was here
    static inline bool memcg_can_reclaim_inode(struct mem_cgroup *memcg,
                                                                  ^~~~~
   fs/inode.c: In function 'prune_icache_sb':
>> fs/inode.c:822:7: error: 'struct inode_head' has no member named 'memcg'
     ihead.memcg = sc->memcg;
          ^

vim +2670 mm/vmscan.c

  2639	
  2640	static void shrink_node_memcgs(pg_data_t *pgdat, struct scan_control *sc)
  2641	{
  2642		struct mem_cgroup *target_memcg = sc->target_mem_cgroup;
  2643		struct mem_cgroup *memcg;
  2644	
  2645		memcg = mem_cgroup_iter(target_memcg, NULL, NULL);
  2646		do {
  2647			struct lruvec *lruvec = mem_cgroup_lruvec(memcg, pgdat);
  2648			unsigned long reclaimed;
  2649			unsigned long scanned;
  2650	
  2651			switch (mem_cgroup_protected(target_memcg, memcg)) {
  2652			case MEMCG_PROT_MIN:
  2653				/*
  2654				 * Hard protection.
  2655				 * If there is no reclaimable memory, OOM.
  2656				 */
  2657				continue;
  2658			case MEMCG_PROT_LOW:
  2659				/*
  2660				 * Soft protection.
  2661				 * Respect the protection only as long as
  2662				 * there is an unprotected supply
  2663				 * of reclaimable memory from other cgroups.
  2664				 */
  2665				if (!sc->memcg_low_reclaim) {
  2666					sc->memcg_low_skipped = 1;
  2667					continue;
  2668				}
  2669	
> 2670				memcg->in_low_reclaim = 1;
  2671				memcg_memory_event(memcg, MEMCG_LOW);
  2672				break;
  2673			case MEMCG_PROT_NONE:
  2674				/*
  2675				 * All protection thresholds breached. We may
  2676				 * still choose to vary the scan pressure
  2677				 * applied based on by how much the cgroup in
  2678				 * question has exceeded its protection
  2679				 * thresholds (see get_scan_count).
  2680				 */
  2681				break;
  2682			case MEMCG_PROT_SKIP:
  2683				/*
  2684				 * Skip scanning this memcg if the usage of it is
  2685				 * zero.
  2686				 */
  2687				continue;
  2688			}
  2689	
  2690			reclaimed = sc->nr_reclaimed;
  2691			scanned = sc->nr_scanned;
  2692	
  2693			shrink_lruvec(lruvec, sc);
  2694	
  2695			shrink_slab(sc->gfp_mask, pgdat->node_id, memcg,
  2696				    sc->priority);
  2697	
  2698			if (memcg->in_low_reclaim)
  2699				memcg->in_low_reclaim = 0;
  2700	
  2701			/* Record the group's reclaim efficiency */
  2702			vmpressure(sc->gfp_mask, memcg, false,
  2703				   sc->nr_scanned - scanned,
  2704				   sc->nr_reclaimed - reclaimed);
  2705	
  2706		} while ((memcg = mem_cgroup_iter(target_memcg, memcg, NULL)));
  2707	}
  2708	

---
0-DAY kernel test infrastructure                 Open Source Technology Center
https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx Intel Corporation

Attachment: .config.gz
Description: application/gzip


[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux