From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 785AFC43461 for ; Fri, 11 Sep 2020 19:17:06 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id BD06222208 for ; Fri, 11 Sep 2020 19:17:05 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=codeaurora.org header.i=@codeaurora.org header.b="idZBUGZz"; dkim=pass (1024-bit key) header.d=amazonses.com header.i=@amazonses.com header.b="F4QlCdSi" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BD06222208 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 396BB6B0002; Fri, 11 Sep 2020 15:17:05 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 346F06B0003; Fri, 11 Sep 2020 15:17:05 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2351D6B0037; Fri, 11 Sep 2020 15:17:05 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0109.hostedemail.com [216.40.44.109]) by kanga.kvack.org (Postfix) with ESMTP id 0D8C46B0002 for ; Fri, 11 Sep 2020 15:17:05 -0400 (EDT) Received: from smtpin29.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id C28AF180AD817 for ; Fri, 11 Sep 2020 19:17:04 +0000 (UTC) X-FDA: 77251738368.29.nerve68_3c0adb2270f1 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin29.hostedemail.com (Postfix) with ESMTP id 89980180868F2 for ; Fri, 11 Sep 2020 19:17:04 +0000 (UTC) X-HE-Tag: nerve68_3c0adb2270f1 X-Filterd-Recvd-Size: 3734 Received: from a27-10.smtp-out.us-west-2.amazonses.com (a27-10.smtp-out.us-west-2.amazonses.com [54.240.27.10]) by imf08.hostedemail.com (Postfix) with ESMTP for ; Fri, 11 Sep 2020 19:17:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/simple; s=gbvhytky6xpx7itkhb67ktsxbiwpnxix; d=codeaurora.org; t=1599851822; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References; bh=GAaaPTdJyZWkXSqI/af+MrePYbvKkuKJ7Aq9ymeNk5M=; b=idZBUGZzFsO4AMLTDIjcL9QqmvK7TnSibfBDv73e+UOH6ddEPCKFj0Rnu6SRJoex hryfOhDbM4/LbIHeKAQS1AIDgh4/8pRdKxinnLckPUzyj4VVHow417s/UUY7e3GvSDy 8NOmV7/HCrNnL2c5DIVN8tQzPw37p2Ps3B7++pgo= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/simple; s=hsbnp7p3ensaochzwyq5wwmceodymuwv; d=amazonses.com; t=1599851822; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References:Feedback-ID; bh=GAaaPTdJyZWkXSqI/af+MrePYbvKkuKJ7Aq9ymeNk5M=; b=F4QlCdSiusC/MUkk4GAvRysu9ttmo4964GoG3Cn4G1BAeN2EnufS+igbApxw7uqc ai0f09bgkbo1p6X0ubeIrMnrVf35SP3GVmA9nGzoE4pzeIccbHkxCIMnfaRIDHd5xTp ZDkk04yADjlLXLOKSNqaMQd6DtcWD7kSEONgtdog= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 86BEAC433C6 Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; spf=fail smtp.mailfrom=cgoldswo@codeaurora.org From: Chris Goldsworthy To: akpm@linux-foundation.org Cc: linux-mm@kvack.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, pratikp@codeaurora.org, pdaly@codeaurora.org, sudraja@codeaurora.org, iamjoonsoo.kim@lge.com, linux-arm-msm-owner@vger.kernel.org, Chris Goldsworthy Subject: [PATCH v2] cma_alloc(), indefinitely retry allocations for -EBUSY failures Date: Fri, 11 Sep 2020 19:17:02 +0000 Message-ID: <010101747e997e00-a7fa11e6-74ae-46f7-8ab6-5fb5a4b04ac2-000000@us-west-2.amazonses.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <06489716814387e7f147cf53d1b185a8@codeaurora.org> References: <06489716814387e7f147cf53d1b185a8@codeaurora.org> X-SES-Outgoing: 2020.09.11-54.240.27.10 Feedback-ID: 1.us-west-2.CZuq2qbDmUIuT3qdvXlRHZZCpfZqZ4GtG9v3VKgRyF0=:AmazonSES X-Rspamd-Queue-Id: 89980180868F2 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam02 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: On mobile devices, failure to allocate from a CMA area constitutes a functional failure. Sometimes during CMA allocations, we have observed that pages in a CMA area allocated through alloc_pages(), that we're trying to migrate away to make room for a CMA allocation, are temporarily pinned. This temporary pinning can occur when a process that owns the pinned page is being forked (the example is explained further in the commit text), or it is exiting. This patch addresses this issue by indefinitely retrying allocations that fail due to a return of -EBUSY. Change log: v1: We were performing retries of the allocation a fixed number of times. Andrew Morton disliked this, as it didn't guarantee that the allocation would succeed. v2: To address this concern, we switched to retrying indefinitely, as opposed to doing to retrying the allocation a limited number of times. Chris Goldsworthy (1): mm: cma: indefinitely retry allocations in cma_alloc mm/cma.c | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) -- The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project