linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: David Hildenbrand <david@redhat.com>, linux-kernel@vger.kernel.org
Cc: kbuild-all@lists.01.org, linux-s390@vger.kernel.org,
	linux-mm@kvack.org, David Hildenbrand <david@redhat.com>,
	Heiko Carstens <heiko.carstens@de.ibm.com>,
	Vasily Gorbik <gor@linux.ibm.com>,
	Christian Borntraeger <borntraeger@de.ibm.com>,
	Gerald Schaefer <gerald.schaefer@de.ibm.com>
Subject: Re: [PATCH v1 4/9] s390/vmemmap: cleanup when vmemmap_populate() fails
Date: Sat, 4 Jul 2020 01:09:04 +0800	[thread overview]
Message-ID: <202007040129.TlExXvvF%lkp@intel.com> (raw)
In-Reply-To: <20200703133917.39045-5-david@redhat.com>

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

Hi David,

I love your patch! Yet something to improve:

[auto build test ERROR on s390/features]
[also build test ERROR on next-20200703]
[cannot apply to linux/master kvms390/next linus/master v5.8-rc3]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use  as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/David-Hildenbrand/s390-implement-and-optimize-vmemmap_free/20200703-214348
base:   https://git.kernel.org/pub/scm/linux/kernel/git/s390/linux.git features
config: s390-alldefconfig (attached as .config)
compiler: s390-linux-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
        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
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=s390 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

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

   arch/s390/mm/vmem.c: In function 'vmemmap_populate':
