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 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 71A3DC00144 for ; Thu, 4 Aug 2022 07:18:02 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 9F1938E0003; Thu, 4 Aug 2022 03:18:01 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 9A0FB8E0001; Thu, 4 Aug 2022 03:18:01 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 89C248E0003; Thu, 4 Aug 2022 03:18:01 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 7A5018E0001 for ; Thu, 4 Aug 2022 03:18:01 -0400 (EDT) Received: from smtpin25.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 56556A16BD for ; Thu, 4 Aug 2022 07:18:01 +0000 (UTC) X-FDA: 79761055962.25.DF444EA Received: from sender4-op-o18.zoho.com (sender4-op-o18.zoho.com [136.143.188.18]) by imf12.hostedemail.com (Postfix) with ESMTP id BFFCA40005 for ; Thu, 4 Aug 2022 07:18:00 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; t=1659597467; cv=none; d=zohomail.com; s=zohoarc; b=RitbPrTTslmZ0rPk5lvqDAN+IY0eVaS9hFna7Pc9GW8iD/DSs4WLGyXaWsKTh/h0Sv33aOR5AKW24q5Wdl5EHivYpMvkPAWXQNTFV3+W0amucqlIcsHJ4Xb2tiUXzQENIRGJtOAjuFEzX32ExVYJUGDInOgN47mo3zG2/E4EVSw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1659597467; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=MCrWicY2XoCiSIKwKmcXAPX12IeBhhZabwszQBGvXqM=; b=iY2LdKOooPCVsRu0qmwu0I9Cx/CBcCd9k8jYRS6LJNNkkFSPKdLwHklx5s00McmgtKg640Tts/KS0u2P0ofjFHS2D1tfcli7+pntpEej22Djx7zOwIpm/mYQp3+SLcg4lSrLiP6ojYgcObuyF1L1VxjFqfLYZnpKm4tfo82WuhE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=linux.beauty; spf=pass smtp.mailfrom=me@linux.beauty; dmarc=pass header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1659597467; s=zmail; d=linux.beauty; i=me@linux.beauty; h=Date:Date:From:From:To:To:Cc:Cc:Message-ID:In-Reply-To:References:Subject:Subject:MIME-Version:Content-Type:Content-Transfer-Encoding:Message-Id:Reply-To; bh=MCrWicY2XoCiSIKwKmcXAPX12IeBhhZabwszQBGvXqM=; b=LJu2o83LsU5SFrXTdMic49rOunqaJpFgFtVKLTdIhRbHvgZsJKMunXpMjLk2r69R e05WmXzI1FCI9X/uubv2HxT4UUHLv0f9c+S719GbZWyuB7h3iO/VAFUZ9TQJF5SDCWa oR+tXlOIPNnOqnpIGDgCf7wN4DpfEGJr9fukWZxg= Received: from mail.zoho.com by mx.zohomail.com with SMTP id 1659597465146222.34603720111716; Thu, 4 Aug 2022 00:17:45 -0700 (PDT) Date: Thu, 04 Aug 2022 16:17:45 +0900 From: Li Chen To: "Arnd Bergmann" Cc: "Catalin Marinas" , "Will Deacon" , "Rob Herring" , "Frank Rowand" , "Andrew Morton" , "Li Chen" , "Linux ARM" , "Linux Kernel Mailing List" , "DTML" , "Linux-MM" Message-ID: <18267b7a61f.12b26bd91245310.4476663913461696630@linux.beauty> In-Reply-To: References: <20220711122459.13773-1-me@linux.beauty> <20220711122459.13773-5-me@linux.beauty> <181efcca6ae.de84203d522625.7740936811073442334@linux.beauty> Subject: Re: [PATCH 4/4] sample/reserved_mem: Introduce a sample of struct page and dio support to no-map rmem MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Importance: Medium User-Agent: Zoho Mail X-Mailer: Zoho Mail ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1659597481; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=MCrWicY2XoCiSIKwKmcXAPX12IeBhhZabwszQBGvXqM=; b=Sy7QgglIBIEuw/44ZOrEZltcAmGR6Jv5RSCJx4hZ7LHChu2LiwpCiXMxS8FlLm5SCyin4m hYHR/u/aucZ8JPoDnxATOVSga75bh393myeGTpac5o4Uksf/MI7cCnQAITl2d1iMExOXSv Wi+gi1PU+xptxXIWNksU8tOTG/7rSqg= ARC-Authentication-Results: i=2; imf12.hostedemail.com; dkim=pass header.d=linux.beauty header.s=zmail header.b=LJu2o83L; spf=pass (imf12.hostedemail.com: domain of me@linux.beauty designates 136.143.188.18 as permitted sender) smtp.mailfrom=me@linux.beauty; arc=pass ("zohomail.com:s=zohoarc:i=1"); dmarc=none ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1659597481; a=rsa-sha256; cv=pass; b=tMudkvXkktPg9qWoAXwx0OUGT3uUNczZgEJ7FsTL/vnXQI5q7CoIE1bQ3VI4E7EUNQ6BRs nPDNMTy6nh8K/AS2904kLMJGTVxcDgqvN7qKIHfzePYQvjyuf3MQoM/2zm+uNB+UIHKmko Fdfqj4FVGw6xPsMmj2lx+EigHiDs5Pk= X-Stat-Signature: wqtxgdk13ybz6ybymx49ictcostqewau X-Rspam-User: X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: BFFCA40005 Authentication-Results: imf12.hostedemail.com; dkim=pass header.d=linux.beauty header.s=zmail header.b=LJu2o83L; spf=pass (imf12.hostedemail.com: domain of me@linux.beauty designates 136.143.188.18 as permitted sender) smtp.mailfrom=me@linux.beauty; arc=pass ("zohomail.com:s=zohoarc:i=1"); dmarc=none X-HE-Tag: 1659597480-575652 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: Hi Arnd, ---- On Tue, 12 Jul 2022 16:50:46 +0900 Arnd Bergmann wrote --- > Does your hardware require a fixed address for the buffer? If it can be > anywhere in memory (or at least within a certain range) but just has to > be physically contiguous, the normal way would be to use a CMA area > to allocate from, which gives you 'struct page' backed pages. CMA does support Direct I/O, but it has its own issue: It does not guarantee that the memory previously borrowed by the OS will be returned to the device. We've been plagued by examples like this in the past: Many other kernel modules/subsystems have already allocated much memory from both non-CMA and CMA memory, When our DSP driver got probed then, cma_alloc will fail in that non-CMA system memory is not enough for CMA memory to migrate. Regards, Li