From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-lf1-f50.google.com (mail-lf1-f50.google.com [209.85.167.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9441A309DC4 for ; Thu, 11 Dec 2025 15:39:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.50 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765467592; cv=none; b=Tm1VZzsH33qajfJ2QVHbjmmX25ydYSMXhKA/s6/+QD7AfmjZOYDUZwTjJPTEZd/YcUFLhicLZJrjp4XrGH8BOJyopi3lQcrIIJUOC/LHJtIy2kktNaO5xxDyWA44PKkFhVRgfQmAHei64NYabAQ0Q6cIBJRVV1KpV4/bn5FTH88= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765467592; c=relaxed/simple; bh=GmpaLUy6S8fk+k8SuV9rAfaJfLUc26KVZtMXX2aCp9g=; h=From:Date:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=YBTLSvJL+hLUHbmyzC1sATHGCPIsfKRvpSWF8SkOMHO6NI/aPnvQd2hqHPLn0BDMPwM5rbC1Q3JCdXC9bNQkrA02StCC7oFmNsdUK1UJC0dk9MQO+V+t5Az1ydmkix0lNYpiWSv344KbpUJTfuDVPR5/EG8LzEtLUkGyt8wiiwg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=J8lr2fbE; arc=none smtp.client-ip=209.85.167.50 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="J8lr2fbE" Received: by mail-lf1-f50.google.com with SMTP id 2adb3069b0e04-5945510fd7aso201691e87.0 for ; Thu, 11 Dec 2025 07:39:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1765467589; x=1766072389; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:date:from:from:to:cc:subject:date:message-id:reply-to; bh=zSmYvvssQZxozIglSnRrsm1jahIJ+aVIoUH/N2Th3Q8=; b=J8lr2fbEW1Pk1b/aCrVYSfFumBCffaaamBe1onPtTYb6NvBLlLxqNQTlpLfc9NtmuD 4NRs0axrrhzYhZJ7RGSuwvUaE2M9uKUwQh/1RhkygZWiJVTZkg4zA23xDo9e6wpBid+k r055YbE+EIVKjuJe1aoU90cPnpoojtH4sZrneWVU5Rp5220sng1lVvhawIASM4uCgLlJ NBPOu+KZUMZxRm1lfJ8g0ZrUGne8NB5Nsquy5bm0cY475ANJ8kqMQKyn4vKr8r+mRYjQ 5z56yMTj2Tu4vsJtHeiwDP+7i4yCo3WJTiNlUOY0SMABGCWNY4TLTCr61wEHwW9/S4da CKxw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1765467589; x=1766072389; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:date:from:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=zSmYvvssQZxozIglSnRrsm1jahIJ+aVIoUH/N2Th3Q8=; b=vtg0gwa9kYSTV23clwVDJI+l6g0hfHMB79eV4fGVlraIrG6XZayUokY6EexELxoJ7W wirAyf8FY3GRA0pCq0RCA9h9WG1vy+r/xtpDBtoBunKkvJO3OAW2NfyGmUzTess0lnrn H6aNA780+xJ2J2djtLubN0SmgBuZ7msCeHNDVCBaP7BtNHYPB22fF5fr4SI0Jdv47E+C DZ36+6WgrGWG84rT9wtbdhKR6rwL6Bvxtpfq4ErHXIPCbYgKEIRlx4/FYEKnMUSC6wJ3 pHyo7ihAWcDJFnV0hUDB0Mlu/EMWL2OhPPrrd9Oqmxjo5FuRheOzv2hX/l/7HCTWV6KF 7HrQ== X-Forwarded-Encrypted: i=1; AJvYcCXCGewIF7rHpDQfXEPq8VpM3P1Oqi3+k9+f2Vlnx5GQ0kUX5PeBHfnEVklk6GEiwI1GLzaKNlory9/vWcA=@vger.kernel.org X-Gm-Message-State: AOJu0YzO+gs3sgYMHAqsmZ7SLn0yRG8TtX0vahUOIdUdMaPBSSAnBk+v 29+dWz5SXmZjdkwCgmrHNrPdK5y+1t9/SU+J/DV+RXhSOMb/fBtUAwaT X-Gm-Gg: AY/fxX5dSSIh0Va9QkE4Y2nVX/akRFnDuVon2uWQoO/CmQeRBN8l8iAn/51w1QZdQA4 n9OSXK72BlQTqf/Czn43aCTgOiIRme+ONS3HFv/O+Cozab3qbeOHcRa55OQN1HLa2TrfT7Q2rQw Zbk3FeeskY/CySXD9zNDz85s+Q4qO25g2/N+ieUAjvQYiMcKZjwpCXPkSdvQ1/MGeFG/9GajhQz K9i8QsCcuXtX4BBVTRjyh/66RqShj8yX+k8nlNZchZpUC5kTrz5iPna5ezL1haO+s9bHv+rqR8+ 8RPXyq7NkT7ph3sj0hqyA0JaNMJsQeezUiLxlY3oztoD+Ne4gWcKNqnlDEfZi1aZqZAG3lrhatl UjnlmdV8dXUYlQF0YyN9LppkdNhE124xzJFKYVUkjF0ZQkFg4sKRj X-Google-Smtp-Source: AGHT+IHv3xZhgmMvGAEJd1hJmGS586Qi2hutGjV7z2xzt2j2a4wtG5YT7+kCgwh3pvXzfvK+PykaRQ== X-Received: by 2002:a05:6512:4007:b0:595:8200:9f79 with SMTP id 2adb3069b0e04-598ee4cc9eamr2253993e87.43.1765467588352; Thu, 11 Dec 2025 07:39:48 -0800 (PST) Received: from milan ([2001:9b1:d5a0:a500::24b]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-598f3197e0fsm950502e87.89.2025.12.11.07.39.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Dec 2025 07:39:47 -0800 (PST) From: Uladzislau Rezki X-Google-Original-From: Uladzislau Rezki Date: Thu, 11 Dec 2025 16:39:46 +0100 To: Ryan Roberts , "Vishal Moola (Oracle)" Cc: "Vishal Moola (Oracle)" , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Uladzislau Rezki , Andrew Morton Subject: Re: [PATCH] mm/vmalloc: request large order pages from buddy allocator Message-ID: References: <20251021194455.33351-2-vishal.moola@gmail.com> <66919a28-bc81-49c9-b68f-dd7c73395a0d@arm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On Thu, Dec 11, 2025 at 03:28:56PM +0000, Ryan Roberts wrote: > On 10/12/2025 22:28, Vishal Moola (Oracle) wrote: > > On Wed, Dec 10, 2025 at 01:21:22PM +0000, Ryan Roberts wrote: > >> Hi Vishal, > >> > >> > >> On 21/10/2025 20:44, Vishal Moola (Oracle) wrote: > >>> Sometimes, vm_area_alloc_pages() will want many pages from the buddy > >>> allocator. Rather than making requests to the buddy allocator for at > >>> most 100 pages at a time, we can eagerly request large order pages a > >>> smaller number of times. > >>> > >>> We still split the large order pages down to order-0 as the rest of the > >>> vmalloc code (and some callers) depend on it. We still defer to the bulk > >>> allocator and fallback path in case of order-0 pages or failure. > >>> > >>> Running 1000 iterations of allocations on a small 4GB system finds: > >>> > >>> 1000 2mb allocations: > >>> [Baseline] [This patch] > >>> real 46.310s real 0m34.582 > >>> user 0.001s user 0.006s > >>> sys 46.058s sys 0m34.365s > >>> > >>> 10000 200kb allocations: > >>> [Baseline] [This patch] > >>> real 56.104s real 0m43.696 > >>> user 0.001s user 0.003s > >>> sys 55.375s sys 0m42.995s > >> > >> I'm seeing some big vmalloc micro benchmark regressions on arm64, for which > >> bisect is pointing to this patch. > > > > Ulad had similar findings/concerns[1]. Tldr: The numbers you are seeing > > are expected for how the test module is currently written. > > Hmm... simplistically, I'd say that either the tests are bad, in which case they > should be deleted, or they are good, in which case we shouldn't ignore the > regressions. Having tests that we learn to ignore is the worst of both worlds. > Uh.. Tests are for measure vmalloc performance and stressing. They can not be just removed :) In some sense they are synthetic, from the other hand they allow to find problems and bottle-necks + measure perf. You have identified regression with it :) I think, the problem is in the + 14.05% 0.11% [kernel] [k] remove_vm_area + 11.85% 1.82% [kernel] [k] __alloc_frozen_pages_noprof + 10.91% 0.36% [kernel] [k] __get_vm_area_node + 10.60% 7.58% [kernel] [k] insert_vmap_area + 10.02% 4.67% [kernel] [k] get_page_from_freelist get_page_from_freelist() call. With a patch it adds 10% of cycles on top whereas without patch i do not see the symbol at all, i.e. pages are obtained really fast from the pcp list, not from the body. The question is, why high-order pages are not end-up in the pcp-cache? I think it is due to the fact, that we split such pages and freeing them as order-0 one. Any thoughts? -- Uladzislau Rezki