linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: "Matthew Wilcox (Oracle)" <willy@infradead.org>,
	akpm@linux-foundation.org
Cc: kbuild-all@lists.01.org,
	"Matthew Wilcox (Oracle)" <willy@infradead.org>,
	linux-kernel@vger.kernel.org, linux-mm@kvack.org,
	linux-fsdevel@vger.kernel.org, cgroups@vger.kernel.org,
	Christoph Hellwig <hch@lst.de>
Subject: Re: [PATCH v13 08/18] mm/memcg: Convert mem_cgroup_charge() to take a folio
Date: Tue, 13 Jul 2021 06:22:09 +0800	[thread overview]
Message-ID: <202107130626.PXtTZF3U-lkp@intel.com> (raw)
In-Reply-To: <20210712194551.91920-9-willy@infradead.org>

[-- Attachment #1: Type: text/plain, Size: 14409 bytes --]

Hi "Matthew,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on linus/master]
[also build test ERROR on v5.14-rc1 next-20210712]
[cannot apply to hnaz-linux-mm/master tip/perf/core linux/master]
[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]

url:    https://github.com/0day-ci/linux/commits/Matthew-Wilcox-Oracle/Convert-memcg-to-folios/20210713-035650
base:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git e73f0f0ee7541171d89f2e2491130c7771ba58d3
config: nds32-allnoconfig (attached as .config)
compiler: nds32le-linux-gcc (GCC) 9.3.0
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://github.com/0day-ci/linux/commit/3aa23c53058c0abac2b7fd5d8c80f9b458a2665f
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Matthew-Wilcox-Oracle/Convert-memcg-to-folios/20210713-035650
        git checkout 3aa23c53058c0abac2b7fd5d8c80f9b458a2665f
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=nds32 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All errors (new ones prefixed by >>):

   In file included from include/linux/dax.h:6,
                    from mm/filemap.c:15:
   include/linux/mm.h:1380:42: warning: 'struct folio' declared inside parameter list will not be visible outside of this definition or declaration
    1380 | static inline int folio_nid(const struct folio *folio)
         |                                          ^~~~~
   include/linux/mm.h: In function 'folio_nid':
   include/linux/mm.h:1382:27: error: dereferencing pointer to incomplete type 'const struct folio'
    1382 |  return page_to_nid(&folio->page);
         |                           ^~
   In file included from include/linux/swap.h:9,
                    from mm/filemap.c:23:
   include/linux/memcontrol.h: At top level:
   include/linux/memcontrol.h:1120:53: warning: 'struct folio' declared inside parameter list will not be visible outside of this definition or declaration
    1120 | static inline struct mem_cgroup *folio_memcg(struct folio *folio)
         |                                                     ^~~~~
   include/linux/memcontrol.h:1141:44: warning: 'struct folio' declared inside parameter list will not be visible outside of this definition or declaration
    1141 | static inline bool folio_memcg_kmem(struct folio *folio)
         |                                            ^~~~~
   include/linux/memcontrol.h:1193:44: warning: 'struct folio' declared inside parameter list will not be visible outside of this definition or declaration
    1193 | static inline int mem_cgroup_charge(struct folio *folio,
         |                                            ^~~~~
   mm/filemap.c: In function '__add_to_page_cache_locked':
>> mm/filemap.c:875:29: error: implicit declaration of function 'page_folio'; did you mean 'page_endio'? [-Werror=implicit-function-declaration]
     875 |   error = mem_cgroup_charge(page_folio(page), NULL, gfp);
         |                             ^~~~~~~~~~
         |                             page_endio
   mm/filemap.c:875:29: warning: passing argument 1 of 'mem_cgroup_charge' makes pointer from integer without a cast [-Wint-conversion]
     875 |   error = mem_cgroup_charge(page_folio(page), NULL, gfp);
         |                             ^~~~~~~~~~~~~~~~
         |                             |
         |                             int
   In file included from include/linux/swap.h:9,
                    from mm/filemap.c:23:
   include/linux/memcontrol.h:1193:51: note: expected 'struct folio *' but argument is of type 'int'
    1193 | static inline int mem_cgroup_charge(struct folio *folio,
         |                                     ~~~~~~~~~~~~~~^~~~~
   cc1: some warnings being treated as errors
--
   In file included from include/linux/security.h:33,
                    from include/linux/fs_context.h:14,
                    from include/linux/fs_parser.h:11,
                    from include/linux/ramfs.h:5,
                    from mm/shmem.c:28:
   include/linux/mm.h:1380:42: warning: 'struct folio' declared inside parameter list will not be visible outside of this definition or declaration
    1380 | static inline int folio_nid(const struct folio *folio)
         |                                          ^~~~~
   include/linux/mm.h: In function 'folio_nid':
   include/linux/mm.h:1382:27: error: dereferencing pointer to incomplete type 'const struct folio'
    1382 |  return page_to_nid(&folio->page);
         |                           ^~
   In file included from include/linux/swap.h:9,
                    from mm/shmem.c:35:
   include/linux/memcontrol.h: At top level:
   include/linux/memcontrol.h:1120:53: warning: 'struct folio' declared inside parameter list will not be visible outside of this definition or declaration
    1120 | static inline struct mem_cgroup *folio_memcg(struct folio *folio)
         |                                                     ^~~~~
   include/linux/memcontrol.h:1141:44: warning: 'struct folio' declared inside parameter list will not be visible outside of this definition or declaration
    1141 | static inline bool folio_memcg_kmem(struct folio *folio)
         |                                            ^~~~~
   include/linux/memcontrol.h:1193:44: warning: 'struct folio' declared inside parameter list will not be visible outside of this definition or declaration
    1193 | static inline int mem_cgroup_charge(struct folio *folio,
         |                                            ^~~~~
   mm/shmem.c: In function 'shmem_add_to_page_cache':
>> mm/shmem.c:688:29: error: implicit declaration of function 'page_folio'; did you mean 'page_endio'? [-Werror=implicit-function-declaration]
     688 |   error = mem_cgroup_charge(page_folio(page), charge_mm, gfp);
         |                             ^~~~~~~~~~
         |                             page_endio
   mm/shmem.c:688:29: warning: passing argument 1 of 'mem_cgroup_charge' makes pointer from integer without a cast [-Wint-conversion]
     688 |   error = mem_cgroup_charge(page_folio(page), charge_mm, gfp);
         |                             ^~~~~~~~~~~~~~~~
         |                             |
         |                             int
   In file included from include/linux/swap.h:9,
                    from mm/shmem.c:35:
   include/linux/memcontrol.h:1193:51: note: expected 'struct folio *' but argument is of type 'int'
    1193 | static inline int mem_cgroup_charge(struct folio *folio,
         |                                     ~~~~~~~~~~~~~~^~~~~
   cc1: some warnings being treated as errors
--
   In file included from mm/memory.c:43:
   include/linux/mm.h:1380:42: warning: 'struct folio' declared inside parameter list will not be visible outside of this definition or declaration
    1380 | static inline int folio_nid(const struct folio *folio)
         |                                          ^~~~~
   include/linux/mm.h: In function 'folio_nid':
   include/linux/mm.h:1382:27: error: dereferencing pointer to incomplete type 'const struct folio'
    1382 |  return page_to_nid(&folio->page);
         |                           ^~
   In file included from include/linux/swap.h:9,
                    from mm/memory.c:50:
   include/linux/memcontrol.h: At top level:
   include/linux/memcontrol.h:1120:53: warning: 'struct folio' declared inside parameter list will not be visible outside of this definition or declaration
    1120 | static inline struct mem_cgroup *folio_memcg(struct folio *folio)
         |                                                     ^~~~~
   include/linux/memcontrol.h:1141:44: warning: 'struct folio' declared inside parameter list will not be visible outside of this definition or declaration
    1141 | static inline bool folio_memcg_kmem(struct folio *folio)
         |                                            ^~~~~
   include/linux/memcontrol.h:1193:44: warning: 'struct folio' declared inside parameter list will not be visible outside of this definition or declaration
    1193 | static inline int mem_cgroup_charge(struct folio *folio,
         |                                            ^~~~~
   mm/memory.c: In function 'page_copy_prealloc':
>> mm/memory.c:993:24: error: implicit declaration of function 'page_folio'; did you mean 'page_endio'? [-Werror=implicit-function-declaration]
     993 |  if (mem_cgroup_charge(page_folio(new_page), src_mm, GFP_KERNEL)) {
         |                        ^~~~~~~~~~
         |                        page_endio
   mm/memory.c:993:24: warning: passing argument 1 of 'mem_cgroup_charge' makes pointer from integer without a cast [-Wint-conversion]
     993 |  if (mem_cgroup_charge(page_folio(new_page), src_mm, GFP_KERNEL)) {
         |                        ^~~~~~~~~~~~~~~~~~~~
         |                        |
         |                        int
   In file included from include/linux/swap.h:9,
                    from mm/memory.c:50:
   include/linux/memcontrol.h:1193:51: note: expected 'struct folio *' but argument is of type 'int'
    1193 | static inline int mem_cgroup_charge(struct folio *folio,
         |                                     ~~~~~~~~~~~~~~^~~~~
   mm/memory.c: In function 'wp_page_copy':
   mm/memory.c:3022:24: warning: passing argument 1 of 'mem_cgroup_charge' makes pointer from integer without a cast [-Wint-conversion]
    3022 |  if (mem_cgroup_charge(page_folio(new_page), mm, GFP_KERNEL))
         |                        ^~~~~~~~~~~~~~~~~~~~
         |                        |
         |                        int
   In file included from include/linux/swap.h:9,
                    from mm/memory.c:50:
   include/linux/memcontrol.h:1193:51: note: expected 'struct folio *' but argument is of type 'int'
    1193 | static inline int mem_cgroup_charge(struct folio *folio,
         |                                     ~~~~~~~~~~~~~~^~~~~
   mm/memory.c: In function 'do_anonymous_page':
   mm/memory.c:3771:24: warning: passing argument 1 of 'mem_cgroup_charge' makes pointer from integer without a cast [-Wint-conversion]
    3771 |  if (mem_cgroup_charge(page_folio(page), vma->vm_mm, GFP_KERNEL))
         |                        ^~~~~~~~~~~~~~~~
         |                        |
         |                        int
   In file included from include/linux/swap.h:9,
                    from mm/memory.c:50:
   include/linux/memcontrol.h:1193:51: note: expected 'struct folio *' but argument is of type 'int'
    1193 | static inline int mem_cgroup_charge(struct folio *folio,
         |                                     ~~~~~~~~~~~~~~^~~~~
   mm/memory.c: In function 'do_cow_fault':
   mm/memory.c:4186:24: warning: passing argument 1 of 'mem_cgroup_charge' makes pointer from integer without a cast [-Wint-conversion]
    4186 |  if (mem_cgroup_charge(page_folio(vmf->cow_page), vma->vm_mm,
         |                        ^~~~~~~~~~~~~~~~~~~~~~~~~
         |                        |
         |                        int
   In file included from include/linux/swap.h:9,
                    from mm/memory.c:50:
   include/linux/memcontrol.h:1193:51: note: expected 'struct folio *' but argument is of type 'int'
    1193 | static inline int mem_cgroup_charge(struct folio *folio,
         |                                     ~~~~~~~~~~~~~~^~~~~
   cc1: some warnings being treated as errors


vim +875 mm/filemap.c

   855	
   856	noinline int __add_to_page_cache_locked(struct page *page,
   857						struct address_space *mapping,
   858						pgoff_t offset, gfp_t gfp,
   859						void **shadowp)
   860	{
   861		XA_STATE(xas, &mapping->i_pages, offset);
   862		int huge = PageHuge(page);
   863		int error;
   864		bool charged = false;
   865	
   866		VM_BUG_ON_PAGE(!PageLocked(page), page);
   867		VM_BUG_ON_PAGE(PageSwapBacked(page), page);
   868		mapping_set_update(&xas, mapping);
   869	
   870		get_page(page);
   871		page->mapping = mapping;
   872		page->index = offset;
   873	
   874		if (!huge) {
 > 875			error = mem_cgroup_charge(page_folio(page), NULL, gfp);
   876			if (error)
   877				goto error;
   878			charged = true;
   879		}
   880	
   881		gfp &= GFP_RECLAIM_MASK;
   882	
   883		do {
   884			unsigned int order = xa_get_order(xas.xa, xas.xa_index);
   885			void *entry, *old = NULL;
   886	
   887			if (order > thp_order(page))
   888				xas_split_alloc(&xas, xa_load(xas.xa, xas.xa_index),
   889						order, gfp);
   890			xas_lock_irq(&xas);
   891			xas_for_each_conflict(&xas, entry) {
   892				old = entry;
   893				if (!xa_is_value(entry)) {
   894					xas_set_err(&xas, -EEXIST);
   895					goto unlock;
   896				}
   897			}
   898	
   899			if (old) {
   900				if (shadowp)
   901					*shadowp = old;
   902				/* entry may have been split before we acquired lock */
   903				order = xa_get_order(xas.xa, xas.xa_index);
   904				if (order > thp_order(page)) {
   905					xas_split(&xas, old, order);
   906					xas_reset(&xas);
   907				}
   908			}
   909	
   910			xas_store(&xas, page);
   911			if (xas_error(&xas))
   912				goto unlock;
   913	
   914			mapping->nrpages++;
   915	
   916			/* hugetlb pages do not participate in page cache accounting */
   917			if (!huge)
   918				__inc_lruvec_page_state(page, NR_FILE_PAGES);
   919	unlock:
   920			xas_unlock_irq(&xas);
   921		} while (xas_nomem(&xas, gfp));
   922	
   923		if (xas_error(&xas)) {
   924			error = xas_error(&xas);
   925			if (charged)
   926				mem_cgroup_uncharge(page);
   927			goto error;
   928		}
   929	
   930		trace_mm_filemap_add_to_page_cache(page);
   931		return 0;
   932	error:
   933		page->mapping = NULL;
   934		/* Leave page->index set: truncation relies upon it */
   935		put_page(page);
   936		return error;
   937	}
   938	ALLOW_ERROR_INJECTION(__add_to_page_cache_locked, ERRNO);
   939	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 5948 bytes --]

  reply	other threads:[~2021-07-12 22:23 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-12 19:45 [PATCH v13b 00/18] Convert memcg to folios Matthew Wilcox (Oracle)
2021-07-12 19:45 ` [PATCH v13 01/18] mm: Add folio_nid() Matthew Wilcox (Oracle)
2021-07-12 19:45 ` [PATCH v13 02/18] mm/memcg: Remove 'page' parameter to mem_cgroup_charge_statistics() Matthew Wilcox (Oracle)
2021-07-12 19:45 ` [PATCH v13 03/18] mm/memcg: Use the node id in mem_cgroup_update_tree() Matthew Wilcox (Oracle)
2021-07-12 19:45 ` [PATCH v13 04/18] mm/memcg: Remove soft_limit_tree_node() Matthew Wilcox (Oracle)
2021-07-12 19:45 ` [PATCH v13 05/18] mm/memcg: Convert memcg_check_events to take a node ID Matthew Wilcox (Oracle)
2021-07-12 19:45 ` [PATCH v13 06/18] mm/memcg: Add folio_memcg() and related functions Matthew Wilcox (Oracle)
2021-07-12 21:56   ` kernel test robot
2021-07-12 19:45 ` [PATCH v13 07/18] mm/memcg: Convert commit_charge() to take a folio Matthew Wilcox (Oracle)
2021-07-12 19:45 ` [PATCH v13 08/18] mm/memcg: Convert mem_cgroup_charge() " Matthew Wilcox (Oracle)
2021-07-12 22:22   ` kernel test robot [this message]
2021-07-12 19:45 ` [PATCH v13 09/18] mm/memcg: Convert uncharge_page() to uncharge_folio() Matthew Wilcox (Oracle)
2021-07-12 19:45 ` [PATCH v13 10/18] mm/memcg: Convert mem_cgroup_uncharge() to take a folio Matthew Wilcox (Oracle)
2021-07-12 19:45 ` [PATCH v13 11/18] mm/memcg: Convert mem_cgroup_migrate() to take folios Matthew Wilcox (Oracle)
2021-07-12 19:45 ` [PATCH v13 12/18] mm/memcg: Convert mem_cgroup_track_foreign_dirty_slowpath() to folio Matthew Wilcox (Oracle)
2021-07-12 19:45 ` [PATCH v13 13/18] mm/memcg: Add folio_memcg_lock() and folio_memcg_unlock() Matthew Wilcox (Oracle)
2021-07-13 12:58   ` Christoph Hellwig
2021-07-12 19:45 ` [PATCH v13 14/18] mm/memcg: Convert mem_cgroup_move_account() to use a folio Matthew Wilcox (Oracle)
2021-07-13 13:00   ` Christoph Hellwig
2021-07-12 19:45 ` [PATCH v13 15/18] mm/memcg: Add folio_lruvec() Matthew Wilcox (Oracle)
2021-07-12 22:41   ` kernel test robot
2021-07-13 13:02   ` Christoph Hellwig
2021-07-12 19:45 ` [PATCH v13 16/18] mm/memcg: Add folio_lruvec_lock() and similar functions Matthew Wilcox (Oracle)
2021-07-13 13:03   ` Christoph Hellwig
2021-07-12 19:45 ` [PATCH v13 17/18] mm/memcg: Add folio_lruvec_relock_irq() and folio_lruvec_relock_irqsave() Matthew Wilcox (Oracle)
2021-07-13 13:03   ` Christoph Hellwig
2021-07-12 19:45 ` [PATCH v13 18/18] mm/workingset: Convert workingset_activation to take a folio Matthew Wilcox (Oracle)

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202107130626.PXtTZF3U-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=akpm@linux-foundation.org \
    --cc=cgroups@vger.kernel.org \
    --cc=hch@lst.de \
    --cc=kbuild-all@lists.01.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=willy@infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).