All of lore.kernel.org
 help / color / mirror / Atom feed
From: kbuild test robot <lkp@intel.com>
Cc: Roger He <Hongbo.He@amd.com>,
	kbuild-all@01.org, dri-devel@lists.freedesktop.org,
	Christian.Koenig@amd.com
Subject: Re: [PATCH] drm/ttm: check if free mem space is under the lower limit
Date: Fri, 23 Feb 2018 16:49:26 +0800	[thread overview]
Message-ID: <201802231613.PohJ8Xii%fengguang.wu@intel.com> (raw)
In-Reply-To: <1519294251-2297-1-git-send-email-Hongbo.He@amd.com>

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

Hi Roger,

I love your patch! Perhaps something to improve:

[auto build test WARNING on drm/drm-next]
[also build test WARNING on v4.16-rc2 next-20180223]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Roger-He/drm-ttm-check-if-free-mem-space-is-under-the-lower-limit/20180223-132039
base:   git://people.freedesktop.org/~airlied/linux.git drm-next
config: i386-randconfig-b0-02231423 (attached as .config)
compiler: gcc-4.9 (Debian 4.9.4-2) 4.9.4
reproduce:
        # save the attached .config to linux build tree
        make ARCH=i386 

All warnings (new ones prefixed by >>):

   In file included from include/linux/kernel.h:10:0,
                    from include/linux/list.h:9,
                    from include/linux/timer.h:5,
                    from include/linux/workqueue.h:9,
                    from include/drm/ttm/ttm_memory.h:31,
                    from drivers/gpu/drm/ttm/ttm_memory.c:30:
   drivers/gpu/drm/ttm/ttm_memory.c: In function 'ttm_check_under_lowerlimit':
   drivers/gpu/drm/ttm/ttm_memory.c:554:9: error: 'struct ttm_operation_ctx' has no member named 'flags'
     if (ctx->flags & TTM_OPT_FLAG_FORCE_ALLOC)
            ^
   include/linux/compiler.h:58:30: note: in definition of macro '__trace_if'
     if (__builtin_constant_p(!!(cond)) ? !!(cond) :   \
                                 ^
>> drivers/gpu/drm/ttm/ttm_memory.c:554:2: note: in expansion of macro 'if'
     if (ctx->flags & TTM_OPT_FLAG_FORCE_ALLOC)
     ^
   drivers/gpu/drm/ttm/ttm_memory.c:554:19: error: 'TTM_OPT_FLAG_FORCE_ALLOC' undeclared (first use in this function)
     if (ctx->flags & TTM_OPT_FLAG_FORCE_ALLOC)
                      ^
   include/linux/compiler.h:58:30: note: in definition of macro '__trace_if'
     if (__builtin_constant_p(!!(cond)) ? !!(cond) :   \
                                 ^
>> drivers/gpu/drm/ttm/ttm_memory.c:554:2: note: in expansion of macro 'if'
     if (ctx->flags & TTM_OPT_FLAG_FORCE_ALLOC)
     ^
   drivers/gpu/drm/ttm/ttm_memory.c:554:19: note: each undeclared identifier is reported only once for each function it appears in
     if (ctx->flags & TTM_OPT_FLAG_FORCE_ALLOC)
                      ^
   include/linux/compiler.h:58:30: note: in definition of macro '__trace_if'
     if (__builtin_constant_p(!!(cond)) ? !!(cond) :   \
                                 ^
>> drivers/gpu/drm/ttm/ttm_memory.c:554:2: note: in expansion of macro 'if'
     if (ctx->flags & TTM_OPT_FLAG_FORCE_ALLOC)
     ^
   drivers/gpu/drm/ttm/ttm_memory.c:554:9: error: 'struct ttm_operation_ctx' has no member named 'flags'
     if (ctx->flags & TTM_OPT_FLAG_FORCE_ALLOC)
            ^
   include/linux/compiler.h:58:42: note: in definition of macro '__trace_if'
     if (__builtin_constant_p(!!(cond)) ? !!(cond) :   \
                                             ^
>> drivers/gpu/drm/ttm/ttm_memory.c:554:2: note: in expansion of macro 'if'
     if (ctx->flags & TTM_OPT_FLAG_FORCE_ALLOC)
     ^
   drivers/gpu/drm/ttm/ttm_memory.c:554:9: error: 'struct ttm_operation_ctx' has no member named 'flags'
     if (ctx->flags & TTM_OPT_FLAG_FORCE_ALLOC)
            ^
   include/linux/compiler.h:69:16: note: in definition of macro '__trace_if'
      ______r = !!(cond);     \
                   ^
>> drivers/gpu/drm/ttm/ttm_memory.c:554:2: note: in expansion of macro 'if'
     if (ctx->flags & TTM_OPT_FLAG_FORCE_ALLOC)
     ^

vim +/if +554 drivers/gpu/drm/ttm/ttm_memory.c

   535	
   536	/*
   537	 * check if the available mem is under lower memory limit
   538	 *
   539	 * a. if no swap disk at all or free swap space is under swap_mem_limit
   540	 * but available system mem is bigger than sys_mem_limit, allow TTM
   541	 * allocation;
   542	 *
   543	 * b. if the available system mem is less than sys_mem_limit but free
   544	 * swap disk is bigger than swap_mem_limit, allow TTM allocation.
   545	 */
   546	bool
   547	ttm_check_under_lowerlimit(struct ttm_mem_global *glob,
   548				uint64_t num_pages,
   549				struct ttm_operation_ctx *ctx)
   550	{
   551		bool ret = false;
   552		int64_t available;
   553	
 > 554		if (ctx->flags & TTM_OPT_FLAG_FORCE_ALLOC)
   555			return false;
   556	
   557		available = get_nr_swap_pages() + si_mem_available();
   558		available -= num_pages;
   559		if (available < glob->lower_mem_limit)
   560			ret = true;
   561	
   562		return ret;
   563	}
   564	EXPORT_SYMBOL(ttm_check_under_lowerlimit);
   565	

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

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

[-- Attachment #3: Type: text/plain, Size: 160 bytes --]

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  parent reply	other threads:[~2018-02-23  8:50 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-22 10:10 [PATCH] drm/ttm: check if free mem space is under the lower limit Roger He
2018-02-22 11:27 ` Christian König
2018-02-22 11:43   ` He, Roger
2018-02-22 12:54     ` Christian König
2018-02-23  2:18       ` He, Roger
2018-02-23  7:30         ` Christian König
2018-02-22 14:05     ` Alex Deucher
2018-02-23  3:46       ` He, Roger
2018-02-23  5:46 ` kbuild test robot
2018-02-23  8:49 ` kbuild test robot [this message]
2018-02-23 10:19 Roger He
2018-02-23 10:24 ` Christian König
2018-02-24 23:35 ` kbuild test robot

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=201802231613.PohJ8Xii%fengguang.wu@intel.com \
    --to=lkp@intel.com \
    --cc=Christian.Koenig@amd.com \
    --cc=Hongbo.He@amd.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=kbuild-all@01.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 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.