linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: kbuild test robot <lkp@intel.com>
To: Matthew Wilcox <willy@infradead.org>
Cc: kbuild-all@01.org, linux-mm@kvack.org,
	Matthew Wilcox <mawilcox@microsoft.com>,
	Huang Ying <ying.huang@intel.com>
Subject: Re: [PATCH] mm: Report bad PTEs in lookup_swap_cache()
Date: Sun, 25 Feb 2018 14:27:30 +0800	[thread overview]
Message-ID: <201802251411.k44PMRqC%fengguang.wu@intel.com> (raw)
In-Reply-To: <20180223200341.17627-1-willy@infradead.org>

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

Hi Matthew,

I love your patch! Perhaps something to improve:

[auto build test WARNING on linus/master]
[also build test WARNING on v4.16-rc2]
[cannot apply to mmotm/master 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/Matthew-Wilcox/mm-Report-bad-PTEs-in-lookup_swap_cache/20180225-080318
config: mips-64r6el_defconfig (attached as .config)
compiler: mips64el-linux-gnuabi64-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
        # save the attached .config to linux build tree
        make.cross ARCH=mips 

All warnings (new ones prefixed by >>):

   In file included from arch/mips/include/asm/pgtable.h:17:0,
                    from include/linux/memremap.h:8,
                    from include/linux/mm.h:27,
                    from mm/swap_state.c:10:
   mm/swap_state.c: In function 'lookup_swap_cache':
>> arch/mips/include/asm/pgtable-64.h:160:9: warning: format '%lx' expects argument of type 'long unsigned int', but argument 4 has type 'long long unsigned int' [-Wformat=]
     printk("%s:%d: bad pte %016lx.\n", __FILE__, __LINE__, pte_val(e))
            ^
>> mm/swap_state.c:340:4: note: in expansion of macro 'pte_ERROR'
       pte_ERROR(vmf->orig_pte);
       ^~~~~~~~~

vim +/pte_ERROR +340 mm/swap_state.c

   324	
   325	/*
   326	 * Lookup a swap entry in the swap cache. A found page will be returned
   327	 * unlocked and with its refcount incremented - we rely on the kernel
   328	 * lock getting page table operations atomic even if we drop the page
   329	 * lock before returning.
   330	 */
   331	struct page *lookup_swap_cache(swp_entry_t entry, bool vma_ra,
   332				struct vm_fault *vmf)
   333	{
   334		struct page *page;
   335		int readahead;
   336		struct address_space *swapper_space = swap_address_space(entry);
   337	
   338		if (!swapper_space) {
   339			if (vmf)
 > 340				pte_ERROR(vmf->orig_pte);
   341			else
   342				pr_err("Bad swp_entry: %lx\n", entry.val);
   343			return NULL;
   344		}
   345	
   346		page = find_get_page(swapper_space, swp_offset(entry));
   347	
   348		INC_CACHE_INFO(find_total);
   349		if (page) {
   350			INC_CACHE_INFO(find_success);
   351			if (unlikely(PageTransCompound(page)))
   352				return page;
   353			readahead = TestClearPageReadahead(page);
   354			if (vma_ra) {
   355				unsigned long ra_info = GET_SWAP_RA_VAL(vmf->vma);
   356				int win = SWAP_RA_WIN(ra_info);
   357				int hits = SWAP_RA_HITS(ra_info);
   358	
   359				if (readahead)
   360					hits = min_t(int, hits + 1, SWAP_RA_HITS_MAX);
   361				atomic_long_set(&vmf->vma->swap_readahead_info,
   362						SWAP_RA_VAL(vmf->address, win, hits));
   363			}
   364			if (readahead) {
   365				count_vm_event(SWAP_RA_HIT);
   366				if (!vma_ra)
   367					atomic_inc(&swapin_readahead_hits);
   368			}
   369		}
   370		return page;
   371	}
   372	

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

      parent reply	other threads:[~2018-02-25  6:28 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-23 20:03 Matthew Wilcox
2018-02-24  0:49 ` Huang, Ying
2018-02-25  4:43 ` kbuild test robot
2018-02-25  6:27 ` kbuild test robot [this message]

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=201802251411.k44PMRqC%fengguang.wu@intel.com \
    --to=lkp@intel.com \
    --cc=kbuild-all@01.org \
    --cc=linux-mm@kvack.org \
    --cc=mawilcox@microsoft.com \
    --cc=willy@infradead.org \
    --cc=ying.huang@intel.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