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 78E1FC43334 for ; Sat, 11 Jun 2022 00:21:57 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 8FA588D00FA; Fri, 10 Jun 2022 20:21:56 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 8A96B8D00F7; Fri, 10 Jun 2022 20:21:56 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 722D18D00FA; Fri, 10 Jun 2022 20:21:56 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 601848D00F7 for ; Fri, 10 Jun 2022 20:21:56 -0400 (EDT) Received: from smtpin25.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 36DBC20689 for ; Sat, 11 Jun 2022 00:21:56 +0000 (UTC) X-FDA: 79564052232.25.63A3DBB Received: from mail-pl1-f171.google.com (mail-pl1-f171.google.com [209.85.214.171]) by imf28.hostedemail.com (Postfix) with ESMTP id CDBF1C0007 for ; Sat, 11 Jun 2022 00:21:55 +0000 (UTC) Received: by mail-pl1-f171.google.com with SMTP id q18so523990pln.12 for ; Fri, 10 Jun 2022 17:21:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=orRX8bHVwIqsWUTRBwudWprTpQENg/NL+oJ4ZA+qZSY=; b=XX855K/KCSKksyKnZmDsq5LuDRpawKh8kCwaNYSD3SP6Ep0RiA+aK04+29Hj15VSGb JWWokbqxXkNXk/jZGM6Zx1c7qXldpMbhCf0V+NzDjbCOcz56XaWgu2mHkMMGwa0gD4UC JCS2kRNxOsPLQk7JnL2qpSjI23R1MXgtlteHAW5Ln6pSPe8Y53VzOlBg4TW3vgWhxmo2 CftyR7g9fpPW7NcbSV6OUggXfrDWTDIPMZ+vp7AEm7/C19WKRF0ytvoS8QjC6WZkIm/d NEZleUq8wTkzzh2Qj8KQnRCQL0n98GNqnngu6b0GWxeN0mjYmDtSNrINCfnCrs5tMxkI MwtA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to; bh=orRX8bHVwIqsWUTRBwudWprTpQENg/NL+oJ4ZA+qZSY=; b=3kIFwXg4XVjqWlz/PpLyj08VMkL3jwhb2cReNxSQfWOzFM/uyFI6AEqSD6he0APWw3 p198SIg0bJCVNowvh22xNXo65V6qeo3qVuhCZm4f9QkZqU6ouyCwiO7AwZevFlyJB721 PBx/6nfZoHgjOx3BFOjFF6vvvMJ/ym6oAp21J6IAld5gxuenuexUG8s44Ury3s8w2YsS QHM4mLFXxrIb+ScFpOrmlb8CPfpuls2E+vlMo/pRnmOqE/IKaDsfpQ8vgW0kr/M3ILgN 3Zbb96qUQW2X7WrDgxVS7qxyQ+f8/TDsoh0M+bxLMo2cWae+xIUTnbo8Rmci2lV64VBE YOng== X-Gm-Message-State: AOAM5310rLN9qSyBmeFI/U7km6NRdBigffY8xfdCSZBQ9rELgHJO0cNC 6WIlfjxjGZ4cR3duLWMe/Mc= X-Google-Smtp-Source: ABdhPJzKHW5ysdJSDgBl6PDlb7cpzIxSRALSt4qhbmbmz70oiMOuX0yoegoVqE9ep9iTSoq7MYirrg== X-Received: by 2002:a17:90b:1b48:b0:1e8:5885:f8b with SMTP id nv8-20020a17090b1b4800b001e858850f8bmr2354020pjb.122.1654906914680; Fri, 10 Jun 2022 17:21:54 -0700 (PDT) Received: from google.com ([2620:15c:211:201:6481:5f82:42f7:8bcc]) by smtp.gmail.com with ESMTPSA id w1-20020a62c701000000b0050dc7628148sm162963pfg.34.2022.06.10.17.21.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Jun 2022 17:21:54 -0700 (PDT) Date: Fri, 10 Jun 2022 17:21:52 -0700 From: Minchan Kim To: Alex Williamson Cc: akpm@linux-foundation.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, paulmck@kernel.org, jhubbard@nvidia.com, joaodias@google.com, jgg@ziepe.ca, david@redhat.com Subject: Re: [PATCH] mm: Re-allow pinning of zero pfns Message-ID: References: <165490039431.944052.12458624139225785964.stgit@omen> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <165490039431.944052.12458624139225785964.stgit@omen> ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1654906915; a=rsa-sha256; cv=none; b=gUIgCiT8kVQ3Cwx0wsFfxjh0eRE4irNVh+xoNJrRjjFu7IBNJuSZRk03+VKdBv3hik/f1O PIzG3T7tTd+84jqQf9GDTYQWnGoN5yhyMp/ptu7NmXNT2klCUOAufgWjmK8Vp3nV5i+vRA K6pVxc2uN+ZcoGiUZFyroicTJJEldJ0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1654906915; h=from:from:sender: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: in-reply-to:in-reply-to:references:references:dkim-signature; bh=orRX8bHVwIqsWUTRBwudWprTpQENg/NL+oJ4ZA+qZSY=; b=VtwPKkJRcp0NHarV+QB21VnUjhfem1F5rjL+rqtGYVd41dGQ3U5e+qnWjXVKw80i+JobPX jDJqUDSc0d8srZ9PYfi5CCRAcJk3/LCAwK3Q0cBV+4l/4BuffmB41llGkLR87qisJDBIkT ZM9mg3Y6Lmom9llFw0SeIU5WHGTKwyU= ARC-Authentication-Results: i=1; imf28.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b="XX855K/K"; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=kernel.org (policy=none); spf=pass (imf28.hostedemail.com: domain of minchan.kim@gmail.com designates 209.85.214.171 as permitted sender) smtp.mailfrom=minchan.kim@gmail.com Authentication-Results: imf28.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b="XX855K/K"; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=kernel.org (policy=none); spf=pass (imf28.hostedemail.com: domain of minchan.kim@gmail.com designates 209.85.214.171 as permitted sender) smtp.mailfrom=minchan.kim@gmail.com X-Stat-Signature: 6swn9ns4r17y54urpnchhrmtkhukhp9q X-Rspamd-Queue-Id: CDBF1C0007 X-Rspamd-Server: rspam12 X-Rspam-User: X-HE-Tag: 1654906915-112527 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000231, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Fri, Jun 10, 2022 at 04:35:13PM -0600, Alex Williamson wrote: > The commit referenced below subtly and inadvertently changed the logic > to disallow pinning of zero pfns. This breaks device assignment with > vfio and potentially various other users of gup. Exclude the zero page > test from the negation. > > Fixes: 1c563432588d ("mm: fix is_pinnable_page against a cma page") > Signed-off-by: Alex Williamson > --- > > At least I assume this was inadvertent... If there's a better fix, > please run with it as I'm out of the office the 1st half of next > week and would like to see this fixed ASAP. Thanks! > > include/linux/mm.h | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/include/linux/mm.h b/include/linux/mm.h > index bc8f326be0ce..781fae17177d 100644 > --- a/include/linux/mm.h > +++ b/include/linux/mm.h > @@ -1600,7 +1600,7 @@ static inline bool is_pinnable_page(struct page *page) > if (mt == MIGRATE_CMA || mt == MIGRATE_ISOLATE) > return false; > #endif > - return !(is_zone_movable_page(page) || is_zero_pfn(page_to_pfn(page))); > + return !is_zone_movable_page(page) || is_zero_pfn(page_to_pfn(page)); Thanks for catching! I don't think zero pfn could stay in the movable zone or CMA area. Acked-by: Minchan Kim