linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Mina Almasry <almasrymina@google.com>
Cc: kbuild-all@lists.01.org, Mina Almasry <almasrymina@google.com>,
	Michal Hocko <mhocko@suse.com>, Theodore Ts'o <tytso@mit.edu>,
	Greg Thelen <gthelen@google.com>,
	Shakeel Butt <shakeelb@google.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Linux Memory Management List <linux-mm@kvack.org>,
	Hugh Dickins <hughd@google.com>, Roman Gushchin <guro@fb.com>,
	Dave Chinner <david@fromorbit.com>
Subject: Re: [PATCH v2 1/4] mm/shmem: support deterministic charging of tmpfs
Date: Fri, 12 Nov 2021 01:16:08 +0800	[thread overview]
Message-ID: <202111120132.Ujj6m5cb-lkp@intel.com> (raw)
In-Reply-To: <20211110211951.3730787-2-almasrymina@google.com>

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

Hi Mina,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on hnaz-mm/master]

url:    https://github.com/0day-ci/linux/commits/Mina-Almasry/mm-shmem-support-deterministic-charging-of-tmpfs/20211111-062122
base:   https://github.com/hnaz/linux-mm master
config: ia64-defconfig (attached as .config)
compiler: ia64-linux-gcc (GCC) 11.2.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/aaf0e3e0832977b6eb257e1ed27747cf97c479d4
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Mina-Almasry/mm-shmem-support-deterministic-charging-of-tmpfs/20211111-062122
        git checkout aaf0e3e0832977b6eb257e1ed27747cf97c479d4
        # save the attached .config to linux build tree
        mkdir build_dir
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=ia64 SHELL=/bin/bash

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 >>):

   mm/shmem.c:118:5: warning: "CONFIG_MEMCG" is not defined, evaluates to 0 [-Wundef]
     118 | #if CONFIG_MEMCG
         |     ^~~~~~~~~~~~
   mm/shmem.c: In function 'shmem_add_to_page_cache':
>> mm/shmem.c:721:46: error: invalid use of undefined type 'struct mem_cgroup'
     721 |                         css_put(&remote_memcg->css);
         |                                              ^~
   mm/shmem.c: In function 'shmem_getpage_gfp':
   mm/shmem.c:1863:38: error: invalid use of undefined type 'struct mem_cgroup'
    1863 |                 css_put(&remote_memcg->css);
         |                                      ^~
   mm/shmem.c: In function 'shmem_parse_one':
   mm/shmem.c:3410:28: warning: unused variable 'memcg' [-Wunused-variable]
    3410 |         struct mem_cgroup *memcg;
         |                            ^~~~~
   mm/shmem.c: In function 'shmem_reconfigure':
   mm/shmem.c:3616:5: warning: "CONFIG_MEMCG" is not defined, evaluates to 0 [-Wundef]
    3616 | #if CONFIG_MEMCG
         |     ^~~~~~~~~~~~
   mm/shmem.c: In function 'shmem_fill_super':
   mm/shmem.c:3772:5: warning: "CONFIG_MEMCG" is not defined, evaluates to 0 [-Wundef]
    3772 | #if CONFIG_MEMCG
         |     ^~~~~~~~~~~~


vim +721 mm/shmem.c

   691	
   692	/*
   693	 * Like add_to_page_cache_locked, but error if expected item has gone.
   694	 */
   695	static int shmem_add_to_page_cache(struct page *page,
   696					   struct address_space *mapping,
   697					   pgoff_t index, void *expected, gfp_t gfp,
   698					   struct mm_struct *charge_mm)
   699	{
   700		XA_STATE_ORDER(xas, &mapping->i_pages, index, compound_order(page));
   701		unsigned long i = 0;
   702		unsigned long nr = compound_nr(page);
   703		int error;
   704		struct mem_cgroup *remote_memcg;
   705	
   706		VM_BUG_ON_PAGE(PageTail(page), page);
   707		VM_BUG_ON_PAGE(index != round_down(index, nr), page);
   708		VM_BUG_ON_PAGE(!PageLocked(page), page);
   709		VM_BUG_ON_PAGE(!PageSwapBacked(page), page);
   710		VM_BUG_ON(expected && PageTransHuge(page));
   711	
   712		page_ref_add(page, nr);
   713		page->mapping = mapping;
   714		page->index = index;
   715	
   716		if (!PageSwapCache(page)) {
   717			remote_memcg = mem_cgroup_mapping_get_charge_target(mapping);
   718			if (remote_memcg) {
   719				error = mem_cgroup_charge_memcg(page_folio(page),
   720								remote_memcg, gfp);
 > 721				css_put(&remote_memcg->css);
   722			} else
   723				error = mem_cgroup_charge(page_folio(page), charge_mm,
   724							  gfp);
   725			if (error) {
   726				if (PageTransHuge(page)) {
   727					count_vm_event(THP_FILE_FALLBACK);
   728					count_vm_event(THP_FILE_FALLBACK_CHARGE);
   729				}
   730				goto error;
   731			}
   732		}
   733		cgroup_throttle_swaprate(page, gfp);
   734	
   735		do {
   736			void *entry;
   737			xas_lock_irq(&xas);
   738			entry = xas_find_conflict(&xas);
   739			if (entry != expected)
   740				xas_set_err(&xas, -EEXIST);
   741			xas_create_range(&xas);
   742			if (xas_error(&xas))
   743				goto unlock;
   744	next:
   745			xas_store(&xas, page);
   746			if (++i < nr) {
   747				xas_next(&xas);
   748				goto next;
   749			}
   750			if (PageTransHuge(page)) {
   751				count_vm_event(THP_FILE_ALLOC);
   752				__mod_lruvec_page_state(page, NR_SHMEM_THPS, nr);
   753			}
   754			mapping->nrpages += nr;
   755			__mod_lruvec_page_state(page, NR_FILE_PAGES, nr);
   756			__mod_lruvec_page_state(page, NR_SHMEM, nr);
   757	unlock:
   758			xas_unlock_irq(&xas);
   759		} while (xas_nomem(&xas, gfp));
   760	
   761		if (xas_error(&xas)) {
   762			error = xas_error(&xas);
   763			goto error;
   764		}
   765	
   766		return 0;
   767	error:
   768		page->mapping = NULL;
   769		page_ref_sub(page, nr);
   770		return error;
   771	}
   772	

---
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: 20057 bytes --]

  parent reply	other threads:[~2021-11-11 17:17 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20211110211951.3730787-1-almasrymina@google.com>
2021-11-10 21:19 ` Mina Almasry
2021-11-11 16:53   ` kernel test robot
2021-11-11 17:16   ` kernel test robot [this message]
2021-11-10 21:19 ` [PATCH v2 2/4] mm/oom: handle remote ooms Mina Almasry
2021-11-11 17:15   ` kernel test robot
2021-11-10 21:19 ` [PATCH v2 3/4] mm, shmem: add tmpfs memcg= option documentation Mina Almasry
2021-11-10 21:19 ` [PATCH v2 4/4] mm, shmem, selftests: add tmpfs memcg= mount option tests Mina Almasry

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=202111120132.Ujj6m5cb-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=akpm@linux-foundation.org \
    --cc=almasrymina@google.com \
    --cc=david@fromorbit.com \
    --cc=gthelen@google.com \
    --cc=guro@fb.com \
    --cc=hughd@google.com \
    --cc=kbuild-all@lists.01.org \
    --cc=linux-mm@kvack.org \
    --cc=mhocko@suse.com \
    --cc=shakeelb@google.com \
    --cc=tytso@mit.edu \
    /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