Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp6948655rwd; Mon, 19 Jun 2023 15:30:44 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7BIYNUvcZz86eteEE9OXrSJmhLcnjzanAcLJ9o0beY/T+zLZJzc/DYViShak+wMFQRvyEN X-Received: by 2002:a17:902:ea0a:b0:1b5:2ca9:f71b with SMTP id s10-20020a170902ea0a00b001b52ca9f71bmr14828962plg.11.1687213844252; Mon, 19 Jun 2023 15:30:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687213844; cv=none; d=google.com; s=arc-20160816; b=fd2e2zAFSDGWm9Ae/t958Zg0+DAxO8DMAy88racgStOZ/OnJpD5ltZKJbxaB2Ykha8 jKorwiNwvrQQNrch0e909/5Yo8xH+sZwXKP3wjOgiiPdZ/UIm1krKNkowqAAwetrCv5+ logbCZ4+AfKDukneWIcm0weegLH1k7bog7fbcB/Qk95jUs1jqEHFJFBsvs8C1u2YW2f5 pgvS4AtRKa+V9oIAJJmjBKOEtBsgYua/0MDt2WaL0p88gKmMbeHMFtV/tF61wuqILGYN Rd4HJXyrH0VlM7zbbjYc84x31hiH5wK9mpFdjILdVzAT9C/5nUsmqpPqOd9+J1e8eAup fAmg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=RLoob+M/nR1AIL2pYIs2Zh5ySzQr5e7siB01cUwFeGY=; b=OAcMMjj6uYKY9+u/xTy1TC+cWUS82Tnr5YcgboBS67BuCDqr20L6EizE3BI6B2XtR5 Ya2yOuTNeRyxIZzDAyjTH5ijUTZlT4OdUIMYGaTW6R7DTJgBsVhTgAcSJyNweFJa5Ekg 45VLZBtnxhzQO15ZRvmQ+WSHz8L4Njjn7SuqOO3O3xYyzFzpFDg5GZre+44CyN+gRqfq 3MWeayRv5cdAQw/G1FiXRSdXDbOe7PjSzjfyud4X9u+fDmmxX3nCj84weEHyKnFLE97G IZbqj004Zfh+Ma/Fa29TB9IDoPzV6YpnTY6GrgxUH8srszl7JSKZ1cFYENNCHWO9RHfj QmgA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Qn2UC0RR; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o1-20020a170902bcc100b001b5fc11ea09si574863pls.94.2023.06.19.15.30.27; Mon, 19 Jun 2023 15:30:44 -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=@redhat.com header.s=mimecast20190719 header.b=Qn2UC0RR; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229658AbjFSVog (ORCPT + 99 others); Mon, 19 Jun 2023 17:44:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54968 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229601AbjFSVof (ORCPT ); Mon, 19 Jun 2023 17:44:35 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7637FA4 for ; Mon, 19 Jun 2023 14:43:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1687211032; 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=RLoob+M/nR1AIL2pYIs2Zh5ySzQr5e7siB01cUwFeGY=; b=Qn2UC0RRo8BmxharEwDTT/aLnujW7qZyo4P4S0izSZcHMgnjoPDjQlLWV3JNBwBXFKXOBM 5zt+JdfN5WTzvj/BvD+TLp1+/+IAe0jnscaoI1g31FU3L17a02z6G2INXNVDgzOGpbXtCD TTNdQuh0oEUIkZC56rZseFeZ7/G5rXw= Received: from mail-qv1-f70.google.com (mail-qv1-f70.google.com [209.85.219.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-34-uIiWVrQQPnOFswHMfA7_jA-1; Mon, 19 Jun 2023 17:43:51 -0400 X-MC-Unique: uIiWVrQQPnOFswHMfA7_jA-1 Received: by mail-qv1-f70.google.com with SMTP id 6a1803df08f44-62ffa1214edso8231326d6.0 for ; Mon, 19 Jun 2023 14:43:51 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687211031; x=1689803031; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=RLoob+M/nR1AIL2pYIs2Zh5ySzQr5e7siB01cUwFeGY=; b=k2WjI6Mnbwx02RpGjCIWoMjqqha0R6jQcRokSQMjuVyqpM7ywNRd3ZrYc1jT6tO3W5 jcN4SCUTBtt6Ht97xFszSpv3IzVxqLcVqPcgdEnHRA5HLQRzTYQvV+1nT/VzFOqt+RJX bbNpqK1nf5f1f+oTVqQXN4vw9+xscgQFhNyxOz293l5oJ4KGS3fxQodmJHOJ/xIQRrWz 3NP+2jaRfGXEiGxSLh2Uks76t8i6noJmZYmU0dQCF2qCOFlHZU5hx8TmnwG2sP48wEeN xRg3tceOxvkO/WP7K3gkAC8kdKPQBGSScT4qlAjA+BqJ4BYAtDp2HxtLDIDP2fkCdmHU Q6mw== X-Gm-Message-State: AC+VfDxe46ktI8klU25G7LqqvcyyoUqN1Li9LgXs50fMcZ2X2RTcXIwG mMAgDO6qwwQSozUiB1tJaQBrNorntGGYP79P0AOotwIz6rMiofhoJS4LVex/tDR/bs26Tpq3v2g nTuk8jZGMsJ4ZV4mDVzU2PCJaNeq3xSKOdOH/+JzhfKtXcA5IW79sSmq22e0HuAqjqN+nREXmlR +sNakjjQ== X-Received: by 2002:a05:6214:27eb:b0:616:870c:96b8 with SMTP id jt11-20020a05621427eb00b00616870c96b8mr13057103qvb.3.1687211030790; Mon, 19 Jun 2023 14:43:50 -0700 (PDT) X-Received: by 2002:a05:6214:27eb:b0:616:870c:96b8 with SMTP id jt11-20020a05621427eb00b00616870c96b8mr13057083qvb.3.1687211030448; Mon, 19 Jun 2023 14:43:50 -0700 (PDT) Received: from x1n (cpe5c7695f3aee0-cm5c7695f3aede.cpe.net.cable.rogers.com. [99.254.144.39]) by smtp.gmail.com with ESMTPSA id w1-20020a0ca801000000b006301bae200bsm429214qva.15.2023.06.19.14.43.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Jun 2023 14:43:49 -0700 (PDT) Date: Mon, 19 Jun 2023 17:43:48 -0400 From: Peter Xu To: linux-kernel@vger.kernel.org, linux-mm@kvack.org Cc: Matthew Wilcox , Andrea Arcangeli , John Hubbard , Mike Rapoport , David Hildenbrand , Vlastimil Babka , "Kirill A . Shutemov" , Andrew Morton , Mike Kravetz , James Houghton , Hugh Dickins Subject: Re: [PATCH 3/7] mm/hugetlb: Add page_mask for hugetlb_follow_page_mask() Message-ID: References: <20230613215346.1022773-1-peterx@redhat.com> <20230613215346.1022773-4-peterx@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20230613215346.1022773-4-peterx@redhat.com> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE, 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 Tue, Jun 13, 2023 at 05:53:42PM -0400, Peter Xu wrote: > @@ -6506,6 +6507,7 @@ struct page *hugetlb_follow_page_mask(struct vm_area_struct *vma, > * because we hold the ptl lock and have verified pte_present(). > */ > WARN_ON_ONCE(try_grab_page(page, flags)); > + *page_mask = huge_page_mask(h); Sorry, I was wrong this line. It should be: *page_mask = ~huge_page_mask(h) >> PAGE_SHIFT; This can be exposed if we bypass fast-gup and also specify pin npages>1. Probably overlooked in my initial round and I'd guess fast-gup just all succeeded there.. I'll temporarily drop the R-bs for this patch, so reviewers can have another closer look in this one. -- Peter Xu