linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: kbuild test robot <lkp@intel.com>
To: David Rientjes <rientjes@google.com>
Cc: kbuild-all@01.org, Andrew Morton <akpm@linux-foundation.org>,
	Linux Memory Management List <linux-mm@kvack.org>
Subject: [vireshk-pm:opp/qcom-fix 8485/8905] mm/vmacache.c:14:39: error: 'PMD_SHIFT' undeclared; did you mean 'PUD_SHIFT'?
Date: Wed, 12 Sep 2018 21:50:43 +0800	[thread overview]
Message-ID: <201809122141.VULq7v3j%fengguang.wu@intel.com> (raw)

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

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/vireshk/pm.git opp/qcom-fix
head:   e570c000d1f81e380c9b8919fd84e215471f6cb9
commit: 5d2f33872046e7ffdd62dd80472cd466ea8407ac [8485/8905] mm, vmacache: hash addresses based on pmd
config: arm-allnoconfig (attached as .config)
compiler: arm-linux-gnueabi-gcc (Debian 7.2.0-11) 7.2.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        git checkout 5d2f33872046e7ffdd62dd80472cd466ea8407ac
        # save the attached .config to linux build tree
        GCC_VERSION=7.2.0 make.cross ARCH=arm 

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

   mm/vmacache.c: In function 'vmacache_update':
>> mm/vmacache.c:14:39: error: 'PMD_SHIFT' undeclared (first use in this function); did you mean 'PUD_SHIFT'?
    #define VMACACHE_HASH(addr) ((addr >> PMD_SHIFT) & VMACACHE_MASK)
                                          ^
>> mm/vmacache.c:71:26: note: in expansion of macro 'VMACACHE_HASH'
      current->vmacache.vmas[VMACACHE_HASH(addr)] = newvma;
                             ^~~~~~~~~~~~~
   mm/vmacache.c:14:39: note: each undeclared identifier is reported only once for each function it appears in
    #define VMACACHE_HASH(addr) ((addr >> PMD_SHIFT) & VMACACHE_MASK)
                                          ^
>> mm/vmacache.c:71:26: note: in expansion of macro 'VMACACHE_HASH'
      current->vmacache.vmas[VMACACHE_HASH(addr)] = newvma;
                             ^~~~~~~~~~~~~
   mm/vmacache.c: In function 'vmacache_find':
>> mm/vmacache.c:14:39: error: 'PMD_SHIFT' undeclared (first use in this function); did you mean 'PUD_SHIFT'?
    #define VMACACHE_HASH(addr) ((addr >> PMD_SHIFT) & VMACACHE_MASK)
                                          ^
   mm/vmacache.c:96:12: note: in expansion of macro 'VMACACHE_HASH'
     int idx = VMACACHE_HASH(addr);
               ^~~~~~~~~~~~~
   mm/vmacache.c: In function 'vmacache_find_exact':
   mm/vmacache.c:127:26: error: 'addr' undeclared (first use in this function)
     int idx = VMACACHE_HASH(addr);
                             ^
   mm/vmacache.c:14:31: note: in definition of macro 'VMACACHE_HASH'
    #define VMACACHE_HASH(addr) ((addr >> PMD_SHIFT) & VMACACHE_MASK)
                                  ^~~~
>> mm/vmacache.c:14:39: error: 'PMD_SHIFT' undeclared (first use in this function); did you mean 'PUD_SHIFT'?
    #define VMACACHE_HASH(addr) ((addr >> PMD_SHIFT) & VMACACHE_MASK)
                                          ^
   mm/vmacache.c:127:12: note: in expansion of macro 'VMACACHE_HASH'
     int idx = VMACACHE_HASH(addr);
               ^~~~~~~~~~~~~

vim +14 mm/vmacache.c

     9	
    10	/*
    11	 * Hash based on the pmd of addr.  Provides a good hit rate for workloads with
    12	 * spatial locality.
    13	 */
  > 14	#define VMACACHE_HASH(addr) ((addr >> PMD_SHIFT) & VMACACHE_MASK)
    15	
    16	/*
    17	 * Flush vma caches for threads that share a given mm.
    18	 *
    19	 * The operation is safe because the caller holds the mmap_sem
    20	 * exclusively and other threads accessing the vma cache will
    21	 * have mmap_sem held at least for read, so no extra locking
    22	 * is required to maintain the vma cache.
    23	 */
    24	void vmacache_flush_all(struct mm_struct *mm)
    25	{
    26		struct task_struct *g, *p;
    27	
    28		count_vm_vmacache_event(VMACACHE_FULL_FLUSHES);
    29	
    30		/*
    31		 * Single threaded tasks need not iterate the entire
    32		 * list of process. We can avoid the flushing as well
    33		 * since the mm's seqnum was increased and don't have
    34		 * to worry about other threads' seqnum. Current's
    35		 * flush will occur upon the next lookup.
    36		 */
    37		if (atomic_read(&mm->mm_users) == 1)
    38			return;
    39	
    40		rcu_read_lock();
    41		for_each_process_thread(g, p) {
    42			/*
    43			 * Only flush the vmacache pointers as the
    44			 * mm seqnum is already set and curr's will
    45			 * be set upon invalidation when the next
    46			 * lookup is done.
    47			 */
    48			if (mm == p->mm)
    49				vmacache_flush(p);
    50		}
    51		rcu_read_unlock();
    52	}
    53	
    54	/*
    55	 * This task may be accessing a foreign mm via (for example)
    56	 * get_user_pages()->find_vma().  The vmacache is task-local and this
    57	 * task's vmacache pertains to a different mm (ie, its own).  There is
    58	 * nothing we can do here.
    59	 *
    60	 * Also handle the case where a kernel thread has adopted this mm via use_mm().
    61	 * That kernel thread's vmacache is not applicable to this mm.
    62	 */
    63	static inline bool vmacache_valid_mm(struct mm_struct *mm)
    64	{
    65		return current->mm == mm && !(current->flags & PF_KTHREAD);
    66	}
    67	
    68	void vmacache_update(unsigned long addr, struct vm_area_struct *newvma)
    69	{
    70		if (vmacache_valid_mm(newvma->vm_mm))
  > 71			current->vmacache.vmas[VMACACHE_HASH(addr)] = newvma;
    72	}
    73	

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

                 reply	other threads:[~2018-09-12 13:51 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=201809122141.VULq7v3j%fengguang.wu@intel.com \
    --to=lkp@intel.com \
    --cc=akpm@linux-foundation.org \
    --cc=kbuild-all@01.org \
    --cc=linux-mm@kvack.org \
    --cc=rientjes@google.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox