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 F0C37C433F5 for ; Fri, 28 Jan 2022 03:30:21 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 793F86B00A3; Thu, 27 Jan 2022 22:30:21 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 743546B00A4; Thu, 27 Jan 2022 22:30:21 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 615306B00A5; Thu, 27 Jan 2022 22:30:21 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (relay030.a.hostedemail.com [64.99.140.30]) by kanga.kvack.org (Postfix) with ESMTP id 524A76B00A3 for ; Thu, 27 Jan 2022 22:30:21 -0500 (EST) Received: from smtpin02.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay13.hostedemail.com (Postfix) with ESMTP id 262FF60116 for ; Fri, 28 Jan 2022 03:30:21 +0000 (UTC) X-FDA: 79078267842.02.4B1B941 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf07.hostedemail.com (Postfix) with ESMTP id A583D4000E for ; Fri, 28 Jan 2022 03:30:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1643340620; 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: in-reply-to:in-reply-to:references:references; bh=yWI4mSyMPfEGNDG7ZY+imHKSZHJZA8c9YX1u5t0lQ5c=; b=S8sefC62Uq6+Ut+/P0ummX4oJBnBbxW3uTNs8ET8CB5eQssnbuwMKuxbu+0xP/97ApXxVE 8o/luiYjzbQW+XBpasnHUPNSlTPRdGNw7YO9M1dLPBd5gQ4ViFsuFYWD2rs3YR0ni5M0X6 aucQW/m02t2bMRUJRzsyjJKQp73ZhBY= Received: from mail-wr1-f71.google.com (mail-wr1-f71.google.com [209.85.221.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-625-lMzZbIEVMRa5aGW5-VKxOA-1; Thu, 27 Jan 2022 22:30:19 -0500 X-MC-Unique: lMzZbIEVMRa5aGW5-VKxOA-1 Received: by mail-wr1-f71.google.com with SMTP id q4-20020adfbb84000000b001dd3cfddb2dso1726784wrg.11 for ; Thu, 27 Jan 2022 19:30:18 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=yWI4mSyMPfEGNDG7ZY+imHKSZHJZA8c9YX1u5t0lQ5c=; b=6FqlL1ZFJp9qNk3ifJ7+9P/TXA5wyXJ2s1u4DzCNWOyKkUg6f7IYDxgEc/x+YHAk6g iFKTfsfGxrIWTRahk7MfggZoPAwlb61oYtkXypC51tx6Fbq4nhMQ1uRC5RlbWhk8FlRJ PTY7axVwbykr6mpNMA/uwzQX/Jl3Ux4Wd0G+GcHrqLQOH4a26b2c6spGH/wFzfH49dK9 MTEWGOQwqDY7ml/U3O4wzVj7bQYPZTFlLqaecDAcr9cHz/gFdnvUhDD11exV3PWp+SSE Weg52Pa4mMp7R9z8/i5zMHACkIlDqi6FR1QDDSB7F9aGKmoSRH4415SOsuK0liYxuqsq /v0g== X-Gm-Message-State: AOAM533PcEA5ExhLs/Zuh1T5ue7u44VBgGRMhQERsORqWct8O5Ze01WH 2W2CsYN/fO1jH65Nl5rAm4WZGjIQd22oySWKOku7pHvtIA0l8kNjl6wIDFdxmK7Eos0PEuBKMRI 5bHIF1nbnvXA= X-Received: by 2002:a5d:4dc6:: with SMTP id f6mr5255754wru.255.1643340617834; Thu, 27 Jan 2022 19:30:17 -0800 (PST) X-Google-Smtp-Source: ABdhPJw4fygcXEjGmyBwc0eSz9VlZ7/dhPCinB97oCLxm3a5TE3y78GbubhUfyHuwvXqmbn6pcAA7Q== X-Received: by 2002:a5d:4dc6:: with SMTP id f6mr5255746wru.255.1643340617661; Thu, 27 Jan 2022 19:30:17 -0800 (PST) Received: from xz-m1.local ([64.64.123.9]) by smtp.gmail.com with ESMTPSA id v5sm835287wmh.19.2022.01.27.19.30.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 Jan 2022 19:30:17 -0800 (PST) Date: Fri, 28 Jan 2022 11:30:10 +0800 From: Peter Xu To: John Hubbard Cc: Jason Gunthorpe , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Andrew Morton , Andrea Arcangeli , Jan Kara , =?utf-8?B?SsOpcsO0bWU=?= Glisse , "Kirill A . Shutemov" , Alex Williamson Subject: Re: [PATCH] mm: Fix invalid page pointer returned with FOLL_PIN gups Message-ID: References: <20220125033700.69705-1-peterx@redhat.com> <20220127004206.GP8034@ziepe.ca> <20220127152538.GQ8034@ziepe.ca> <313e02c7-c116-3fe3-6747-d9e1b58ba2bb@nvidia.com> MIME-Version: 1.0 In-Reply-To: <313e02c7-c116-3fe3-6747-d9e1b58ba2bb@nvidia.com> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Disposition: inline X-Stat-Signature: xyeiauoruzqhcgb6mnxerij8ykhqr4bu X-Rspam-User: nil Authentication-Results: imf07.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=S8sefC62; spf=none (imf07.hostedemail.com: domain of peterx@redhat.com has no SPF policy when checking 170.10.129.124) smtp.mailfrom=peterx@redhat.com; dmarc=pass (policy=none) header.from=redhat.com X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: A583D4000E X-HE-Tag: 1643340620-296956 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000001, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Thu, Jan 27, 2022 at 06:32:27PM -0800, John Hubbard wrote: > What you are missing is that other people are potentially writing code > that we haven't seen yet, and that code may use follow_page_mask(). The > idea, therefore, is to make it a good building block. Yes, actually that's why I attached the WARN_ON_ONCE() since when people do add that new code they'll quickly discover before posting, as long as they'll still test the patch.. Then people may even start to wonder whether we should rework -EEXIST if necessary, and IMHO that's the better place for a rework, not within the bugfix here. Please check the email I replied to Jason. I hope both of you would agree that I can repost with the fix only but drop the WARN_ON_ONCE(), or any explicit suggestion on how we should move forward with the fix would be welcomed. Thanks, -- Peter Xu