Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp1733397pxu; Fri, 16 Oct 2020 22:31:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJycuQenuMwIeMxePx2tMYc7DS0TvNtQOtKxjTuTibtwkClMlcnO4JBbwL/ddDSr0WiHyZSU X-Received: by 2002:a17:906:935a:: with SMTP id p26mr7097978ejw.30.1602912691716; Fri, 16 Oct 2020 22:31:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602912691; cv=none; d=google.com; s=arc-20160816; b=xPhTX7SBjfRzhorZ4+p96R81usEkMv8GsMRsUN3Xe7cxECJIxI8G7VhLNoo3yW+hn5 xCcOzFKOhDooDpVeWLrNib7jJNolQX0EVI2icPvxmnAPXtYt6UqLx/z5cKSVVqrqvJRj ppGPpVC3fZuBhJ6pT+gF7B0USxZ/yEaG5rO4rf3fHkTeI44FEjKK6Z/zT1/jRjz+NGOt ylmKJCfpk4nf1sDqcHlhfg+Ot5DgX5/ICDVGknE/9O5FeGb54xucvyh/Yh7yhdldnHlx 53M3eULSMzAKLTN8AsNHWaCRV+SWiGAcRxIv8dOjIMHdQM9yn7PwBhGQEHYbJiMypayT hPzQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=nVcWRyEwxNd3Ji+bB1DfzrrYhgMCm7kylhpy1EG3lOQ=; b=CVOdscn7Zh0qcoLLKM96E3Ik6EB2YTSM4sbVmuGMfvh2eB/1M2s/ivyNKm3rG+IP7x zt/JD/01jGg1ObBSxzX+bRoacNO3lpBI94k+oLxh6guXDCmqTuH5Fj84bxLnsXLkLh4Q HEAhFXmwpRDLOywswTFITuW99MCjfJatWg6WGvngYw6TScZhINUYt8btyzcOOUr5cWTK DwfenaYUT4r2/YNiAIWzXCUdwFSpU75jONo3ZYzFBuSREnmFf581IPCS2iXAFqDJ6unH mD4SfBaAnvMLQvanAKzdGQaAy4f+BygL+odnF56Xq0uIhd+a3KfkU5waTZV93VEwJ7rd DRgg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@fb.com header.s=facebook header.b=T71wcns7; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=fb.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s26si3179793eds.49.2020.10.16.22.31.09; Fri, 16 Oct 2020 22:31:31 -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; dkim=pass header.i=@fb.com header.s=facebook header.b=T71wcns7; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=fb.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2392292AbgJPWxD (ORCPT + 99 others); Fri, 16 Oct 2020 18:53:03 -0400 Received: from mx0b-00082601.pphosted.com ([67.231.153.30]:57344 "EHLO mx0b-00082601.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2391017AbgJPWxC (ORCPT ); Fri, 16 Oct 2020 18:53:02 -0400 Received: from pps.filterd (m0109332.ppops.net [127.0.0.1]) by mx0a-00082601.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 09GMoQbZ028445 for ; Fri, 16 Oct 2020 15:53:01 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fb.com; h=from : to : cc : subject : date : message-id : mime-version : content-type : content-transfer-encoding; s=facebook; bh=nVcWRyEwxNd3Ji+bB1DfzrrYhgMCm7kylhpy1EG3lOQ=; b=T71wcns7PKbDIvJRMkUidiTnM7aZ4//HBWcbhTkYvX22aRocQon/2sDfoOeX24l+wGlN /jY+munTitE0I6IMBeF7JdKxccXVRpjDWRDaRDO6JAKIErGKM7zCHG0Y8G+rs45zi7m7 F//6IduGb29sd2hauzfo+Z4mFOqV+aR69sQ= Received: from mail.thefacebook.com ([163.114.132.120]) by mx0a-00082601.pphosted.com with ESMTP id 346ppeh5j5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Fri, 16 Oct 2020 15:53:01 -0700 Received: from intmgw001.06.prn3.facebook.com (2620:10d:c085:108::8) by mail.thefacebook.com (2620:10d:c085:21d::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1979.3; Fri, 16 Oct 2020 15:53:00 -0700 Received: by devvm1755.vll0.facebook.com (Postfix, from userid 111017) id 9593916EFB76; Fri, 16 Oct 2020 15:52:56 -0700 (PDT) From: Roman Gushchin To: Andrew Morton CC: Zi Yan , Joonsoo Kim , Mike Kravetz , , , , Roman Gushchin Subject: [PATCH rfc 0/2] mm: cma: make cma_release() non-blocking Date: Fri, 16 Oct 2020 15:52:52 -0700 Message-ID: <20201016225254.3853109-1-guro@fb.com> X-Mailer: git-send-email 2.24.1 MIME-Version: 1.0 X-FB-Internal: Safe Content-Type: text/plain Content-Transfer-Encoding: quoted-printable X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.235,18.0.687 definitions=2020-10-16_12:2020-10-16,2020-10-16 signatures=0 X-Proofpoint-Spam-Details: rule=fb_default_notspam policy=fb_default score=0 phishscore=0 mlxlogscore=478 malwarescore=0 bulkscore=0 lowpriorityscore=0 suspectscore=0 mlxscore=0 spamscore=0 clxscore=1015 adultscore=0 priorityscore=1501 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2010160162 X-FB-Internal: deliver Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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(-) --=20 2.26.2