From patchwork Thu Oct 22 22:53:06 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roman Gushchin X-Patchwork-Id: 11852091 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E528361C for ; Thu, 22 Oct 2020 22:53:26 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 8ADDB241A6 for ; Thu, 22 Oct 2020 22:53:26 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=fb.com header.i=@fb.com header.b="HYJ0nzsK" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8ADDB241A6 Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=fb.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 9BF106B0062; Thu, 22 Oct 2020 18:53:25 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 93B136B006C; Thu, 22 Oct 2020 18:53:25 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 828FD6B006E; Thu, 22 Oct 2020 18:53:25 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0107.hostedemail.com [216.40.44.107]) by kanga.kvack.org (Postfix) with ESMTP id 589D06B0062 for ; Thu, 22 Oct 2020 18:53:25 -0400 (EDT) Received: from smtpin07.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 02CED181AC217 for ; Thu, 22 Oct 2020 22:53:25 +0000 (UTC) X-FDA: 77401064370.07.mine89_6103a4427254 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin07.hostedemail.com (Postfix) with ESMTP id D6CB21803F9A3 for ; Thu, 22 Oct 2020 22:53:24 +0000 (UTC) X-Spam-Summary: 1,0,0,,d41d8cd98f00b204,prvs=7564a8c327=guro@fb.com,,RULES_HIT:30012:30054:30064,0,RBL:67.231.145.42:@fb.com:.lbl8.mailshell.net-62.18.0.100 64.10.201.10;04yfau8azskfab91bcxegcq1wa5h6ycwhbqthjppd4wma97fztr97t8frhkk7ua.mooboz354az9qdsz9qioycrmu6ykoqs9aonnkoo9rw9yngxd5pkkato95t3fzpw.g-lbl8.mailshell.net-223.238.255.100,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fp,MSBL:0,DNSBL:neutral,Custom_rules:0:0:0,LFtime:25,LUA_SUMMARY:none X-HE-Tag: mine89_6103a4427254 X-Filterd-Recvd-Size: 3818 Received: from mx0a-00082601.pphosted.com (mx0a-00082601.pphosted.com [67.231.145.42]) by imf05.hostedemail.com (Postfix) with ESMTP for ; Thu, 22 Oct 2020 22:53:24 +0000 (UTC) Received: from pps.filterd (m0148461.ppops.net [127.0.0.1]) by mx0a-00082601.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 09MMiT5c008648 for ; Thu, 22 Oct 2020 15:53:23 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fb.com; h=from : to : cc : subject : date : message-id : content-type : content-transfer-encoding : mime-version; s=facebook; bh=iaQ6uUUMB3v2zOgoAFTWl7pLBRX74lAv1EY9e2OAqjY=; b=HYJ0nzsKiUyuB8zs5NFyy03Y9MQP5y8F509t7DCidNrBIpRK3EtAiEg7/5/B1S3A37dx MHP+3e9bC6XFlTWEkvE2rNQhG6eKKfmA1yHWYdOc/cTOPe8gTjLlZJS5JrxVeNlfPa3B Ex35skwFrOzdOZ4u0IhjesfEV1XiZB187dk= Received: from maileast.thefacebook.com ([163.114.130.16]) by mx0a-00082601.pphosted.com with ESMTP id 34a57yx3ev-19 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128 verify=NOT) for ; Thu, 22 Oct 2020 15:53:23 -0700 Received: from intmgw001.41.prn1.facebook.com (2620:10d:c0a8:1b::d) by mail.thefacebook.com (2620:10d:c0a8:82::d) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1979.3; Thu, 22 Oct 2020 15:53:20 -0700 Received: by devvm1755.vll0.facebook.com (Postfix, from userid 111017) id E69E91A3AE48; Thu, 22 Oct 2020 15:53:12 -0700 (PDT) From: Roman Gushchin To: Andrew Morton CC: Zi Yan , Joonsoo Kim , Mike Kravetz , , , , , Roman Gushchin Subject: [PATCH v1 0/2] mm: cma: introduce a non-blocking version of cma_release() Date: Thu, 22 Oct 2020 15:53:06 -0700 Message-ID: <20201022225308.2927890-1-guro@fb.com> X-Mailer: git-send-email 2.24.1 X-FB-Internal: Safe X-Proofpoint-UnRewURL: 0 URL was un-rewritten MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.235,18.0.737 definitions=2020-10-22_17:2020-10-20,2020-10-22 signatures=0 X-Proofpoint-Spam-Details: rule=fb_default_notspam policy=fb_default score=0 mlxlogscore=566 lowpriorityscore=0 bulkscore=0 spamscore=0 mlxscore=0 phishscore=0 clxscore=1015 adultscore=0 priorityscore=1501 suspectscore=0 malwarescore=0 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2010220145 X-FB-Internal: deliver 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: This small patchset introduces a non-blocking version of cma_release() 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. v1: - introduce cma_release_nowait() instead of making cma_release() non-blocking, for performance reasons rfc: https://lkml.org/lkml/2020/10/16/1050 Roman Gushchin (2): mm: cma: introduce cma_release_nowait() mm: hugetlb: don't drop hugetlb_lock around cma_release() call include/linux/cma.h | 2 + mm/cma.c | 93 +++++++++++++++++++++++++++++++++++++++++++++ mm/cma.h | 5 +++ mm/hugetlb.c | 11 ++---- 4 files changed, 103 insertions(+), 8 deletions(-)