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 C984FC04A68 for ; Thu, 28 Jul 2022 09:23:41 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 373118E0001; Thu, 28 Jul 2022 05:23:41 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 322856B0072; Thu, 28 Jul 2022 05:23:41 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 1C2DE8E0001; Thu, 28 Jul 2022 05:23:41 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 0A7CF6B0071 for ; Thu, 28 Jul 2022 05:23:41 -0400 (EDT) Received: from smtpin26.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id C242A1613CC for ; Thu, 28 Jul 2022 09:23:40 +0000 (UTC) X-FDA: 79735971000.26.F090B6C Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf16.hostedemail.com (Postfix) with ESMTP id DAC0B1800D4 for ; Thu, 28 Jul 2022 09:23:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1659000219; 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=MUUHnK3mGjBTIixFdMqpioqDxoaunFSmdGJUDWVh8gY=; b=JQ2KmzVcnpUWEQUoc3gMHqGjZ4RJDQEcmD1K4qMTVfvEs7VSziunXBLueNU251OvBhRJBQ 7xFg9Jy5IeJTr2X4MaR9P3d0iKtiaiA7CpSKTtC6nj8BEPSuvP1MyAxVhdGSF7uM9X7Q6N UUOBz3DAQ//7BXT6ayZLQ9EM4zLqmZY= Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-515-fEQPqZ3cMo6YtYa5_UgcJA-1; Thu, 28 Jul 2022 05:23:35 -0400 X-MC-Unique: fEQPqZ3cMo6YtYa5_UgcJA-1 Received: by mail-wm1-f72.google.com with SMTP id i64-20020a1c3b43000000b003a2fe4c345cso640096wma.0 for ; Thu, 28 Jul 2022 02:23:35 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:organization:in-reply-to :content-transfer-encoding; bh=MUUHnK3mGjBTIixFdMqpioqDxoaunFSmdGJUDWVh8gY=; b=Q6v8w3QoknB2u4L06RFRZvlSiHXUSsh1XK1S099httNBJ1VI9caOYiR5kLW8g8XEHt B2KbKYf7qhGgtjKNIveMR9W1kuoIwzZqcESCj8Rw2/VexExd/Eufqc/0qfVD9xrqtrFr rgyiq5I1/vQ/dMnEQA/mMIy/nEjKAS8LL0G+wsZmm/7Hv1s4ephiU5Q5lLXGlxC4btQy ye4+PGquC+Nh4p+n8obRrhJ1RgXwvDsvPXH/+EpgabtJaXSF+yVVHe8+U8KzATUK9WXu hLI5Z8iRMu/RedTq2NOwAKH9Fqs0ZT64hbWUPt2u9sNhDZVbX3rd3+NMea5qmpDpPHsj +F8Q== X-Gm-Message-State: AJIora/W5CGAZEh7xZRsiqDoIJqNhczePphbZgRXYJE7akyYEZ8ydP+e Y4cOBycSyT/dQgqnwReRINPNRUDEQAbJ3IXbb0YSpPFmrfPisXFb41/XNDHgvqg7t7A4YwnDfd7 kWr+Mod3IffM= X-Received: by 2002:a05:600c:3510:b0:3a3:34e7:cfc8 with SMTP id h16-20020a05600c351000b003a334e7cfc8mr6168707wmq.164.1659000214727; Thu, 28 Jul 2022 02:23:34 -0700 (PDT) X-Google-Smtp-Source: AGRyM1v68N2cLgOVDHlO2BHTuQI5rx78/bTHvWixAJqi4+qCUXnGL4+jti75UpEFTdiWn82+6TUIgA== X-Received: by 2002:a05:600c:3510:b0:3a3:34e7:cfc8 with SMTP id h16-20020a05600c351000b003a334e7cfc8mr6168689wmq.164.1659000214387; Thu, 28 Jul 2022 02:23:34 -0700 (PDT) Received: from ?IPV6:2003:cb:c704:7b00:9c4:744b:b126:3a28? (p200300cbc7047b0009c4744bb1263a28.dip0.t-ipconnect.de. [2003:cb:c704:7b00:9c4:744b:b126:3a28]) by smtp.gmail.com with ESMTPSA id w13-20020adfee4d000000b0021f0af83142sm254643wro.91.2022.07.28.02.23.33 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 28 Jul 2022 02:23:33 -0700 (PDT) Message-ID: <6492e852-8acf-95a9-a3a0-8ce8bbaf46d6@redhat.com> Date: Thu, 28 Jul 2022 11:23:33 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Subject: Re: [PATCH] mm: Re-allow pinning of zero pfns To: Alistair Popple , Jason Gunthorpe Cc: Alex Williamson , akpm@linux-foundation.org, minchan@kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, paulmck@kernel.org, jhubbard@nvidia.com, joaodias@google.com References: <165490039431.944052.12458624139225785964.stgit@omen> <20220615155659.GA7684@nvidia.com> <20220623142139.462a0841.alex.williamson@redhat.com> <20220623204712.GG4147@nvidia.com> <87a6a2zyxk.fsf@nvdebian.thelocal> <20220624013415.GI4147@nvidia.com> <874k0ax1s0.fsf@nvdebian.thelocal> <878rodvcty.fsf@nvdebian.thelocal> From: David Hildenbrand Organization: Red Hat In-Reply-To: <878rodvcty.fsf@nvdebian.thelocal> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit ARC-Authentication-Results: i=1; imf16.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=JQ2KmzVc; spf=pass (imf16.hostedemail.com: domain of david@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=david@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1659000220; a=rsa-sha256; cv=none; b=WjHY+qWLy+/eJbXRaXPnlTRmMI2HpyF6kWR7kIl3G7Y8r4wtIPzACJsss0iYKh+PyGefmM LDGAzRC6bvGY1W+dmRezZj6obY1kVH9KmpOfXiV0I8/5Inv4y3kTKYtszJkrmNH1lXl8Ru ZNcyRlhTj0Ix2wBHt10F3gBj5YaW5xc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1659000220; 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=MUUHnK3mGjBTIixFdMqpioqDxoaunFSmdGJUDWVh8gY=; b=qnuxJg3CSlvPDHHqgs4J9ZvWn7NRiHrqLUoRO35bfdYxM/kVhvYFGsnk4dXdyYWXR3mv8v yaSAOqWtWlLU2FYbvUMIwmZdQ0QNJMj2DoZvoOcBYce+GmRdboEeOl1Y1ziRRrM0fE5pvj YbsuWEJ6I1lEJv9jXdUoxhzdEy7pqO4= Authentication-Results: imf16.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=JQ2KmzVc; spf=pass (imf16.hostedemail.com: domain of david@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=david@redhat.com; dmarc=pass (policy=none) header.from=redhat.com X-Rspamd-Server: rspam04 X-Rspam-User: X-Stat-Signature: u6qnndamhszzwprnsgb9f39r76xr1wef X-Rspamd-Queue-Id: DAC0B1800D4 X-HE-Tag: 1659000219-491540 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 28.07.22 10:45, Alistair Popple wrote: > > Looks like the original patch might need rebasing. I am about to post a > clean-up for the tortured logic in check_and_migrate_movable_pages() so > can incorporate it there, but I'm wondering what the consensus was for > pinning of zero pfn? We have to keep it working right now, but in most cases (inside MAP_PRIVATE regions) it's shaky and undesired. > > Currently my clean-up will result in PUP returning an error for the zero > pfn rather than looping indefinitely in the kernel. However it wasn't > clear from this thread if returning an error is ok, or if R/O pinning > of the zero pfn should succeed? I'm working on proper COW breaking in MAP_PRIVATE mappings, which will, for example, unshare the shared zeropage and properly replace it by exclusive anon pages first in the FOLL_LONGTERM case. -- Thanks, David / dhildenb