From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9E60EC433FE for ; Thu, 3 Nov 2022 12:46:55 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 265D76B0071; Thu, 3 Nov 2022 08:46:55 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 1EE996B0072; Thu, 3 Nov 2022 08:46:55 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 090626B0073; Thu, 3 Nov 2022 08:46:55 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id EAD736B0071 for ; Thu, 3 Nov 2022 08:46:54 -0400 (EDT) Received: from smtpin28.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 7DACA141415 for ; Thu, 3 Nov 2022 12:46:54 +0000 (UTC) X-FDA: 80092105548.28.955A9C8 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by imf08.hostedemail.com (Postfix) with ESMTP id A42F5160003 for ; Thu, 3 Nov 2022 12:46:51 +0000 (UTC) Received: from dggpemm500023.china.huawei.com (unknown [172.30.72.56]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4N33MP0xPXzpWBG; Thu, 3 Nov 2022 20:43:13 +0800 (CST) Received: from dggpemm500002.china.huawei.com (7.185.36.229) by dggpemm500023.china.huawei.com (7.185.36.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Thu, 3 Nov 2022 20:46:47 +0800 Received: from [10.174.178.178] (10.174.178.178) by dggpemm500002.china.huawei.com (7.185.36.229) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Thu, 3 Nov 2022 20:46:46 +0800 Message-ID: Date: Thu, 3 Nov 2022 20:46:46 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.0.3 Subject: Re: [PATCH] mm: fix pcp count beyond pcp high in pcplist allocation To: Mel Gorman CC: , , , , References: <20221024134146.3442393-1-chenwandun@huawei.com> <20221024145555.oaoisy6m723h4axc@techsingularity.net> <20221025131959.sd47fipimhehf76i@techsingularity.net> <316bc0a2-34d9-e485-11d2-f3dffd0fdea4@huawei.com> <20221101104040.o6gqtyyd5d4pkhle@techsingularity.net> From: Chen Wandun In-Reply-To: <20221101104040.o6gqtyyd5d4pkhle@techsingularity.net> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [10.174.178.178] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To dggpemm500002.china.huawei.com (7.185.36.229) X-CFilter-Loop: Reflected ARC-Authentication-Results: i=1; imf08.hostedemail.com; dkim=none; spf=pass (imf08.hostedemail.com: domain of chenwandun@huawei.com designates 45.249.212.187 as permitted sender) smtp.mailfrom=chenwandun@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1667479614; a=rsa-sha256; cv=none; b=LWk7u2p4Ndd/tA+gdfyF6E8ay96kB50n41a6Ab8BJx5x5EBfmR3VgalF5gEtBPTGft49oF y7bTN5HJydgSqCjQhrcAHkWvboCc2YqqAu7AAOzFE+B94UpYKSQYIz3WMoeCntNV+JVgvL kNQofimAbNwFqBmP9KFR+UD7onQZFa8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1667479614; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=NSk4MPhGzM68HqhtjPtlAZhF+WR+NgrVVVfeXvMvIMU=; b=OKfab3YOL0h3d7NxgPiB8QfUbQAXR1PfMEPctAP6L0TFlzDgQwG+7CpsyQTZX6Bcesc7jD d9MMKyqAcOqjK/BYBSsle/nhjEhmfIxijtx9ayCguw/3zjEhmE723reFpHk22l5DQ27Qi8 K0Vr5kVT+u4stE5ixWrYQqKkOJYjHc0= X-Stat-Signature: nh1py41mxb383ngpcejmtmuotebwfn37 X-Rspamd-Queue-Id: A42F5160003 X-Rspam-User: Authentication-Results: imf08.hostedemail.com; dkim=none; spf=pass (imf08.hostedemail.com: domain of chenwandun@huawei.com designates 45.249.212.187 as permitted sender) smtp.mailfrom=chenwandun@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com X-Rspamd-Server: rspam01 X-HE-Tag: 1667479611-170453 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 在 2022/11/1 18:40, Mel Gorman 写道: > On Mon, Oct 31, 2022 at 11:37:35AM +0800, Chen Wandun wrote: >>>>> As is, the patch could result in a batch request of 0 and >>>>  I foget this, the patch need some improve, thanks. >>>> >>>>> fall through to allocating from the zone list anyway defeating the >>>>> purpose of the PCP allocator and probably regressing performance in some >>>>> csaes. >>>> Same as I understand???how about set high/batch for each order in pcplist??? >>> Using anything would than (X >> order) consumes storage. Even if storage >>> was to be used, selecting a value per-order would be impossible because >>> the correct value would depend on frequency of requests for each order. >>> That can only be determined at runtime and the cost of determining the >>> value would likely exceed the benefit. >> Can we set a experience value for pcp batch for each order during init >> stage? > I'm not sure what you mean by "experience value" but maybe you meant > experimental value? yes, experimental value,  sorry for that. > >> If so we can make accurately control for pcp size. Nowdays, the size of each >> order in pcp list is full of randomness. I dont konw which scheme is better >> for performance. >> > It is something that could be experimented with but the main question is > -- what should those per-order values be? One option would be to enforce > pcp->high for all high-order values except THP if THP is enabled. That would > limit some of the issues with pcp->high being exceeded as even if two THPs > are refilled, one of them is allocated immediately. I wasn't convinced it was > necessary when implementing high-order PCP support but it could be evaluated. Thank you for your suggestion, I will do some tests.