Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp3137000pxm; Mon, 28 Feb 2022 12:50:51 -0800 (PST) X-Google-Smtp-Source: ABdhPJwHs7KxUnOj5bnDDPQDwKvrEUbjHD6QvG10lzmuEvRXQPXZGG3TfgCua9IeRFdlTO5rsWL0 X-Received: by 2002:a50:d753:0:b0:414:83e0:405d with SMTP id i19-20020a50d753000000b0041483e0405dmr87426edj.220.1646081450801; Mon, 28 Feb 2022 12:50:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646081450; cv=none; d=google.com; s=arc-20160816; b=PVNO6VJhl5ek/25l4FOjctudWIQPwHjdeHahldT/s5uXk5GB1h89uXpy9uhlynocU6 qYOSOQRxT98a9W35Ho8BebtDwCuiKBZdQkeva4B/BCjmX+rURj5x+GTpu/zNXypm5F7p qjt8oL7khSFBsZ0zJlWdGGtvA3KNOd9Npq7P3W8qXYGAxZRlRO1fTuLA2gCNznm2ivcF OrfFZHQU+R8eE83wH1tWovBSGZ1CIqS6J+58YrFCeHFpIw3D4WhbTA3J4IR3g5oRUej2 j9nRFzJIb6TOpBpCUqheSHmx8yBNCN1g/xGZfX9eRDZLlEn+ZzJ1J63B+bZ643dpdqe7 K4cQ== 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=qpQ/kpbf1GOpHDn6LLoilwm/c0J2gkjnAf3qAZ1Z3Yw=; b=nOUNEP3cpIMX4nXiP7CGiPjBWCN5kk0XtnJ4fwY1UrUQC0vBDM1nirVms0QDxE9+4h 4KrEs/cvz24rQuAU18hbx9HvVegaTlFGeTE+9+5VoHOXDYUcZwF+NI9DHU2OtOaMapEa CwYsXPRHjIp4Og2UuQtvt23ksRPOBZjGSfuxOeHIpKTQGiKBmk2Tv24tP+M6ER6wZMNg hpy63ujoF9ELRKBsloOpDBXSfHohQVtHQ7ImcanfUzJxUbuil5ItSIirSLDJMEP6GTwT 0LeA4PofKr+aOJk1/NOKnuLtpv7Xx6HaTg+1ZgkEBKvbmkNtLhBc/9aGcUbs5k1UYuUb IP/g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=uvVQGeVC; 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 i11-20020a0564020f0b00b003f9a4cf8f33si7337449eda.556.2022.02.28.12.50.27; Mon, 28 Feb 2022 12:50:50 -0800 (PST) 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=@infradead.org header.s=casper.20170209 header.b=uvVQGeVC; 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 S229961AbiB1UuN (ORCPT + 99 others); Mon, 28 Feb 2022 15:50:13 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34716 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229950AbiB1UuL (ORCPT ); Mon, 28 Feb 2022 15:50:11 -0500 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E55876C970 for ; Mon, 28 Feb 2022 12:49:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=qpQ/kpbf1GOpHDn6LLoilwm/c0J2gkjnAf3qAZ1Z3Yw=; b=uvVQGeVCP5RVFIraAvp5Jlap8q Yd9nzeyRvG3UP22VgcqwfVGiw99QIWnnELJ6igO1X3GuyTdHM+M3qxuhyiMCCMqol/igSkyvcd+gC wpc9LQ4wgQnvUR+n34ov0s8icMHKYzjE6aNKiaasueXfjbPKKhsTHsUZnmC11IOXyLW/hTEDD8Bas VoOoq/JiFRNPOJ2SaIq0OM95JqhoAKf0Gef+KPzIbTMtAXkwGVeOPQVK4LpdlEGDXR5WheFYZMezh nv8/jQk+hI77nLYM7mbCYyJmXGuvvUt5b3qdjnlNvJU8RBJF1ILqDpz71G/VQ9RQpkryzyDCyOmdg 1u13vNdg==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1nOmxU-008u4L-3v; Mon, 28 Feb 2022 20:49:28 +0000 Date: Mon, 28 Feb 2022 20:49:28 +0000 From: Matthew Wilcox To: Hugh Dickins Cc: Andrew Morton , linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: Re: [PATCH next] mm/migrate: fix remove_migration_pte() of hugetlb entry Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,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 Sat, Feb 26, 2022 at 06:25:15PM -0800, Hugh Dickins wrote: > - if (!folio_test_ksm(folio)) > + /* Skip call in common case, plus .pgoff is invalid for KSM */ > + if (pvmw.nr_pages != 1 && !folio_test_hugetlb(folio)) > idx = linear_page_index(vma, pvmw.address) - pvmw.pgoff; How do you feel about this instead? - if (!folio_test_ksm(folio)) + /* pgoff is invalid for ksm pages, but they are never large */ + if (folio_test_large(folio) && !folio_test_hugetlb(folio)) idx = linear_page_index(vma, pvmw.address) - pvmw.pgoff;