Received: by 2002:a05:6830:16d2:b0:61c:ac69:ca1b with SMTP id l18csp197052otr; Thu, 4 Aug 2022 00:29:49 -0700 (PDT) X-Google-Smtp-Source: AA6agR6NtXbDNJrGPUkSEbjdBybeqlOKg0guyJJll8OHfINUXkR7x2c5Q9GeBHImcFZeGf1mJVyw X-Received: by 2002:a17:902:6b82:b0:16d:d268:3842 with SMTP id p2-20020a1709026b8200b0016dd2683842mr725426plk.16.1659598189698; Thu, 04 Aug 2022 00:29:49 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1659598189; cv=pass; d=google.com; s=arc-20160816; b=U+UfabpLrwk64fWJnOsWX2eB3R+h6nHzZeEzSS55ZNRkVxmi1o19QGT3MAMGpieQJ7 oNWDeqqHQx8cWImcr9xuQoMOAZe+BFY0oVIyNRBDi1IQPgciae0t641q6iLCHI3Qqyji A0RTVq8qlMiEbj5Z6683HFIiYGZrzcF/2WxFk4xUFc6JNYwCjuAhYmN8aZncSscHWXAN rjlfMwA60NSqVG9upQjQtYV9biHTgH48Cg3LNRY8ftUxqfl6wlLYb+eOp8l+0mkx7bbD r/NWRjbTCPDx2cbcaxiMaWOgIhS4Zv86cK/8xFPvKCibUvXY36art2CF2jXlmH8XbLCk XvFw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:importance:content-transfer-encoding :mime-version:subject:references:in-reply-to:message-id:cc:to:from :date:dkim-signature; bh=MCrWicY2XoCiSIKwKmcXAPX12IeBhhZabwszQBGvXqM=; b=ZlgSLnVDQ4dJHfxfaKqHCh8V8syDSdJQpt1Av+KZEuQL6AtFJoq93PNZ66gC0JaaO6 Wepor40wcf7d3dB0OCGoY1VOFGvWYtnFIBy1dPiZYPkIxiecokpf7mysmBsFuDgHatrC /KHkn+95kscKDRrrbexn+U6gYIOFSgKZUXbbFUDpOuASUMpd6LMluK4WneKXMFonD0O/ GnPkqulvfKW10Ux+PWXPbRyscic6d0gouYTXtrGsULI/HfWJWDXZsALazoBOiXg1xxEa iXH3BRWuRZjMFd+B8FWcVGjf8MJoSNo4JanvmWMp2yRFgeplCkB/NOm4M6ph6yHW3lji 2+Qg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux.beauty header.s=zmail header.b=LJu2o83L; arc=pass (i=1 spf=pass spfdomain=linux.beauty dkim=pass dkdomain=linux.beauty dmarc=pass fromdomain=linux.beauty>); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a7-20020aa794a7000000b0052d4197336fsi60569pfl.370.2022.08.04.00.29.35; Thu, 04 Aug 2022 00:29:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.beauty header.s=zmail header.b=LJu2o83L; arc=pass (i=1 spf=pass spfdomain=linux.beauty dkim=pass dkdomain=linux.beauty dmarc=pass fromdomain=linux.beauty>); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239039AbiHDHSJ (ORCPT + 99 others); Thu, 4 Aug 2022 03:18:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43368 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229592AbiHDHSH (ORCPT ); Thu, 4 Aug 2022 03:18:07 -0400 Received: from sender4-op-o18.zoho.com (sender4-op-o18.zoho.com [136.143.188.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6C8855C969; Thu, 4 Aug 2022 00:18:04 -0700 (PDT) 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 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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