Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp5402918pxu; Thu, 22 Oct 2020 01:01:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzP3pYBJ0xaU+MSORk9cM1m0ddCCdMlz1h8zjv4jgn/4L0X5OyHWaHgwrBzw+qJJYv7nbgi X-Received: by 2002:a17:906:ad8a:: with SMTP id la10mr1094602ejb.176.1603353669469; Thu, 22 Oct 2020 01:01:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603353669; cv=none; d=google.com; s=arc-20160816; b=spuCOnzJtwb4o+EKuI8c1iHVuBukLuAsvisqea8Q2Ud9jXn538VW61aZjlUgx+T7mQ pPZ6bAjBGmRuCvAi1jNLK3SwlJxV0ablkG9cgTe2/EGi97VlxURZaESqYwdIXGLDLpjt BrvG/YMDpmdsQ5DBLsIEhXOCitKlprQ3IGIsWNi+vqIvF7EhWA9ZbqFbl9d0w1JikvyS v8cToe9e8lZE8lSvNpnbXLz+GU5mX3oORrJmW2u4AKPkaQkAZR06HH13Qt4Uh1MIBLyF ZFqUqlSMiUMVHxU9vMiOiuYlwBvTrkXRreodOffKNnqwmebaIupzg9ZMkahvEPdow/pY MS/Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-language:content-transfer-encoding :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=RHLoXKW5SeGqeixifl3FjDdyXw9tV6TfIZTOT6N2JG8=; b=A1GN3BAdFaYRpGo3VWcKOAVknfamvVRtaWG/op3+ZptnzyfIxvam0Oz9KYovXz2k1T 9Ojgu6fFhWUmfM6kqh9Bq0aF7UXUSYkhRpsB6tAkdERYi9f1b2fne2hUk4uOkl7hQpH0 j3qoaeidTjQzllpdtTQMz2VSh8PjWVWuH+4d1MTzFRYFEIrNA0FysXFP7Gxm0z9PeeM/ 7ouR5LOT2R+7U7UWiEW2NWMaERKYF2blb5dGEuQPZNxh/dAmMt2NqPRDlsYtNFHwiuUo oc2xU9GQ5L4xSuzZ0CNJC7WeFP8VOVhS519qpNY4FljGgzlOnOxiR46oaYUQOy64nACT oKuw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g14si400919ejr.221.2020.10.22.01.00.46; Thu, 22 Oct 2020 01:01:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2894809AbgJVBy6 (ORCPT + 99 others); Wed, 21 Oct 2020 21:54:58 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:15758 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2411804AbgJVBy5 (ORCPT ); Wed, 21 Oct 2020 21:54:57 -0400 Received: from DGGEMS411-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id 0D637F6DA850343BA93E; Thu, 22 Oct 2020 09:54:56 +0800 (CST) Received: from [127.0.0.1] (10.143.60.252) by DGGEMS411-HUB.china.huawei.com (10.3.19.211) with Microsoft SMTP Server id 14.3.487.0; Thu, 22 Oct 2020 09:54:54 +0800 Subject: Re: [PATCH rfc 0/2] mm: cma: make cma_release() non-blocking To: Roman Gushchin , Andrew Morton CC: Zi Yan , Joonsoo Kim , "Mike Kravetz" , , , References: <20201016225254.3853109-1-guro@fb.com> From: "Xiaqing (A)" Message-ID: Date: Thu, 22 Oct 2020 09:54:53 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: <20201016225254.3853109-1-guro@fb.com> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-Originating-IP: [10.143.60.252] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2020/10/17 6:52, Roman Gushchin wrote: > This small patchset makes cma_release() non-blocking and simplifies > the code in hugetlbfs, where previously we had to temporarily drop > hugetlb_lock around the cma_release() call. > > It should help Zi Yan on his work on 1 GB THPs: splitting a gigantic > THP under a memory pressure requires a cma_release() call. If it's > a blocking function, it complicates the already complicated code. > Because there are at least two use cases like this (hugetlbfs is > another example), I believe it's just better to make cma_release() > non-blocking. > > It also makes it more consistent with other memory releasing functions > in the kernel: most of them are non-blocking. > > > Roman Gushchin (2): > mm: cma: make cma_release() non-blocking > mm: hugetlb: don't drop hugetlb_lock around cma_release() call > > mm/cma.c | 51 +++++++++++++++++++++++++++++++++++++++++++++++++-- > mm/hugetlb.c | 6 ------ > 2 files changed, 49 insertions(+), 8 deletions(-) > I don't think this patch is a good idea.It transfers part or even all of the time of cma_release to cma_alloc, which is more concerned by performance indicators. On Android phones, CPU resource competition is intense in many scenarios, As a result, kernel threads and workers can be scheduled only after some ticks or more. In this case, the performance of cma_alloc will deteriorate significantly, which is not good news for many services on Android.