All of lore.kernel.org
 help / color / mirror / Atom feed
* [rppt:unmapped-alloc/rfc-v2 1/3] mm/unmapped-alloc.c:150:14: warning: no previous prototype for function 'unmapped_pages_alloc'
@ 2023-05-27  1:50 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2023-05-27  1:50 UTC (permalink / raw)
  To: Mike Rapoport (IBM); +Cc: llvm, oe-kbuild-all, Mike Rapoport

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/rppt/linux.git unmapped-alloc/rfc-v2
head:   e55ecf7bdeeb7ef51b93089d7926303e8259641a
commit: c4d7927daa7a7ecd012b341e96b4d22b415c7189 [1/3] mm: intorduce unmapped_alloc()
config: x86_64-randconfig-x062-20230526 (https://download.01.org/0day-ci/archive/20230527/202305270935.G4Pfcajm-lkp@intel.com/config)
compiler: clang version 14.0.6 (https://github.com/llvm/llvm-project f28c006a5895fc0e329fe15fead81e37457cb1d1)
reproduce (this is a W=1 build):
        mkdir -p ~/bin
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://git.kernel.org/pub/scm/linux/kernel/git/rppt/linux.git/commit/?id=c4d7927daa7a7ecd012b341e96b4d22b415c7189
        git remote add rppt https://git.kernel.org/pub/scm/linux/kernel/git/rppt/linux.git
        git fetch --no-tags rppt unmapped-alloc/rfc-v2
        git checkout c4d7927daa7a7ecd012b341e96b4d22b415c7189
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang ~/bin/make.cross W=1 O=build_dir ARCH=x86_64 olddefconfig
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang ~/bin/make.cross W=1 O=build_dir ARCH=x86_64 SHELL=/bin/bash

If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202305270935.G4Pfcajm-lkp@intel.com/

All warnings (new ones prefixed by >>):

>> mm/unmapped-alloc.c:150:14: warning: no previous prototype for function 'unmapped_pages_alloc' [-Wmissing-prototypes]
   struct page *unmapped_pages_alloc(gfp_t gfp, int order)
                ^
   mm/unmapped-alloc.c:150:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
   struct page *unmapped_pages_alloc(gfp_t gfp, int order)
   ^
   static 
>> mm/unmapped-alloc.c:198:6: warning: no previous prototype for function 'unmapped_pages_free' [-Wmissing-prototypes]
   void unmapped_pages_free(struct page *page, int order)
        ^
   mm/unmapped-alloc.c:198:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
   void unmapped_pages_free(struct page *page, int order)
   ^
   static 
   2 warnings generated.


vim +/unmapped_pages_alloc +150 mm/unmapped-alloc.c

   149	
 > 150	struct page *unmapped_pages_alloc(gfp_t gfp, int order)
   151	{
   152	
   153		int cache_order = PMD_ORDER;
   154		struct page *page;
   155	
   156		page = __rmqueue_smallest(order);
   157		if (page)
   158			goto out;
   159	
   160		while (cache_order >= order) {
   161			page = alloc_pages(gfp, cache_order);
   162			if (page)
   163				break;
   164			cache_order--;
   165		}
   166	
   167		if (page) {
   168			unsigned long addr = (unsigned long)page_address(page);
   169			unsigned long nr_pages = (1 << order);
   170			unsigned long size = PAGE_SIZE * nr_pages;
   171	
   172			/* FIXME: set_direct_map_invalid_noflush may fail */
   173			for (int i = 0; i < nr_pages; i++)
   174				set_direct_map_invalid_noflush(page + i);
   175	
   176			flush_tlb_kernel_range(addr, addr + size);
   177	
   178			/*
   179			 * FIXME: have this under lock so that allocation running
   180			 * in parallel won't steal all pages from the newly cached
   181			 * ones
   182			 */
   183			__free_one_page(page, cache_order, true);
   184			page = __rmqueue_smallest(order);
   185	
   186		}
   187	
   188	out:
   189		if (page) {
   190			/* FIXME: __prep_new_page() expects page count of 0 */
   191			set_page_count(page, 0);
   192			post_alloc_hook(page, order, GFP_KERNEL);
   193		}
   194	
   195		return page;
   196	}
   197	
 > 198	void unmapped_pages_free(struct page *page, int order)
   199	{
   200		__free_one_page(page, order, false);
   201	}
   202	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-05-27  1:50 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-27  1:50 [rppt:unmapped-alloc/rfc-v2 1/3] mm/unmapped-alloc.c:150:14: warning: no previous prototype for function 'unmapped_pages_alloc' kernel test robot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.