All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] mm/vmalloc: Add large-order allocation helper
@ 2025-12-16 21:19 Uladzislau Rezki (Sony)
  2025-12-16 21:19 ` [PATCH 2/2] mm/vmalloc: Add attempt_larger_order_alloc parameter Uladzislau Rezki (Sony)
  0 siblings, 1 reply; 28+ messages in thread
From: Uladzislau Rezki (Sony) @ 2025-12-16 21:19 UTC (permalink / raw)
  To: linux-mm, Andrew Morton
  Cc: Vishal Moola, Ryan Roberts, Dev Jain, Baoquan He, LKML,
	Uladzislau Rezki

Refactor vm_area_alloc_pages() by moving the high-order allocation
code into a separate function, vm_area_alloc_pages_large_order().

No functional changes.

Signed-off-by: Uladzislau Rezki (Sony) <urezki@gmail.com>
---
 mm/vmalloc.c | 26 +++++++++++++++++++++-----
 1 file changed, 21 insertions(+), 5 deletions(-)

diff --git a/mm/vmalloc.c b/mm/vmalloc.c
index ecbac900c35f..d3a4725e15ca 100644
--- a/mm/vmalloc.c
+++ b/mm/vmalloc.c
@@ -3624,18 +3624,20 @@ static inline gfp_t vmalloc_gfp_adjust(gfp_t flags, const bool large)
 	return flags;
 }
 
-static inline unsigned int
-vm_area_alloc_pages(gfp_t gfp, int nid,
-		unsigned int order, unsigned int nr_pages, struct page **pages)
+static unsigned int
+vm_area_alloc_pages_large_order(gfp_t gfp, int nid, unsigned int order,
+		unsigned int nr_pages, struct page **pages)
 {
 	unsigned int nr_allocated = 0;
 	unsigned int nr_remaining = nr_pages;
 	unsigned int max_attempt_order = MAX_PAGE_ORDER;
 	struct page *page;
+	unsigned int large_order;
+	gfp_t large_gfp;
 	int i;
-	unsigned int large_order = ilog2(nr_remaining);
-	gfp_t large_gfp = vmalloc_gfp_adjust(gfp, large_order) & ~__GFP_DIRECT_RECLAIM;
 
+	large_order = ilog2(nr_remaining);
+	large_gfp = vmalloc_gfp_adjust(gfp, large_order) & ~__GFP_DIRECT_RECLAIM;
 	large_order = min(max_attempt_order, large_order);
 
 	/*
@@ -3666,6 +3668,20 @@ vm_area_alloc_pages(gfp_t gfp, int nid,
 		large_order = min(max_attempt_order, large_order);
 	}
 
+	return nr_allocated;
+}
+
+static inline unsigned int
+vm_area_alloc_pages(gfp_t gfp, int nid,
+		unsigned int order, unsigned int nr_pages, struct page **pages)
+{
+	unsigned int nr_allocated = 0;
+	struct page *page;
+	int i;
+
+	nr_allocated = vm_area_alloc_pages_large_order(gfp, nid,
+		order, nr_pages, pages);
+
 	/*
 	 * For order-0 pages we make use of bulk allocator, if
 	 * the page array is partly or not at all populated due
-- 
2.47.3



^ permalink raw reply related	[flat|nested] 28+ messages in thread
* Re: [PATCH 2/2] mm/vmalloc: Add attempt_larger_order_alloc parameter
@ 2025-12-20 13:46 kernel test robot
  0 siblings, 0 replies; 28+ messages in thread
From: kernel test robot @ 2025-12-20 13:46 UTC (permalink / raw)
  To: oe-kbuild; +Cc: lkp

:::::: 
:::::: Manual check reason: "low confidence static check warning: mm/vmalloc.c:3714:1: sparse: sparse: bad integer constant expression"
:::::: 

BCC: lkp@intel.com
CC: oe-kbuild-all@lists.linux.dev
In-Reply-To: <20251216211921.1401147-2-urezki@gmail.com>
References: <20251216211921.1401147-2-urezki@gmail.com>
TO: "Uladzislau Rezki (Sony)" <urezki@gmail.com>
TO: linux-mm@kvack.org
TO: Andrew Morton <akpm@linux-foundation.org>
CC: Linux Memory Management List <linux-mm@kvack.org>
CC: Vishal Moola <vishal.moola@gmail.com>
CC: Ryan Roberts <ryan.roberts@arm.com>
CC: Dev Jain <dev.jain@arm.com>
CC: Baoquan He <bhe@redhat.com>
CC: LKML <linux-kernel@vger.kernel.org>
CC: Uladzislau Rezki <urezki@gmail.com>

Hi Uladzislau,

kernel test robot noticed the following build warnings:

[auto build test WARNING on akpm-mm/mm-everything]

url:    https://github.com/intel-lab-lkp/linux/commits/Uladzislau-Rezki-Sony/mm-vmalloc-Add-attempt_larger_order_alloc-parameter/20251217-052105
base:   https://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm.git mm-everything
patch link:    https://lore.kernel.org/r/20251216211921.1401147-2-urezki%40gmail.com
patch subject: [PATCH 2/2] mm/vmalloc: Add attempt_larger_order_alloc parameter
:::::: branch date: 4 days ago
:::::: commit date: 4 days ago
config: openrisc-randconfig-r113-20251217 (https://download.01.org/0day-ci/archive/20251220/202512202146.jHJbkIda-lkp@intel.com/config)
compiler: or1k-linux-gcc (GCC) 15.1.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20251220/202512202146.jHJbkIda-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/r/202512202146.jHJbkIda-lkp@intel.com/

sparse warnings: (new ones prefixed by >>)
>> mm/vmalloc.c:3714:1: sparse: sparse: bad integer constant expression
   mm/vmalloc.c:3714:1: sparse: sparse: static assertion failed: "MODULE_INFO(parmtype, ...) contains embedded NUL byte"

vim +3714 mm/vmalloc.c

f53b3795c83eae Uladzislau Rezki (Sony  2025-12-16  3712) 
f486454c6610dd Uladzislau Rezki (Sony  2025-12-16  3713) static int attempt_larger_order_alloc;
f486454c6610dd Uladzislau Rezki (Sony  2025-12-16 @3714) module_param(attempt_larger_order_alloc, int, 0644);
f486454c6610dd Uladzislau Rezki (Sony  2025-12-16  3715) 

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

^ permalink raw reply	[flat|nested] 28+ messages in thread

end of thread, other threads:[~2025-12-24  6:35 UTC | newest]

Thread overview: 28+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-12-16 21:19 [PATCH 1/2] mm/vmalloc: Add large-order allocation helper Uladzislau Rezki (Sony)
2025-12-16 21:19 ` [PATCH 2/2] mm/vmalloc: Add attempt_larger_order_alloc parameter Uladzislau Rezki (Sony)
2025-12-16 23:36   ` Andrew Morton
2025-12-17 11:37     ` Uladzislau Rezki
2025-12-17  3:54   ` Baoquan He
2025-12-17 11:44     ` Uladzislau Rezki
2025-12-17 11:49       ` Dev Jain
2025-12-17 11:53         ` Uladzislau Rezki
2025-12-18 10:34       ` Baoquan He
2025-12-17  8:27   ` Ryan Roberts
2025-12-17 12:02     ` Uladzislau Rezki
2025-12-17 15:20       ` Ryan Roberts
2025-12-17 17:01         ` Ryan Roberts
2025-12-17 19:22           ` Uladzislau Rezki
2025-12-18 11:12             ` Ryan Roberts
2025-12-18 11:33               ` Uladzislau Rezki
2025-12-17 20:08           ` Uladzislau Rezki
2025-12-18 11:14             ` Ryan Roberts
2025-12-18 11:29               ` Uladzislau Rezki
2025-12-18  4:55         ` Dev Jain
2025-12-18 11:53           ` Ryan Roberts
2025-12-18 11:56             ` Ryan Roberts
2025-12-19  8:33               ` David Hildenbrand (Red Hat)
2025-12-19 11:17                 ` Ryan Roberts
2025-12-19  0:34             ` Vishal Moola (Oracle)
2025-12-19 11:23               ` Ryan Roberts
2025-12-24  6:35             ` Dev Jain
  -- strict thread matches above, loose matches on Subject: below --
2025-12-20 13:46 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.