All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: ultrachin@163.com, linux-kernel@vger.kernel.org
Cc: kbuild-all@lists.01.org, akpm@linux-foundation.org,
	hannes@cmpxchg.org, mhocko@kernel.org, vdavydov.dev@gmail.com,
	linux-mm@kvack.org, cgroups@vger.kernel.org,
	Chen Xiaoguang <xiaoggchen@tencent.com>,
	Chen He <heddchen@tencent.com>
Subject: Re: [PATCH] mm: optimize memory allocation
Date: Mon, 12 Apr 2021 19:28:55 +0800	[thread overview]
Message-ID: <202104121938.wSalcfXv-lkp@intel.com> (raw)
In-Reply-To: <1618213793-17741-1-git-send-email-ultrachin@163.com>

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

Hi,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on linux/master]
[also build test ERROR on linus/master v5.12-rc7]
[cannot apply to hnaz-linux-mm/master next-20210409]
[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/ultrachin-163-com/mm-optimize-memory-allocation/20210412-155259
base:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 5e46d1b78a03d52306f21f77a4e4a144b6d31486
config: openrisc-randconfig-r032-20210412 (attached as .config)
compiler: or1k-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/6994280da115271cf4083439e5d4dcdb3ce00720
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review ultrachin-163-com/mm-optimize-memory-allocation/20210412-155259
        git checkout 6994280da115271cf4083439e5d4dcdb3ce00720
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=openrisc 

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/page_alloc.c:3605:15: warning: no previous prototype for 'should_fail_alloc_page' [-Wmissing-prototypes]
    3605 | noinline bool should_fail_alloc_page(gfp_t gfp_mask, unsigned int order)
         |               ^~~~~~~~~~~~~~~~~~~~~~
   mm/page_alloc.c: In function '__alloc_pages_nodemask':
   mm/page_alloc.c:4992:10: error: implicit declaration of function 'get_mem_cgroup_from_current'; did you mean 'get_mem_cgroup_from_mm'? [-Werror=implicit-function-declaration]
    4992 |  memcg = get_mem_cgroup_from_current();
         |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~
         |          get_mem_cgroup_from_mm
   mm/page_alloc.c:4992:8: warning: assignment to 'struct mem_cgroup *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
    4992 |  memcg = get_mem_cgroup_from_current();
         |        ^
>> mm/page_alloc.c:4996:18: error: dereferencing pointer to incomplete type 'struct mem_cgroup'
    4996 |    css_put(&memcg->css);
         |                  ^~
>> mm/page_alloc.c:5035:7: error: 'struct page' has no member named 'memcg_data'
    5035 |   page->memcg_data = (unsigned long)memcg | MEMCG_DATA_KMEM;
         |       ^~
>> mm/page_alloc.c:5035:45: error: 'MEMCG_DATA_KMEM' undeclared (first use in this function)
    5035 |   page->memcg_data = (unsigned long)memcg | MEMCG_DATA_KMEM;
         |                                             ^~~~~~~~~~~~~~~
   mm/page_alloc.c:5035:45: note: each undeclared identifier is reported only once for each function it appears in
   cc1: some warnings being treated as errors


vim +4996 mm/page_alloc.c

  4967	
  4968	/*
  4969	 * This is the 'heart' of the zoned buddy allocator.
  4970	 */
  4971	struct page *
  4972	__alloc_pages_nodemask(gfp_t gfp_mask, unsigned int order, int preferred_nid,
  4973								nodemask_t *nodemask)
  4974	{
  4975		struct page *page;
  4976		unsigned int alloc_flags = ALLOC_WMARK_LOW;
  4977		gfp_t alloc_mask; /* The gfp_t that was actually used for allocation */
  4978		struct alloc_context ac = { };
  4979		struct mem_cgroup *memcg;
  4980		bool charged = false;
  4981	
  4982		/*
  4983		 * There are several places where we assume that the order value is sane
  4984		 * so bail out early if the request is out of bound.
  4985		 */
  4986		if (unlikely(order >= MAX_ORDER)) {
  4987			WARN_ON_ONCE(!(gfp_mask & __GFP_NOWARN));
  4988			return NULL;
  4989		}
  4990	
  4991		gfp_mask &= gfp_allowed_mask;
> 4992		memcg = get_mem_cgroup_from_current();
  4993		if (memcg && memcg_kmem_enabled() && (gfp_mask & __GFP_ACCOUNT) &&
  4994		    !mem_cgroup_is_root(memcg)) {
  4995			if (unlikely(__memcg_kmem_charge_page(memcg, gfp_mask, order) != 0)) {
> 4996				css_put(&memcg->css);
  4997				return NULL;
  4998			}
  4999			charged = true;
  5000		}
  5001		alloc_mask = gfp_mask;
  5002		if (!prepare_alloc_pages(gfp_mask, order, preferred_nid, nodemask, &ac, &alloc_mask, &alloc_flags))
  5003			return NULL;
  5004	
  5005		/*
  5006		 * Forbid the first pass from falling back to types that fragment
  5007		 * memory until all local zones are considered.
  5008		 */
  5009		alloc_flags |= alloc_flags_nofragment(ac.preferred_zoneref->zone, gfp_mask);
  5010	
  5011		/* First allocation attempt */
  5012		page = get_page_from_freelist(alloc_mask, order, alloc_flags, &ac);
  5013		if (likely(page))
  5014			goto out;
  5015	
  5016		/*
  5017		 * Apply scoped allocation constraints. This is mainly about GFP_NOFS
  5018		 * resp. GFP_NOIO which has to be inherited for all allocation requests
  5019		 * from a particular context which has been marked by
  5020		 * memalloc_no{fs,io}_{save,restore}.
  5021		 */
  5022		alloc_mask = current_gfp_context(gfp_mask);
  5023		ac.spread_dirty_pages = false;
  5024	
  5025		/*
  5026		 * Restore the original nodemask if it was potentially replaced with
  5027		 * &cpuset_current_mems_allowed to optimize the fast-path attempt.
  5028		 */
  5029		ac.nodemask = nodemask;
  5030	
  5031		page = __alloc_pages_slowpath(alloc_mask, order, &ac);
  5032	
  5033	out:
  5034		if (page && charged)
> 5035			page->memcg_data = (unsigned long)memcg | MEMCG_DATA_KMEM;
  5036		else if (charged)
  5037			__memcg_kmem_uncharge_page(NULL, order, memcg);
  5038	
  5039		trace_mm_page_alloc(page, order, alloc_mask, ac.migratetype);
  5040	
  5041		return page;
  5042	}
  5043	EXPORT_SYMBOL(__alloc_pages_nodemask);
  5044	

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

WARNING: multiple messages have this Message-ID (diff)
From: kernel test robot <lkp@intel.com>
To: kbuild-all@lists.01.org
Subject: Re: [PATCH] mm: optimize memory allocation
Date: Mon, 12 Apr 2021 19:28:55 +0800	[thread overview]
Message-ID: <202104121938.wSalcfXv-lkp@intel.com> (raw)
In-Reply-To: <1618213793-17741-1-git-send-email-ultrachin@163.com>

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

Hi,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on linux/master]
[also build test ERROR on linus/master v5.12-rc7]
[cannot apply to hnaz-linux-mm/master next-20210409]
[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/ultrachin-163-com/mm-optimize-memory-allocation/20210412-155259
base:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 5e46d1b78a03d52306f21f77a4e4a144b6d31486
config: openrisc-randconfig-r032-20210412 (attached as .config)
compiler: or1k-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/6994280da115271cf4083439e5d4dcdb3ce00720
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review ultrachin-163-com/mm-optimize-memory-allocation/20210412-155259
        git checkout 6994280da115271cf4083439e5d4dcdb3ce00720
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=openrisc 

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/page_alloc.c:3605:15: warning: no previous prototype for 'should_fail_alloc_page' [-Wmissing-prototypes]
    3605 | noinline bool should_fail_alloc_page(gfp_t gfp_mask, unsigned int order)
         |               ^~~~~~~~~~~~~~~~~~~~~~
   mm/page_alloc.c: In function '__alloc_pages_nodemask':
   mm/page_alloc.c:4992:10: error: implicit declaration of function 'get_mem_cgroup_from_current'; did you mean 'get_mem_cgroup_from_mm'? [-Werror=implicit-function-declaration]
    4992 |  memcg = get_mem_cgroup_from_current();
         |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~
         |          get_mem_cgroup_from_mm
   mm/page_alloc.c:4992:8: warning: assignment to 'struct mem_cgroup *' from 'int' makes pointer from integer without a cast [-Wint-conversion]
    4992 |  memcg = get_mem_cgroup_from_current();
         |        ^
>> mm/page_alloc.c:4996:18: error: dereferencing pointer to incomplete type 'struct mem_cgroup'
    4996 |    css_put(&memcg->css);
         |                  ^~
>> mm/page_alloc.c:5035:7: error: 'struct page' has no member named 'memcg_data'
    5035 |   page->memcg_data = (unsigned long)memcg | MEMCG_DATA_KMEM;
         |       ^~
>> mm/page_alloc.c:5035:45: error: 'MEMCG_DATA_KMEM' undeclared (first use in this function)
    5035 |   page->memcg_data = (unsigned long)memcg | MEMCG_DATA_KMEM;
         |                                             ^~~~~~~~~~~~~~~
   mm/page_alloc.c:5035:45: note: each undeclared identifier is reported only once for each function it appears in
   cc1: some warnings being treated as errors


vim +4996 mm/page_alloc.c

  4967	
  4968	/*
  4969	 * This is the 'heart' of the zoned buddy allocator.
  4970	 */
  4971	struct page *
  4972	__alloc_pages_nodemask(gfp_t gfp_mask, unsigned int order, int preferred_nid,
  4973								nodemask_t *nodemask)
  4974	{
  4975		struct page *page;
  4976		unsigned int alloc_flags = ALLOC_WMARK_LOW;
  4977		gfp_t alloc_mask; /* The gfp_t that was actually used for allocation */
  4978		struct alloc_context ac = { };
  4979		struct mem_cgroup *memcg;
  4980		bool charged = false;
  4981	
  4982		/*
  4983		 * There are several places where we assume that the order value is sane
  4984		 * so bail out early if the request is out of bound.
  4985		 */
  4986		if (unlikely(order >= MAX_ORDER)) {
  4987			WARN_ON_ONCE(!(gfp_mask & __GFP_NOWARN));
  4988			return NULL;
  4989		}
  4990	
  4991		gfp_mask &= gfp_allowed_mask;
> 4992		memcg = get_mem_cgroup_from_current();
  4993		if (memcg && memcg_kmem_enabled() && (gfp_mask & __GFP_ACCOUNT) &&
  4994		    !mem_cgroup_is_root(memcg)) {
  4995			if (unlikely(__memcg_kmem_charge_page(memcg, gfp_mask, order) != 0)) {
> 4996				css_put(&memcg->css);
  4997				return NULL;
  4998			}
  4999			charged = true;
  5000		}
  5001		alloc_mask = gfp_mask;
  5002		if (!prepare_alloc_pages(gfp_mask, order, preferred_nid, nodemask, &ac, &alloc_mask, &alloc_flags))
  5003			return NULL;
  5004	
  5005		/*
  5006		 * Forbid the first pass from falling back to types that fragment
  5007		 * memory until all local zones are considered.
  5008		 */
  5009		alloc_flags |= alloc_flags_nofragment(ac.preferred_zoneref->zone, gfp_mask);
  5010	
  5011		/* First allocation attempt */
  5012		page = get_page_from_freelist(alloc_mask, order, alloc_flags, &ac);
  5013		if (likely(page))
  5014			goto out;
  5015	
  5016		/*
  5017		 * Apply scoped allocation constraints. This is mainly about GFP_NOFS
  5018		 * resp. GFP_NOIO which has to be inherited for all allocation requests
  5019		 * from a particular context which has been marked by
  5020		 * memalloc_no{fs,io}_{save,restore}.
  5021		 */
  5022		alloc_mask = current_gfp_context(gfp_mask);
  5023		ac.spread_dirty_pages = false;
  5024	
  5025		/*
  5026		 * Restore the original nodemask if it was potentially replaced with
  5027		 * &cpuset_current_mems_allowed to optimize the fast-path attempt.
  5028		 */
  5029		ac.nodemask = nodemask;
  5030	
  5031		page = __alloc_pages_slowpath(alloc_mask, order, &ac);
  5032	
  5033	out:
  5034		if (page && charged)
> 5035			page->memcg_data = (unsigned long)memcg | MEMCG_DATA_KMEM;
  5036		else if (charged)
  5037			__memcg_kmem_uncharge_page(NULL, order, memcg);
  5038	
  5039		trace_mm_page_alloc(page, order, alloc_mask, ac.migratetype);
  5040	
  5041		return page;
  5042	}
  5043	EXPORT_SYMBOL(__alloc_pages_nodemask);
  5044	

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

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

  reply	other threads:[~2021-04-12 11:28 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-12  7:49 [PATCH] mm: optimize memory allocation ultrachin-9Onoh4P/yGk
2021-04-12  7:49 ` ultrachin
2021-04-12 11:28 ` kernel test robot [this message]
2021-04-12 11:28   ` kernel test robot
     [not found] ` <1618213793-17741-1-git-send-email-ultrachin-9Onoh4P/yGk@public.gmane.org>
2021-04-12 11:36   ` kernel test robot
2021-04-12 11:36     ` kernel test robot
2021-04-12 11:36     ` kernel test robot
2021-04-13  6:56   ` Michal Hocko
2021-04-13  6:56     ` Michal Hocko

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=202104121938.wSalcfXv-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=akpm@linux-foundation.org \
    --cc=cgroups@vger.kernel.org \
    --cc=hannes@cmpxchg.org \
    --cc=heddchen@tencent.com \
    --cc=kbuild-all@lists.01.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mhocko@kernel.org \
    --cc=ultrachin@163.com \
    --cc=vdavydov.dev@gmail.com \
    --cc=xiaoggchen@tencent.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.