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.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,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 E3A64C47420 for ; Mon, 28 Sep 2020 23:36:39 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 6AC6320774 for ; Mon, 28 Sep 2020 23:36:39 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=mg.codeaurora.org header.i=@mg.codeaurora.org header.b="lw6p/fW4" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6AC6320774 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 076F16B0062; Mon, 28 Sep 2020 19:36:39 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 028FD8E0001; Mon, 28 Sep 2020 19:36:38 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E32066B006C; Mon, 28 Sep 2020 19:36:38 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0168.hostedemail.com [216.40.44.168]) by kanga.kvack.org (Postfix) with ESMTP id CF8266B0062 for ; Mon, 28 Sep 2020 19:36:38 -0400 (EDT) Received: from smtpin19.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 8FCBD180AD802 for ; Mon, 28 Sep 2020 23:36:38 +0000 (UTC) X-FDA: 77314082076.19.trade18_620880d27185 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin19.hostedemail.com (Postfix) with ESMTP id 6B8DF1ACEBC for ; Mon, 28 Sep 2020 23:36:38 +0000 (UTC) X-HE-Tag: trade18_620880d27185 X-Filterd-Recvd-Size: 4512 Received: from m42-4.mailgun.net (m42-4.mailgun.net [69.72.42.4]) by imf37.hostedemail.com (Postfix) with ESMTP for ; Mon, 28 Sep 2020 23:36:36 +0000 (UTC) DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1601336197; h=Message-Id: Date: Subject: Cc: To: From: Sender; bh=qm6e3gIk1HVjckjZWafdqcglqnXJMopOHykD9DbPjxU=; b=lw6p/fW452IS9wBqUCYmFh4MuDQQGEedTdg7gu5dgv+epkN5KvMrWPrAZ4qxv5Npf49NBCPN eQbtOCQO+vTYa76uYqurnjmcxaWcA+uZBqsJdpiR3ap1WDGsBOTEvbPL8V04pBPlUdYtGqW+ LwxYQTrPmg0ZuHIXXAuBVVsy/4Q= X-Mailgun-Sending-Ip: 69.72.42.4 X-Mailgun-Sid: WyIwY2Q3OCIsICJsaW51eC1tbUBrdmFjay5vcmciLCAiYmU5ZTRhIl0= Received: from smtp.codeaurora.org (ec2-35-166-182-171.us-west-2.compute.amazonaws.com [35.166.182.171]) by smtp-out-n07.prod.us-west-2.postgun.com with SMTP id 5f727381bebf546dbb497d65 (version=TLS1.2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256); Mon, 28 Sep 2020 23:36:33 GMT Received: by smtp.codeaurora.org (Postfix, from userid 1001) id 2492AC433CB; Mon, 28 Sep 2020 23:36:33 +0000 (UTC) Received: from cgoldswo-linux.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: cgoldswo) by smtp.codeaurora.org (Postfix) with ESMTPSA id 06198C433C8; Mon, 28 Sep 2020 23:36:26 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 06198C433C8 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, linux-mm@kvack.org, minchan@kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, pratikp@codeaurora.org, pdaly@codeaurora.org, sudaraja@codeaurora.org, iamjoonsoo.kim@lge.com, david@redhat.com, vinmenon@codeaurora.org, minchan.kim@gmail.com Cc: Chris Goldsworthy Subject: [PATCH v5] mm: cma: indefinitely retry allocations in cma_alloc Date: Mon, 28 Sep 2020 16:36:21 -0700 Message-Id: X-Mailer: git-send-email 2.7.4 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000563, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: V1: Introduces a retry loop that attempts a CMA allocation a finite number of times before giving up: https://lkml.org/lkml/2020/8/5/1097 https://lkml.org/lkml/2020/8/11/893 V2: Introduces an indefinite retry for CMA allocations. David Hildenbrand raised a page pinning example which precludes doing this infite-retrying for all CMA users: https://lkml.org/lkml/2020/9/17/984 V3: Re-introduce a GFP mask argument for cma_alloc(), that can take in __GFP_NOFAIL as an argument to indicate that a CMA allocation should be retried indefinitely. This lets callers of cma_alloc() decide if they want to perform indefinite retires. Also introduces a config option for controlling the duration of the sleep between retries: https://www.spinics.net/lists/linux-mm/msg228778.html V4: In response to comments by Minchan Kim, we make the sleep interruptable and remove a defconfig option controlling how long the sleep lasts for (it is now a fixed 100 ms): https://lkml.org/lkml/2020/9/28/1144 V5: Add missing fatal_signal_pending() check Chris Goldsworthy (1): mm: cma: indefinitely retry allocations in cma_alloc arch/powerpc/kvm/book3s_hv_builtin.c | 2 +- drivers/dma-buf/heaps/cma_heap.c | 2 +- drivers/s390/char/vmcp.c | 2 +- drivers/staging/android/ion/ion_cma_heap.c | 2 +- include/linux/cma.h | 2 +- kernel/dma/contiguous.c | 4 +-- mm/cma.c | 39 +++++++++++++++++++++++++----- mm/cma_debug.c | 2 +- mm/hugetlb.c | 4 +-- 9 files changed, 43 insertions(+), 16 deletions(-) -- The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project