From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7EE2620B810 for ; Wed, 17 Dec 2025 11:49:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765972166; cv=none; b=EfP+Lw6VTwVhhnaVy+Yfs5yLmPiSxdbwNibotscclRaOENVBHJ+9lnDDW+U5tsXYe0CbkewjckUzoC3yHlMSuQPoIm9pEmgunm3u1MKjZ73KFH0SFJDZ1umqgLm9rYxAeGgcu8+wFLj2XzerhaMK8ddZeGeHePWPyBuO65Ysl4g= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765972166; c=relaxed/simple; bh=D6+ZOjsvYG8O9Bnt0bUIqaH4t86FOOPqlpmxuCvO7uM=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=TMwn1isu74AVHRQxl3omCfYJLyVFAf7MSEB4DSlLfvmGyymqmwdk5uhS5b6725lIGSkl9/fnt7dqgwNL3XhTZxizaR18gJeQDU/EI8+nb0CHN1+qhTH44LRec8KW4M26HgTxmPcL8lqyNmS5Kz3uwMbPncYsAqswQLvPyPIeFYw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 132DF1516; Wed, 17 Dec 2025 03:49:11 -0800 (PST) Received: from [10.164.18.63] (MacBook-Pro.blr.arm.com [10.164.18.63]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 408D03F73B; Wed, 17 Dec 2025 03:49:16 -0800 (PST) Message-ID: <1329f4ad-5fe1-41e8-97f4-0b58caf86fce@arm.com> Date: Wed, 17 Dec 2025 17:19:13 +0530 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 2/2] mm/vmalloc: Add attempt_larger_order_alloc parameter To: Uladzislau Rezki , Baoquan He Cc: linux-mm@kvack.org, Andrew Morton , Vishal Moola , Ryan Roberts , LKML References: <20251216211921.1401147-1-urezki@gmail.com> <20251216211921.1401147-2-urezki@gmail.com> Content-Language: en-US From: Dev Jain In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 17/12/25 5:14 pm, Uladzislau Rezki wrote: > On Wed, Dec 17, 2025 at 11:54:26AM +0800, Baoquan He wrote: >> Hi Uladzislau, >> >> On 12/16/25 at 10:19pm, Uladzislau Rezki (Sony) wrote: >>> Introduce a module parameter to enable or disable the large-order >>> allocation path in vmalloc. High-order allocations are disabled by >>> default so far, but users may explicitly enable them at runtime if >>> desired. >>> >>> High-order pages allocated for vmalloc are immediately split into >>> order-0 pages and later freed as order-0, which means they do not >>> feed the per-CPU page caches. As a result, high-order attempts tend >> I don't get why order-0 do not feed the PCP caches. >> > "they" -> high-order pages. I should improve it. > >>> to bypass the PCP fastpath and fall back to the buddy allocator that >>> can affect performance. >>> >>> However, when the PCP caches are empty, high-order allocations may >>> show better performance characteristics especially for larger >>> allocation requests. >> And when PCP is empty, high-order alloc show better performance. Could >> you please help elaborate a little more about them? Thanks. >> > This is what i/we measured. See below example: > > # default order-3 > Summary: fix_size_alloc_test passed: 1 failed: 0 xfailed: 0 repeat: 1 loops: 1000000 avg: 3718592 usec > Summary: fix_size_alloc_test passed: 1 failed: 0 xfailed: 0 repeat: 1 loops: 1000000 avg: 3740495 usec > Summary: fix_size_alloc_test passed: 1 failed: 0 xfailed: 0 repeat: 1 loops: 1000000 avg: 3737213 usec > Summary: fix_size_alloc_test passed: 1 failed: 0 xfailed: 0 repeat: 1 loops: 1000000 avg: 3740765 usec > > # patch order-3 > Summary: fix_size_alloc_test passed: 1 failed: 0 xfailed: 0 repeat: 1 loops: 1000000 avg: 3350391 usec > Summary: fix_size_alloc_test passed: 1 failed: 0 xfailed: 0 repeat: 1 loops: 1000000 avg: 3374568 usec > Summary: fix_size_alloc_test passed: 1 failed: 0 xfailed: 0 repeat: 1 loops: 1000000 avg: 3286374 usec > Summary: fix_size_alloc_test passed: 1 failed: 0 xfailed: 0 repeat: 1 loops: 1000000 avg: 3261335 usec > > why higher-order wins, i think it is less cyclesto get one big chunk from the > buddy instead of looping and pick one by one. I have the same observation that getting a higher-order chunk is faster than bulk allocating basepages. (btw, I had resent my RFC, in case you missed!) > > -- > Uladzislau Rezki