Received: by 2002:ab2:7a55:0:b0:1f4:4a7d:290d with SMTP id u21csp655811lqp; Fri, 5 Apr 2024 05:17:27 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCV89rkSi6IakI6PsnrP8SvDt+VCQpQ54lrLGSQuCyT90/0bo5idX4jgifbxBEUcuw7kKq8O4TlC0EXRdOONqodOBAz5xvoNugD1F9XoWQ== X-Google-Smtp-Source: AGHT+IFhJFb6gbkfcNE+MV5x0dZcA4hc0jzfO8lJ9ABInwCsTjAO8BthJxBHhKsqZmPPMrzZNMIe X-Received: by 2002:a17:903:124f:b0:1e2:adad:75f4 with SMTP id u15-20020a170903124f00b001e2adad75f4mr1287552plh.28.1712319447302; Fri, 05 Apr 2024 05:17:27 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712319447; cv=pass; d=google.com; s=arc-20160816; b=uoxP6Ai0rEORw0rEZ6OFwdqNCnnBuLFCaoe0RBzRekp2ePmmjOE+xg9Vtb+/gf554f PSMOGBvO4XuFsmCwGg6TRITqKSfhkKMUAgWcGse8IZPaMsEGaVuaP4QMgf6l+u6cMRJg f3UnSELw6lp56LVkFX/TkrKsKm5HnnT5V2H/Y2DkwuaCFFnuv/RsMHq3glOAbez2IZLA iigsqUVlr7E3k/MO7fhTLmAeau5TyVpkqxRDFt36d+1EY7n+Vh1mkxM17tLJkiRpHftv PfZb7RPDoNEJeT8kbPNhMDYifamCJ15mIGWO3KVcRMV9SFB5DTuj2fCTvaLD+nCaHKNx yqsA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to:subject :user-agent:mime-version:list-unsubscribe:list-subscribe:list-id :precedence:date:message-id:dkim-signature; bh=kAKE1FWTl1PVjjzYCcGKY7AAJE4W0w3oCG32pxeXa8w=; fh=StjKsDunrHLkgfRMDAClv7QHBQAwy88n7f95iwM2Y7U=; b=ljnW6lKSssgSb0GYdqBx5bTpD1oWv1imwB6fKhMDG5/QeBpyyIHaZUmcPAD3/3ee+6 SR0EPbaczVKU006LAujeTjtsxvlrywGOdRzwBiOkcnKj+8K563nQfQkhckUsR1KM7KMm iljtQflLXBIBqGjMsXbdQG21MzUeFotWA0mnI4a/Ur+zUTfFUi4/bTnTPOTNM6/sdK4B s0/3aeRvoerrmD+vbyeuolSjAJ+A7C29SFIicUQgGDc9nyIKa/0NrO1fWiwG0xhT5+5T mUAejMh1azvmBh48hshsCMwkK0kQX8xl1YpJXvJWX96EktW0bMKGkD1H3vrYwsvhcctE ft/A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux.alibaba.com header.s=default header.b=DmERWGHS; arc=pass (i=1 spf=pass spfdomain=linux.alibaba.com dkim=pass dkdomain=linux.alibaba.com dmarc=pass fromdomain=linux.alibaba.com); spf=pass (google.com: domain of linux-kernel+bounces-132974-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-132974-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.alibaba.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id mc14-20020a1709032b0e00b001e0cd0060c8si1257779plb.420.2024.04.05.05.17.26 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Apr 2024 05:17:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-132974-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.alibaba.com header.s=default header.b=DmERWGHS; arc=pass (i=1 spf=pass spfdomain=linux.alibaba.com dkim=pass dkdomain=linux.alibaba.com dmarc=pass fromdomain=linux.alibaba.com); spf=pass (google.com: domain of linux-kernel+bounces-132974-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-132974-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.alibaba.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 3200CB218FC for ; Fri, 5 Apr 2024 12:17:24 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2D34A16D313; Fri, 5 Apr 2024 12:17:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.alibaba.com header.i=@linux.alibaba.com header.b="DmERWGHS" Received: from out30-119.freemail.mail.aliyun.com (out30-119.freemail.mail.aliyun.com [115.124.30.119]) (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 1F75D16D4D1 for ; Fri, 5 Apr 2024 12:16:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=115.124.30.119 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712319412; cv=none; b=eQSlVc3l8LxMdLZaLhtqG9Ot1E0Qxj1shI+9osE/n/a/YweIYjPLkqdai4BqKsYIetvnlAebu21eaeIFObxLNuDN0ZxvQdkzm8iB5yvgjKzWZhLLuls+EZCHfyhrFnM4XgWkRPW36jpaVeM1I3K8kTQHCEo4cKVGi7PL/AtAYb4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712319412; c=relaxed/simple; bh=zSLP3ufHDXUhqUSGulLXWxavP4OznAxZNVLs2OwXYqw=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=MLg0JG9GzsoryMj5ZLH8fsxoWFvzupZU35g9OJXGQvRlWiJc9ANKOWSWxWXR30aabFxQCuCWPfvRkMg8zV/F0GZTmWPmI5sz2+JxGckFqc4iX/bdR+z4Cau80K6GaGPPZm9l7J1Rq3MkcXEcB5ReW6VJjFn4IJ6sTT34dbEBi54= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.alibaba.com; spf=pass smtp.mailfrom=linux.alibaba.com; dkim=pass (1024-bit key) header.d=linux.alibaba.com header.i=@linux.alibaba.com header.b=DmERWGHS; arc=none smtp.client-ip=115.124.30.119 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.alibaba.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.alibaba.com DKIM-Signature:v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.alibaba.com; s=default; t=1712319396; h=Message-ID:Date:MIME-Version:Subject:To:From:Content-Type; bh=kAKE1FWTl1PVjjzYCcGKY7AAJE4W0w3oCG32pxeXa8w=; b=DmERWGHSTGcAVq2YVQ4QdlhpHfh2lkO9J0zvncY9s/EZR6jj3zoU/7RzMQCGyXjiinZrtklRMqM5ZF7K457VPBtKkD3oI3DtWT1LF3nIjVQDbBdq/KsNhOVlicXb52SPV2w9QR0QUmd9i9UcrPNS9JMykzxY9nFOPTE1QcCv+j0= X-Alimail-AntiSpam:AC=PASS;BC=-1|-1;BR=01201311R951e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018046050;MF=baolin.wang@linux.alibaba.com;NM=1;PH=DS;RN=6;SR=0;TI=SMTPD_---0W3wqza-_1712319395; Received: from 30.15.228.201(mailfrom:baolin.wang@linux.alibaba.com fp:SMTPD_---0W3wqza-_1712319395) by smtp.aliyun-inc.com; Fri, 05 Apr 2024 20:16:36 +0800 Message-ID: <721ca866-0c80-496b-a823-ccdbb1f488d4@linux.alibaba.com> Date: Fri, 5 Apr 2024 20:16:35 +0800 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] mm: page_alloc: use the correct THP order for THP PCP To: Barry Song <21cnbao@gmail.com> Cc: akpm@linux-foundation.org, mgorman@techsingularity.net, vbabka@suse.cz, linux-mm@kvack.org, linux-kernel@vger.kernel.org References: From: Baolin Wang In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 2024/4/5 12:53, Barry Song wrote: > On Thu, Apr 4, 2024 at 2:47 AM Baolin Wang > wrote: >> >> Commit 44042b449872 ("mm/page_alloc: allow high-order pages to be stored >> on the per-cpu lists") extends the PCP allocator to store THP pages, and >> it determines whether to cache THP pags in PCP by comparing with pageblock_order. >> But the pageblock_order is not always equal to THP order, it might also >> be MAX_PAGE_ORDER, which could prevent PCP from caching THP pages. >> >> Therefore, using HPAGE_PMD_ORDER instead to determine the need for caching >> THP for PCP can fix this issue >> >> Fixes: 44042b449872 ("mm/page_alloc: allow high-order pages to be stored on the per-cpu lists") >> Signed-off-by: Baolin Wang > > LGTM, > Reviewed-by: Barry Song > > In the context of using mTHP, perhaps there arises a need for PCP > allocation for frequently > requested mTHP orders. These orders typically exceed PAGE_ALLOC_COSTLY_ORDER > but are smaller than HPAGE_PMD_ORDER. Yes, I have also considered this, but haven't found some time to do more investigation and run some benchmarks.:) May be we can create a new thread to talk about this first.