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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id F3C83C77B75 for ; Mon, 8 May 2023 00:30:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231991AbjEHAa3 (ORCPT ); Sun, 7 May 2023 20:30:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48840 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229814AbjEHAa1 (ORCPT ); Sun, 7 May 2023 20:30:27 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B94B7659F for ; Sun, 7 May 2023 17:30:24 -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 1670361D85 for ; Mon, 8 May 2023 00:30:24 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 59613C433D2; Mon, 8 May 2023 00:30:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1683505823; bh=Ku2BCycuOdBG80SFOKA5kbRxCQtR2qKfQc50CpXVufY=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=eZIllEHhRUrFIWI47sBt/vsXJlLqnQOnLiEdORTmPnuZQaSEmSXnXdZrOCyDODQ46 2xTIkzO5J+It+eCoWaNMYurOO0oSV2L1qfxW6YOsO6lWwyMdRrMfB8vVZFfwEA/hkY WT5ednNEx2Fvqk3X8c9uTz/FSpYGscShWmEGShPY= Date: Sun, 7 May 2023 17:30:22 -0700 From: Andrew Morton To: Lorenzo Stoakes Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, David Hildenbrand Subject: Re: [PATCH] mm/gup: add missing gup_must_unshare() check to gup_huge_pgd() Message-Id: <20230507173022.96c9d24cb1aa6f57ed50f5fa@linux-foundation.org> In-Reply-To: References: X-Mailer: Sylpheed 3.8.0beta1 (GTK+ 2.24.33; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, 6 May 2023 15:05:25 +0100 Lorenzo Stoakes wrote: > All other instances of gup_huge_pXd() perform the unshare check, so update > the PGD-specific function to do so as well. > > While checking pgd_write() might seem unusual, this function already > performs such a check via pgd_access_permitted() so this is in line with > the existing implementation. Rationale seems strange. "Other sites do it so this should also". Why is this a desirable change? Maybe the "other instances" shouldn't be performing this check either? IOW, what are the runtime effects of this change? Thanks.