Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp1821196rwe; Sat, 27 Aug 2022 18:41:09 -0700 (PDT) X-Google-Smtp-Source: AA6agR756DkmVYrUKFW9Yv5Qp1qZtCmkycDg7u6l4JB7lRhMVkHfdxd0KipZQ3XqGixPtS1OLNVt X-Received: by 2002:a17:902:7d84:b0:174:3ad5:30b0 with SMTP id a4-20020a1709027d8400b001743ad530b0mr9562217plm.111.1661650869736; Sat, 27 Aug 2022 18:41:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661650869; cv=none; d=google.com; s=arc-20160816; b=C+WSpi0KbNBaJAOLB0vPanm1oeb6RN/FLG2umW3eWRPx7jdojldoHKE5Lltxi+e1Sg OZnLdPRKOL21qzqr3ZxOah3btxCrgfjMB+fR89FThmdeAcqlPJfrtSIhP7ghaVqw3CrY 9AoK7qmpqN/gSthinewZINC1VYFJunwHjqb/0RuoFuh6VzRGZBB6OVUs/AxdB8ABIfh7 tAziy/dNZeCgk+wc1VrtEkewKHH1LHgzUBGAq4AG25WWt/fIgFgVIF9eCPACGgSSjGKk 7h2VgoT5mdVF9lWfrRpV/G07mth2z1le06v5L/q5JIP6/K58hmsxkWu9l7AXSjDoGbwy PWJQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=7Tr1k8+/gHp0og7VlNI1RIHgQfHUw2TTyMVWS7UX+OM=; b=LXixtHnhKHe1MviHFIfNs+8B4USmBY3/l1W/nxfYfzBOMKUsmMT8EYwbyjYEaII6Pk X6CMIqRLGQ4pPow41blpfV3+CnF0sQBCnfdsHaa0SAb9vKikSrE1rqGj0ZXraoxhJU89 +81BaIDs9sYaUpfUr1VFTJ4h7EgRwPaDN8fXhkyViyaNztkpVpk4aMxHl4XeZWoM66zE NTXFi0tO0+wt92HhN1rW/SzDRtYs4jgm0grYvox3JG7GPlCrKEtsO/S/c+/AxmrWiXIO 1SjF/j/+UwSTmKn7sc8MqNdp1wyKh+7nXltJkWwLujmujzaqfRzZLH0ot5yQ/ZpC+DuN gEQw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=korg header.b=1urU150g; 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 y63-20020a638a42000000b0042bbb04eb3fsi2218552pgd.646.2022.08.27.18.40.58; Sat, 27 Aug 2022 18:41:09 -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-foundation.org header.s=korg header.b=1urU150g; 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 S229773AbiH1Bk0 (ORCPT + 99 others); Sat, 27 Aug 2022 21:40:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50648 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229445AbiH1BkY (ORCPT ); Sat, 27 Aug 2022 21:40:24 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CD7912F3B3 for ; Sat, 27 Aug 2022 18:40:23 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 3886160F15 for ; Sun, 28 Aug 2022 01:40:23 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 417C4C433C1; Sun, 28 Aug 2022 01:40:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1661650822; bh=FGNvzCOKkVqHq0tcUTWz3+S8SsHh6WDHwk+zUimYeVQ=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=1urU150giWDG6/gr5BsNJrncuJn13s0LO5fKEKrOz3P/Jmo4Le07fed5aE8iGfild 4O7zMnNW1sx5zN3y5UQqKNMmvUKTDPRYdhGE+yEsGtffQZ0qrXseA+bFPGlnO9Ltme 4tw+9Ok9aiWY9CU4Ve8GIExoqjxYIiyHZlOkq6T8= Date: Sat, 27 Aug 2022 18:40:21 -0700 From: Andrew Morton To: John Hubbard Cc: Alex Williamson , alex.sierra@amd.com, willy@infradead.org, hch@lst.de, Felix.Kuehling@amd.com, apopple@nvidia.com, david@redhat.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] mm: re-allow pinning of zero pfns (again) Message-Id: <20220827184021.4e100b9eda3a9141217ec60d@linux-foundation.org> In-Reply-To: <033c2e8d-8ba9-3e0b-9dee-7d0973c708fa@nvidia.com> References: <166015037385.760108.16881097713975517242.stgit@omen> <033c2e8d-8ba9-3e0b-9dee-7d0973c708fa@nvidia.com> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.33; x86_64-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 On Sat, 27 Aug 2022 17:59:32 -0700 John Hubbard wrote: > > /* The zero page is always allowed to be pinned. */ Wow, that's really verbose :) --- a/include/linux/mm.h~mm-re-allow-pinning-of-zero-pfns-again-fix +++ a/include/linux/mm.h @@ -1544,11 +1544,7 @@ static inline bool is_longterm_pinnable_ if (mt == MIGRATE_CMA || mt == MIGRATE_ISOLATE) return false; #endif - /* - * The zero page might reside in a movable zone, however it may not - * be migrated and can therefore be pinned. The vfio subsystem pins - * user mappings including the zero page for IOMMU translation. - */ + /* The zero page may always be pinned */ if (is_zero_pfn(page_to_pfn(page))) return true; _