Re: [PATCH] mm: Report bad PTEs in lookup_swap_cache()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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: .config.gz
Description: application/gzip


[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux