From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3F1A530B51A for ; Thu, 18 Dec 2025 10:35:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766054111; cv=none; b=rOwUVcfXLBeyvq2JJDL00ULv8FSnhw9HeAlC/TO27t6Y3O1jxC9/J8SiPIUH1ECbm/2usPqd6PFAbVy6MUsSAqJndX6kSq0kyRs1/qodsOwYbM55z46TlWml157p6Hn9VeU2q2GtRnn6O2gS/eQXUJV9GBToPg7kwLvIKWx4ATI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766054111; c=relaxed/simple; bh=hi1wF+WhLPgtbbjPGYDTgKrHSQPHBydoWauw/YPByrU=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=i6aH4AGp5xAdo5eg2S6SLv3gUpCeWs9zOeaJ5ELIX4n39IC0ASRtq/IZes8nHWpW9cv4rmnlbBRduOC5048uCBOgRI6blEpeImmNPO8RUmKSlC5ITuAcIuJxFG6zKdgxIDWUCdhejWnZEZ4akkcJEi0Zlu/vbv+M3W7gMsbqryk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=CNe/mWNh; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="CNe/mWNh" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1766054107; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=Ox6wssbehUd9TNy9xO6dZkl4Qcg/MXBnBGHnzoEEBXI=; b=CNe/mWNht9OicScC1r/L4n8fukdCX/DmEJ7fFCD2NNuGuDQ6ctQv1MUDUlG5/0DBeWcfSA jzUTjugKdWlIVkQyB5ZYqq5PmpoLdIMaOhEHrqBdg4BidGoCepxkc+I0ymGmp851iBfzWS 6w7AVxfev6i+HxCrnGb4CjTOv9VG8rM= Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-159-EObfuWrTPPKz-GkpgyspFQ-1; Thu, 18 Dec 2025 05:35:03 -0500 X-MC-Unique: EObfuWrTPPKz-GkpgyspFQ-1 X-Mimecast-MFC-AGG-ID: EObfuWrTPPKz-GkpgyspFQ_1766054102 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id D435F1800342; Thu, 18 Dec 2025 10:35:01 +0000 (UTC) Received: from localhost (unknown [10.72.112.95]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id A8CB5180045B; Thu, 18 Dec 2025 10:34:59 +0000 (UTC) Date: Thu, 18 Dec 2025 18:34:53 +0800 From: Baoquan He To: Uladzislau Rezki Cc: linux-mm@kvack.org, Andrew Morton , Vishal Moola , Ryan Roberts , Dev Jain , LKML Subject: Re: [PATCH 2/2] mm/vmalloc: Add attempt_larger_order_alloc parameter Message-ID: References: <20251216211921.1401147-1-urezki@gmail.com> <20251216211921.1401147-2-urezki@gmail.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: X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111 On 12/17/25 at 12:44pm, 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. Ah, git it now, thanks. > > > > 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. Thanks a lot for the details.