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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 937A3C00140 for ; Fri, 5 Aug 2022 15:30:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:Subject:From:References:Cc: To:MIME-Version:Date:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=I/u79Oe2sMbfxvqARRzOmZir8hbMlmxXSz4i8EnchFg=; b=OeWVe5TUZyzo4d BstbcW61pHA+pnDAzDi3+tfPB6I5kVrIpniFv3NwP5bT3f9oWCq42YiIrx57KGdemkATi0ms2pDBy ov5SXPuVGy7oMKmplpvxNpKPXxFYYP11V6P5g36JpoYSmzCljbscS2sBYDhOkoupYhv3tLwCloEML FWV1XDE3phE/dJsDC0A3SDK7tz2eCmCoGAPZN/WvoScpL498HLmUfdFU75Z3M9gUvetYsyJeRasJN CIrByyxeSlHnYNQlvFSdKVPve4kZVbZP7wvnYD4xylECKgH/GWGEJC+Gxk/USeOvzI11k8DXYi6K1 mU9d+xCtZwIpltiX+e5g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oJzG1-00GIwN-3l; Fri, 05 Aug 2022 15:29:01 +0000 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oJzFw-00GItr-To for linux-arm-kernel@lists.infradead.org; Fri, 05 Aug 2022 15:28:58 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1659713334; h=from:from: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; bh=s17SDCL9MKLYF/3ndrof+ed7FioVUBYUF/ImBULyBsI=; b=GIxGLSZ6mLeNTcDYblSjbXW/hcnskWkfH7GgKQj2fQ1e6FZJQVybZh6ehuPKQjw7DXNCbE UIjOGXq7MinV33/sUbhXl+vefF9NiWNPkhIAOkazXEBSRevrSc3RFAFGnHegdVlxy1SbSZ gnCLTHgWOCljwFGQwbOi8An9FBTwUQE= Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-218-gmG0esW-Nu24-4eXAYAuNQ-1; Fri, 05 Aug 2022 11:28:53 -0400 X-MC-Unique: gmG0esW-Nu24-4eXAYAuNQ-1 Received: by mail-wm1-f69.google.com with SMTP id n30-20020a05600c501e00b003a3264465ebso3483732wmr.1 for ; Fri, 05 Aug 2022 08:28:52 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:subject:organization:from :references:cc:to:content-language:user-agent:mime-version:date :message-id:x-gm-message-state:from:to:cc; bh=s17SDCL9MKLYF/3ndrof+ed7FioVUBYUF/ImBULyBsI=; b=IMwXjZ+EZeGzfExTm9f8RD2XLp131vJPtGpZd1fILLxgi7Kq/dlCte94lGiNmhy1L/ mAueaDPeR6ZiuP7KoPHT34wKPMjbFs7IvY2L9nk6rrfzbVoOtRpnzrygauJ23r3pEkNM WB3CkBs4/GmmSpoGFMrOn95EHzIiUB4qnsK46cRLKk4G8tAk5GwjBSeEW6JTAK2R8a4g Gk7wUsYH7S1ze1SCKNl8beisgzc9Ne1D6t9FMyuetM/ZAiRll4GvxbXNrbrNzIXfoE9P rIJ2YAjSMqqRzKmBnMzUPr/w+XdZfPhqxwK4acCjNKYr00RQAIKtzODcwEqgrrvj3ZDp ZoBQ== X-Gm-Message-State: ACgBeo2OPrCXVkds5C6nqHqCq53B4wjAZRVRat2COSKlQ4MDBzfB92ST tqq4iWWwqMI4juykO+E1kHYfUz5V6UZuGwbyEple963RW3ZyZ+G+3XbkVoM6bXEqlkFpX5kYQU8 WZzJ9zMCx/rKMaIBG3gLorVnBUNYC/jhwOH0= X-Received: by 2002:a5d:5343:0:b0:220:6203:ed4a with SMTP id t3-20020a5d5343000000b002206203ed4amr4485502wrv.146.1659713331905; Fri, 05 Aug 2022 08:28:51 -0700 (PDT) X-Google-Smtp-Source: AA6agR6RP8jmEyNrgxdjMqN6pGfce2kXfKzdRs6fMoDWGxhWO4VNgKwbo4vWrf5CdNQijFgvKiR+Ag== X-Received: by 2002:a5d:5343:0:b0:220:6203:ed4a with SMTP id t3-20020a5d5343000000b002206203ed4amr4485489wrv.146.1659713331631; Fri, 05 Aug 2022 08:28:51 -0700 (PDT) Received: from ?IPV6:2003:cb:c706:fb00:f5c3:24b2:3d03:9d52? (p200300cbc706fb00f5c324b23d039d52.dip0.t-ipconnect.de. [2003:cb:c706:fb00:f5c3:24b2:3d03:9d52]) by smtp.gmail.com with ESMTPSA id p6-20020a05600c05c600b003a2eacc8179sm4879123wmd.27.2022.08.05.08.28.50 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 05 Aug 2022 08:28:51 -0700 (PDT) Message-ID: <4437f656-99ac-400b-0d3b-4e1c7e6094da@redhat.com> Date: Fri, 5 Aug 2022 17:28:48 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 To: Arnd Bergmann , Li Chen Cc: Catalin Marinas , Will Deacon , Rob Herring , Frank Rowand , Andrew Morton , Li Chen , Linux ARM , Linux Kernel Mailing List , DTML , Linux-MM References: <20220711122459.13773-1-me@linux.beauty> <20220711122459.13773-5-me@linux.beauty> <181efcca6ae.de84203d522625.7740936811073442334@linux.beauty> <18267b7a61f.12b26bd91245310.4476663913461696630@linux.beauty> <1826852ea3a.10a917cc826728.6077661125986568031@linux.beauty> From: David Hildenbrand Organization: Red Hat Subject: Re: [PATCH 4/4] sample/reserved_mem: Introduce a sample of struct page and dio support to no-map rmem In-Reply-To: X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220805_082857_122611_68111EB6 X-CRM114-Status: GOOD ( 16.56 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 05.08.22 16:09, Arnd Bergmann wrote: > On Thu, Aug 4, 2022 at 12:07 PM Li Chen wrote: > >> Apart from our cases, I heard there are some other cases where cma_alloc >> failed even non-cma system memory has enough memory because pages in >> CMA memory are pinned and cannot move out of CMA. There are some fixes like >> 1. move these memory out of CMA before pinned >> 2. only allow non-long-time pinned memory allocation from CMA. >> >> But these two solutions are not merged into the mainline yet. > > Right, I think this has come up before, not sure why it wasn't implemented. > My feeling is that 2. cannot work because you don't know if memory will be > pinned in the future at the time of allocation, but 1. should be doable. We disallow longterm pinning of CMA memory already and migrate it out of the CMA region. If migration fails, we reject pinning. See 9a4e9f3b2d73 ("mm: update get_user_pages_longterm to migrate pages allocated from CMA region") and recent 1c563432588d ("mm: fix is_pinnable_page against a cma page") It's worth nothing that is_pinnable_page() will be renamed to is_longterm_pinnable_page() soon to express what it actually means. Note that some FOLL_GET users (vmsplice, O_DIRECT) still have to be converted to FOLL_PIN, and especially also set FOLL_LONGTERM (vmsplice). -- Thanks, David / dhildenb _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel