linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: kbuild test robot <lkp@intel.com>
To: Arun KS <arunks@codeaurora.org>
Cc: kbuild-all@01.org, akpm@linux-foundation.org,
	keescook@chromium.org, khlebnikov@yandex-team.ru,
	minchan@kernel.org, mhocko@kernel.org, vbabka@suse.cz,
	osalvador@suse.de, linux-kernel@vger.kernel.org,
	linux-mm@kvack.org, getarunks@gmail.com
Subject: Re: [PATCH v2 3/4] mm: convert totalram_pages and totalhigh_pages variables to atomic
Date: Thu, 8 Nov 2018 04:07:18 +0800	[thread overview]
Message-ID: <201811080403.97vQBPoO%fengguang.wu@intel.com> (raw)
In-Reply-To: <1541521310-28739-4-git-send-email-arunks@codeaurora.org>

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

Hi Arun,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on linus/master]
[also build test ERROR on v4.20-rc1 next-20181107]
[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/Arun-KS/mm-Fix-multiple-evaluvations-of-totalram_pages-and-managed_pages/20181108-025657
config: x86_64-randconfig-x018-201844 (attached as .config)
compiler: gcc-7 (Debian 7.3.0-1) 7.3.0
reproduce:
        # save the attached .config to linux build tree
        make ARCH=x86_64 

All error/warnings (new ones prefixed by >>):

   In file included from include/asm-generic/bug.h:5:0,
                    from arch/x86/include/asm/bug.h:47,
                    from include/linux/bug.h:5,
                    from include/linux/mmdebug.h:5,
                    from include/linux/gfp.h:5,
                    from mm/kasan/quarantine.c:20:
   mm/kasan/quarantine.c: In function 'quarantine_reduce':
>> include/linux/compiler.h:246:20: error: lvalue required as unary '&' operand
      __read_once_size(&(x), __u.__c, sizeof(x));  \
                       ^
>> include/linux/compiler.h:252:22: note: in expansion of macro '__READ_ONCE'
    #define READ_ONCE(x) __READ_ONCE(x, 1)
                         ^~~~~~~~~~~
>> mm/kasan/quarantine.c:239:16: note: in expansion of macro 'READ_ONCE'
     total_size = (READ_ONCE(totalram_pages()) << PAGE_SHIFT) /
                   ^~~~~~~~~
   include/linux/compiler.h:248:28: error: lvalue required as unary '&' operand
      __read_once_size_nocheck(&(x), __u.__c, sizeof(x)); \
                               ^
>> include/linux/compiler.h:252:22: note: in expansion of macro '__READ_ONCE'
    #define READ_ONCE(x) __READ_ONCE(x, 1)
                         ^~~~~~~~~~~
>> mm/kasan/quarantine.c:239:16: note: in expansion of macro 'READ_ONCE'
     total_size = (READ_ONCE(totalram_pages()) << PAGE_SHIFT) /
                   ^~~~~~~~~
--
   In file included from include/asm-generic/bug.h:5:0,
                    from arch/x86/include/asm/bug.h:47,
                    from include/linux/bug.h:5,
                    from include/linux/mmdebug.h:5,
                    from include/linux/gfp.h:5,
                    from mm//kasan/quarantine.c:20:
   mm//kasan/quarantine.c: In function 'quarantine_reduce':
>> include/linux/compiler.h:246:20: error: lvalue required as unary '&' operand
      __read_once_size(&(x), __u.__c, sizeof(x));  \
                       ^
>> include/linux/compiler.h:252:22: note: in expansion of macro '__READ_ONCE'
    #define READ_ONCE(x) __READ_ONCE(x, 1)
                         ^~~~~~~~~~~
   mm//kasan/quarantine.c:239:16: note: in expansion of macro 'READ_ONCE'
     total_size = (READ_ONCE(totalram_pages()) << PAGE_SHIFT) /
                   ^~~~~~~~~
   include/linux/compiler.h:248:28: error: lvalue required as unary '&' operand
      __read_once_size_nocheck(&(x), __u.__c, sizeof(x)); \
                               ^
>> include/linux/compiler.h:252:22: note: in expansion of macro '__READ_ONCE'
    #define READ_ONCE(x) __READ_ONCE(x, 1)
                         ^~~~~~~~~~~
   mm//kasan/quarantine.c:239:16: note: in expansion of macro 'READ_ONCE'
     total_size = (READ_ONCE(totalram_pages()) << PAGE_SHIFT) /
                   ^~~~~~~~~

vim +/READ_ONCE +239 mm/kasan/quarantine.c

   211	
   212	void quarantine_reduce(void)
   213	{
   214		size_t total_size, new_quarantine_size, percpu_quarantines;
   215		unsigned long flags;
   216		int srcu_idx;
   217		struct qlist_head to_free = QLIST_INIT;
   218	
   219		if (likely(READ_ONCE(quarantine_size) <=
   220			   READ_ONCE(quarantine_max_size)))
   221			return;
   222	
   223		/*
   224		 * srcu critical section ensures that quarantine_remove_cache()
   225		 * will not miss objects belonging to the cache while they are in our
   226		 * local to_free list. srcu is chosen because (1) it gives us private
   227		 * grace period domain that does not interfere with anything else,
   228		 * and (2) it allows synchronize_srcu() to return without waiting
   229		 * if there are no pending read critical sections (which is the
   230		 * expected case).
   231		 */
   232		srcu_idx = srcu_read_lock(&remove_cache_srcu);
   233		raw_spin_lock_irqsave(&quarantine_lock, flags);
   234	
   235		/*
   236		 * Update quarantine size in case of hotplug. Allocate a fraction of
   237		 * the installed memory to quarantine minus per-cpu queue limits.
   238		 */
 > 239		total_size = (READ_ONCE(totalram_pages()) << PAGE_SHIFT) /
   240			QUARANTINE_FRACTION;
   241		percpu_quarantines = QUARANTINE_PERCPU_SIZE * num_online_cpus();
   242		new_quarantine_size = (total_size < percpu_quarantines) ?
   243			0 : total_size - percpu_quarantines;
   244		WRITE_ONCE(quarantine_max_size, new_quarantine_size);
   245		/* Aim at consuming at most 1/2 of slots in quarantine. */
   246		WRITE_ONCE(quarantine_batch_size, max((size_t)QUARANTINE_PERCPU_SIZE,
   247			2 * total_size / QUARANTINE_BATCHES));
   248	
   249		if (likely(quarantine_size > quarantine_max_size)) {
   250			qlist_move_all(&global_quarantine[quarantine_head], &to_free);
   251			WRITE_ONCE(quarantine_size, quarantine_size - to_free.bytes);
   252			quarantine_head++;
   253			if (quarantine_head == QUARANTINE_BATCHES)
   254				quarantine_head = 0;
   255		}
   256	
   257		raw_spin_unlock_irqrestore(&quarantine_lock, flags);
   258	
   259		qlist_free_all(&to_free, NULL);
   260		srcu_read_unlock(&remove_cache_srcu, srcu_idx);
   261	}
   262	

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

  parent reply	other threads:[~2018-11-07 20:07 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-06 16:21 [PATCH v2 0/4] mm: convert totalram_pages, totalhigh_pages and managed pages to atomic Arun KS
2018-11-06 16:21 ` [PATCH v2 1/4] mm: Fix multiple evaluvations of totalram_pages and managed_pages Arun KS
2018-11-07  8:20   ` Michal Hocko
2018-11-07  8:44     ` Vlastimil Babka
2018-11-07  9:23       ` Michal Hocko
2018-11-07 19:54   ` kbuild test robot
2018-11-07 20:07   ` kbuild test robot
2018-11-06 16:21 ` [PATCH v2 2/4] mm: Convert zone->managed_pages to atomic variable Arun KS
2018-11-07  8:57   ` Vlastimil Babka
2018-11-06 16:21 ` [PATCH v2 3/4] mm: convert totalram_pages and totalhigh_pages variables to atomic Arun KS
2018-11-07  9:04   ` Vlastimil Babka
2018-11-08  7:23     ` Arun KS
2018-11-07 20:07   ` kbuild test robot [this message]
2018-11-07 20:24   ` kbuild test robot
2018-11-06 16:21 ` [PATCH v2 4/4] mm: Remove managed_page_count spinlock Arun KS
2018-11-07 21:26   ` 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=201811080403.97vQBPoO%fengguang.wu@intel.com \
    --to=lkp@intel.com \
    --cc=akpm@linux-foundation.org \
    --cc=arunks@codeaurora.org \
    --cc=getarunks@gmail.com \
    --cc=kbuild-all@01.org \
    --cc=keescook@chromium.org \
    --cc=khlebnikov@yandex-team.ru \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mhocko@kernel.org \
    --cc=minchan@kernel.org \
    --cc=osalvador@suse.de \
    --cc=vbabka@suse.cz \
    /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).