>> arch/s390/mm/vmem.c:368:3: error: implicit declaration of function 'vmemmap_free'; did you mean 'vmem_altmap_free'? [-Werror=implicit-function-declaration]
     368 |   vmemmap_free(start, end, altmap);
         |   ^~~~~~~~~~~~
         |   vmem_altmap_free
   arch/s390/mm/vmem.c: At top level:
   arch/s390/mm/vmem.c:372:6: warning: no previous prototype for 'vmemmap_free' [-Wmissing-prototypes]
     372 | void vmemmap_free(unsigned long start, unsigned long end,
         |      ^~~~~~~~~~~~
>> arch/s390/mm/vmem.c:372:6: warning: conflicting types for 'vmemmap_free'
   arch/s390/mm/vmem.c:368:3: note: previous implicit declaration of 'vmemmap_free' was here
     368 |   vmemmap_free(start, end, altmap);
         |   ^~~~~~~~~~~~
   cc1: some warnings being treated as errors

vim +368 arch/s390/mm/vmem.c

   280	
   281	/*
   282	 * Add a backed mem_map array to the virtual mem_map array.
   283	 */
   284	int __meminit vmemmap_populate(unsigned long start, unsigned long end, int node,
   285			struct vmem_altmap *altmap)
   286	{
   287		unsigned long pgt_prot, sgt_prot;
   288		unsigned long address = start;
   289		pgd_t *pg_dir;
   290		p4d_t *p4_dir;
   291		pud_t *pu_dir;
   292		pmd_t *pm_dir;
   293		pte_t *pt_dir;
   294		int ret = -ENOMEM;
   295	
   296		pgt_prot = pgprot_val(PAGE_KERNEL);
   297		sgt_prot = pgprot_val(SEGMENT_KERNEL);
   298		if (!MACHINE_HAS_NX) {
   299			pgt_prot &= ~_PAGE_NOEXEC;
   300			sgt_prot &= ~_SEGMENT_ENTRY_NOEXEC;
   301		}
   302		for (address = start; address < end;) {
   303			pg_dir = pgd_offset_k(address);
   304			if (pgd_none(*pg_dir)) {
   305				p4_dir = vmem_crst_alloc(_REGION2_ENTRY_EMPTY);
   306				if (!p4_dir)
   307					goto out;
   308				pgd_populate(&init_mm, pg_dir, p4_dir);
   309			}
   310	
   311			p4_dir = p4d_offset(pg_dir, address);
   312			if (p4d_none(*p4_dir)) {
   313				pu_dir = vmem_crst_alloc(_REGION3_ENTRY_EMPTY);
   314				if (!pu_dir)
   315					goto out;
   316				p4d_populate(&init_mm, p4_dir, pu_dir);
   317			}
   318	
   319			pu_dir = pud_offset(p4_dir, address);
   320			if (pud_none(*pu_dir)) {
   321				pm_dir = vmem_crst_alloc(_SEGMENT_ENTRY_EMPTY);
   322				if (!pm_dir)
   323					goto out;
   324				pud_populate(&init_mm, pu_dir, pm_dir);
   325			}
   326	
   327			pm_dir = pmd_offset(pu_dir, address);
   328			if (pmd_none(*pm_dir)) {
   329				/* Use 1MB frames for vmemmap if available. We always
   330				 * use large frames even if they are only partially
   331				 * used.
   332				 * Otherwise we would have also page tables since
   333				 * vmemmap_populate gets called for each section
   334				 * separately. */
   335				if (MACHINE_HAS_EDAT1) {
   336					void *new_page;
   337	
   338					new_page = vmemmap_alloc_block(PMD_SIZE, node);
   339					if (!new_page)
   340						goto out;
   341					pmd_val(*pm_dir) = __pa(new_page) | sgt_prot;
   342					address = (address + PMD_SIZE) & PMD_MASK;
   343					continue;
   344				}
   345				pt_dir = vmem_pte_alloc();
   346				if (!pt_dir)
   347					goto out;
   348				pmd_populate(&init_mm, pm_dir, pt_dir);
   349			} else if (pmd_large(*pm_dir)) {
   350				address = (address + PMD_SIZE) & PMD_MASK;
   351				continue;
   352			}
   353	
   354			pt_dir = pte_offset_kernel(pm_dir, address);
   355			if (pte_none(*pt_dir)) {
   356				void *new_page;
   357	
   358				new_page = vmemmap_alloc_block(PAGE_SIZE, node);
   359				if (!new_page)
   360					goto out;
   361				pte_val(*pt_dir) = __pa(new_page) | pgt_prot;
   362			}
   363			address += PAGE_SIZE;
   364		}
   365		ret = 0;
   366	out:
   367		if (ret)
 > 368			vmemmap_free(start, end, altmap);
   369		return ret;
   370	}
   371	
 > 372	void vmemmap_free(unsigned long start, unsigned long end,
   373			struct vmem_altmap *altmap)
   374	{
   375		remove_pagetable(start, end, false);
   376	}
   377	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

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

  reply	other threads:[~2020-07-03 17:10 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-03 13:39 [PATCH v1 0/9] s390: implement and optimize vmemmap_free() David Hildenbrand
2020-07-03 13:39 ` [PATCH v1 1/9] s390/vmem: rename vmem_add_mem() to vmem_add_range() David Hildenbrand
2020-07-03 13:39 ` [PATCH v1 2/9] s390/vmem: recursive implementation of vmem_remove_range() David Hildenbrand
2020-07-03 13:39 ` [PATCH v1 3/9] s390/vmemmap: implement vmemmap_free() David Hildenbrand
2020-07-03 13:39 ` [PATCH v1 4/9] s390/vmemmap: cleanup when vmemmap_populate() fails David Hildenbrand
2020-07-03 17:09   ` kernel test robot [this message]
2020-07-06  7:30     ` David Hildenbrand
2020-07-04 11:48   ` kernel test robot
2020-07-03 13:39 ` [PATCH v1 5/9] s390/vmemmap: take the vmem_mutex when populating/freeing David Hildenbrand
2020-07-03 13:39 ` [PATCH v1 6/9] s390/vmem: cleanup empty page tables David Hildenbrand
2020-07-03 13:39 ` [PATCH v1 7/9] s390/vmemmap: fallback to PTEs if mapping large PMD fails David Hildenbrand
2020-07-03 13:39 ` [PATCH v1 8/9] s390/vmemmap: remember unused sub-pmd ranges David Hildenbrand
2020-07-03 13:39 ` [PATCH v1 9/9] s390/vmemmap: avoid memset(PAGE_UNUSED) when adding consecutive sections David Hildenbrand
2020-07-03 15:48 ` [PATCH v1 0/9] s390: implement and optimize vmemmap_free() Heiko Carstens
2020-07-07 12:08 ` Heiko Carstens
2020-07-07 12:13   ` David Hildenbrand
2020-07-08  6:50     ` David Hildenbrand
2020-07-08 12:16       ` David Hildenbrand
2020-07-10 13:57         ` Heiko Carstens
2020-07-10 14:02           ` David Hildenbrand

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=202007040129.TlExXvvF%lkp@intel.com \
    --to=lkp@intel.com \
    --cc=borntraeger@de.ibm.com \
    --cc=david@redhat.com \
    --cc=gerald.schaefer@de.ibm.com \
    --cc=gor@linux.ibm.com \
    --cc=heiko.carstens@de.ibm.com \
    --cc=kbuild-all@lists.01.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=linux-s390@vger.kernel.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 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).