Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp6756704rwr; Tue, 2 May 2023 05:17:28 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7A7uHx8XHa1Iv+wL6kgAEClp2cp9JgfzVNGK5t+D7ubvZxQWSAF48w/Gr0RXxuLf/x6Efq X-Received: by 2002:a17:90a:fa91:b0:24e:180a:e1e5 with SMTP id cu17-20020a17090afa9100b0024e180ae1e5mr4229097pjb.26.1683029847855; Tue, 02 May 2023 05:17:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683029847; cv=none; d=google.com; s=arc-20160816; b=G51TPlL9LzLZM3ty01O8AsXmy1ZTTy5Wb44oktfQIgER7fkfnSUuP1GC5sJYH9otpO IT99CSNKsScn7SqnmdUS/TLt8JKfAntZ8AVgrJAMFQdXzOcNwQqX2rCORb+MndLvifbU M9vOmAR5TzbF0PJPqml5f/Wl1Ni7gF2nf0pAJ5BgY0ppUA5qkd3kiaDIhmWm1ZJsVGyd wAPOBBJfy9sG6AxM2tKtWJO+KdiNJKpLKZuZrhZ2DE18bs7dcdnlzExpoU72wBT+eBDq 8xTXuBghB7dL3JkvWZ7iCvzRVhJiXLzDLOfIjM/czDhay0m34y6smIsjH9NFVegpJUKH uWLw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :content-language:accept-language:in-reply-to:references:message-id :date:thread-index:thread-topic:subject:cc:to:from; bh=eDymzKCzvv53XdOILZANy5JQXh1Lj3RbtUtnFPU0CHk=; b=wQbU9bZS+3nrgnP8Blbpp2JT0QTBSM8/Aq/NC2HMNdgXkkAzTNXSSbLPF7AssgSWaQ dj4moN+2vI0ohI5MzAF2TDkFEb5bv3uIDzYncBe6fpTOyXwH/k2xYYn4TW5w/Y/R9raj sg/xMG4h3+7eZQoEzLpN0uZHCyMexf/AXdCsDAbCWhA0Vr6CUDcaGGaQWo4exKw1aJEb n08dA3rZ0+2NrkC0aSs3+RCe/nUSatBsHO2xwlIAzJcEYeEvDf6/zkDp3kMWf45jyysU J7bLW4liNOhDoxW8BbhbmRzAuTcMRzn46+KStI1rYpsk9BZvyaosgOZMv5rL+QeqYX4f 1bmw== 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ot2-20020a17090b3b4200b0023f37b648d9si36544017pjb.157.2023.05.02.05.17.16; Tue, 02 May 2023 05:17:27 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234179AbjEBMQn (ORCPT + 99 others); Tue, 2 May 2023 08:16:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44004 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234142AbjEBMQl (ORCPT ); Tue, 2 May 2023 08:16:41 -0400 Received: from SHSQR01.spreadtrum.com (mx1.unisoc.com [222.66.158.135]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AAE0E9B for ; Tue, 2 May 2023 05:16:39 -0700 (PDT) Received: from SHSend.spreadtrum.com (bjmbx02.spreadtrum.com [10.0.64.8]) by SHSQR01.spreadtrum.com with ESMTP id 342CCTeq008795; Tue, 2 May 2023 20:12:29 +0800 (+08) (envelope-from zhaoyang.huang@unisoc.com) Received: from BJMBX01.spreadtrum.com (10.0.64.7) by BJMBX02.spreadtrum.com (10.0.64.8) with Microsoft SMTP Server (TLS) id 15.0.1497.23; Tue, 2 May 2023 20:12:28 +0800 Received: from BJMBX01.spreadtrum.com ([fe80::54e:9a:129d:fac7]) by BJMBX01.spreadtrum.com ([fe80::54e:9a:129d:fac7%16]) with mapi id 15.00.1497.023; Tue, 2 May 2023 20:12:29 +0800 From: =?utf-8?B?6buE5pyd6ZizIChaaGFveWFuZyBIdWFuZyk=?= To: "'Roman Gushchin'" CC: Andrew Morton , Roman Gushchin , "linux-mm@kvack.org" , "linux-kernel@vger.kernel.org" , Zhaoyang Huang , =?utf-8?B?546L56eRIChLZSBXYW5nKQ==?= Subject: =?utf-8?B?562U5aSNOiBbUEFUQ0hdIG1tOiBvcHRpbWl6YXRpb24gb24gcGFnZSBhbGxv?= =?utf-8?Q?cation_when_CMA_enabled?= Thread-Topic: [PATCH] mm: optimization on page allocation when CMA enabled Thread-Index: AQHZfFAdfKMKvIudzkyaBTzwMCVkSq9G1QKw Date: Tue, 2 May 2023 12:12:28 +0000 Message-ID: References: <1682679641-13652-1-git-send-email-zhaoyang.huang@unisoc.com> In-Reply-To: Accept-Language: zh-CN, en-US Content-Language: zh-CN X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [10.0.93.65] Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 MIME-Version: 1.0 X-MAIL: SHSQR01.spreadtrum.com 342CCTeq008795 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE 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 PiBIaSBaaGFveWFuZyENCj4gDQo+IE9uIEZyaSwgQXByIDI4LCAyMDIzIGF0IDA3OjAwOjQxUE0g KzA4MDAsIHpoYW95YW5nLmh1YW5nIHdyb3Rl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g ICAgICAgICAgICAgICogYXJvdW5kIGxvdyB3aGVuIGJlaW5nIGRyYWluZWQgYnkgR0ZQX01PVkFC TEUNCj4gPiArICAgICAgICAgICAgICAqLw0KPiA+ICsgICAgICAgICAgICAgaWYgKGFsbG9jX2Zs YWdzIDw9IEFMTE9DX1dNQVJLX0xPVykNCj4gPiArICAgICAgICAgICAgICAgICAgICAgY21hX2Zp cnN0ID0gdHJ1ZTsNCj4gPiArICAgICAgICAgICAgIC8qY2hlY2sgcHJvcG9ydGlvbiBmb3IgV01B UktfSElHSCovDQo+ID4gKyAgICAgICAgICAgICBlbHNlIHsNCj4gPiArICAgICAgICAgICAgICAg ICAgICAgY291bnQgPQ0KPiBhdG9taWNfbG9uZ19yZWFkKCZ6b25lLT5tYW5hZ2VkX3BhZ2VzKTsN Cj4gPiArICAgICAgICAgICAgICAgICAgICAgY21hX3Byb3BvcnRpb24gPSB6b25lLT5jbWFfcGFn ZXMgKiAxMDAgLyBjb3VudDsNCj4gPiArICAgICAgICAgICAgICAgICAgICAgY21hX2ZyZWVfcHJv cG9ydGlvbiA9IHpvbmVfcGFnZV9zdGF0ZSh6b25lLA0KPiBOUl9GUkVFX0NNQV9QQUdFUykgKiAx MDANCj4gPiArICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvICB6b25lX3BhZ2Vfc3RhdGUo em9uZSwNCj4gTlJfRlJFRV9QQUdFUyk7DQo+ID4gKyAgICAgICAgICAgICAgICAgICAgIGNtYV9m aXJzdCA9IChjbWFfZnJlZV9wcm9wb3J0aW9uID49DQo+IHdtX2ZhY3RbYWxsb2NfZmxhZ3NdICog Y21hX3Byb3BvcnRpb24NCj4gPiArICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg IHx8IGNtYV9mcmVlX3Byb3BvcnRpb24gPj0NCj4gNTApOw0KPiA+ICsgICAgICAgICAgICAgfQ0K PiA+ICsgICAgIH0NCj4gPiArICAgICByZXR1cm4gY21hX2ZpcnN0Ow0KPiA+ICt9D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