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 24187C38A2D for ; Tue, 25 Oct 2022 11:50:06 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 5222D8E0002; Tue, 25 Oct 2022 07:50:06 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 4D1AD8E0001; Tue, 25 Oct 2022 07:50:06 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 3C1A08E0002; Tue, 25 Oct 2022 07:50:06 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 2A35C8E0001 for ; Tue, 25 Oct 2022 07:50:06 -0400 (EDT) Received: from smtpin27.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id EC887C0D49 for ; Tue, 25 Oct 2022 11:50:05 +0000 (UTC) X-FDA: 80059303170.27.D331B48 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by imf11.hostedemail.com (Postfix) with ESMTP id 2332A4003A for ; Tue, 25 Oct 2022 11:50:03 +0000 (UTC) Received: from dggpemm500020.china.huawei.com (unknown [172.30.72.53]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4MxVXC2mSdzpVX8; Tue, 25 Oct 2022 19:46:35 +0800 (CST) Received: from dggpemm500002.china.huawei.com (7.185.36.229) by dggpemm500020.china.huawei.com (7.185.36.49) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Tue, 25 Oct 2022 19:50:00 +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; Tue, 25 Oct 2022 19:49:59 +0800 Message-ID: Date: Tue, 25 Oct 2022 19:49:59 +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> From: Chen Wandun In-Reply-To: <20221024145555.oaoisy6m723h4axc@techsingularity.net> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [10.174.178.178] X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To dggpemm500002.china.huawei.com (7.185.36.229) X-CFilter-Loop: Reflected ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1666698605; a=rsa-sha256; cv=none; b=wos+6Myo6tC4P6cPUBoIK0eQ6omSlck7oIh612fO1lRfd7dBGj9CA3R7mgMYTDDOzu//XB wsS0afQ0HP1rQEyH5Ct0l8WCf0bY2pBUo58jEVMx93890QLJATNL9eC+4Y80EvRwgCvh5a m4pKzLIITW6BLKy0zS4PuuoWaCZ2sAA= ARC-Authentication-Results: i=1; imf11.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf11.hostedemail.com: domain of chenwandun@huawei.com designates 45.249.212.187 as permitted sender) smtp.mailfrom=chenwandun@huawei.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1666698605; 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=/PSdGoRtFkRlWJr4bbb76UaRFORDQ23cCT2oQbSYVVE=; b=7TJ7nz92mooJsejsb5eecs9eqFYOLmaV3gtD7W42Mq4hOduip9Aiw7uDRT+67HdkjcAUMW UophzICXcYsyhxLDjGLOF30xG0g03zcZuKsJWz3juyLlvJrvOKWZbSvQvpf21mwXRdS6i1 vNKixHrx4k8RMYeQwwLodVo5ns28QGw= X-Rspam-User: Authentication-Results: imf11.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf11.hostedemail.com: domain of chenwandun@huawei.com designates 45.249.212.187 as permitted sender) smtp.mailfrom=chenwandun@huawei.com X-Rspamd-Server: rspam11 X-Stat-Signature: gckrjzrwjg8fbwuyuuoc73ieqdmh5pr6 X-Rspamd-Queue-Id: 2332A4003A X-HE-Tag: 1666698603-319295 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: On 2022/10/24 22:55, Mel Gorman wrote: > On Mon, Oct 24, 2022 at 09:41:46PM +0800, Chen Wandun wrote: >> Nowadays there are several orders in pcplist, Function __rmqueue_pcplist >> would alloc pcp batch pages to refill pcplist, when list of target order >> if empty meanwhile other lists is not all empty, that result in pcp count >> beyond pcp high after allocation. This behaviour can be easily observed by >> adding debugging information in __rmqueue_pcplist. >> >> Fix this by recalculate the batch pages to be allocated. > Are any problems observed other than the PCP lists temporarily exceed > pcp->high? It will result frequently refill pcp page from buddy and release pcp page to buddy. > 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, or just share pcp batch value only set high for each order?  It looks like strange for pcp count beyond pcp high in common case. If each order has it's own pcp high value, that behaviour is same as pcplist which only contains order 0. Thanks Wandun. > > The intention was to allow high to be briefly exceeded on the refill side, > particularly for THP pages and to always refill by at least two pages. In > the THP case, one would be allocated and maybe one in the near future > without acquiring the zone lock. If the limits are exceeded, it's only > exceeded until the next free. >