Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp8272656rwi; Tue, 25 Oct 2022 04:51:32 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5b5F4kYsEaUfkOvB+NMs87l1/UfTyrqbYs4f0Vhu2I1doNTgDU0wLldu8iUZ1FVQGLEDHY X-Received: by 2002:a17:902:7792:b0:182:9404:f226 with SMTP id o18-20020a170902779200b001829404f226mr38841430pll.76.1666698691805; Tue, 25 Oct 2022 04:51:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666698691; cv=none; d=google.com; s=arc-20160816; b=W2qKMl5uicBkhiJiUeuREhpwHOy+IS7GSmoN0EJ394U6ofBLSXCl0AlGfQ15tGDSOS gg6xvazV48XwQzN0Oa6mEU8h7WUsW6MU1Zql5dluQsirHPUPjPPnjZc+EK3wBRMPjLVD pWw4G8ZjpN9qQQB8sRBZkRJg5XO0lJPVgQGxXURjESzNGZDCZVnKXOntSEXTpaVOE35K onT9nLJcvkxWoIjMgSc2p8fd/K+0lk84rn7Rl03+U2y9cznGf33I6FhfmHXcvWJLlklZ oAeQzFsPOQ4YVpWcqbvTt6Ex+2AEOtawIhpa4qByNsBHD5vfRqBVdf1s3rLJoiUJgrgv r3Gw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:subject:user-agent:mime-version:date:message-id; bh=/PSdGoRtFkRlWJr4bbb76UaRFORDQ23cCT2oQbSYVVE=; b=h+ztnJ833zt/9sHPIBBKzZZpqA0uayQ/szxZ4gar/bA8pooaQI1qLKHkBU9iFA9Sxu h6Mi8bdO3yWpXyoSN3EV/CvZenR4vZAOBsHiN217jcPpIgfntDzFLHBMllEi7tM7lzwR +7lOyOHKbYCN/Q5pavKpS/RBUImMzDzUJlrEIWc/vvqOU6iQFJ7dk6mFigSXtkrDzKFA gqtkWEZBiDfa1OdwDVkoGJft8P34nwjOph4Kg4QjKuw30/WFrSkG1lbtyJnWNuh9vgyK Qm0XpgRG2GQBCRoA0se1UZLqO2a7mZ2aOwjm6SiXSBb2oRrJsTz+58PUacxWgxhGn6b7 XDtg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g20-20020a63f414000000b0046af646c669si2695605pgi.664.2022.10.25.04.51.19; Tue, 25 Oct 2022 04:51:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231608AbiJYLuJ (ORCPT + 99 others); Tue, 25 Oct 2022 07:50:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38474 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231800AbiJYLuF (ORCPT ); Tue, 25 Oct 2022 07:50:05 -0400 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C781B2CDCE for ; Tue, 25 Oct 2022 04:50:01 -0700 (PDT) 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 X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. >