Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp3719602pxb; Mon, 1 Feb 2021 02:58:07 -0800 (PST) X-Google-Smtp-Source: ABdhPJyobxBZreFaXRP7YRdRjjX3UoxG/sScOjPYh/SiLY3XOQuJVzsx0X7HL3LOb9tNchlBG/FU X-Received: by 2002:a05:6402:149a:: with SMTP id e26mr18793094edv.254.1612177087573; Mon, 01 Feb 2021 02:58:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612177087; cv=none; d=google.com; s=arc-20160816; b=y2D80FfMbcBQZeOdLN+qz9e7pmppQeTGxohk4NZW93U6mXCh5h2lYb8s03PUgc3nch ql19q9eovJgD6gI9cQCyI1l20tFDE04dPIOW+iVdEymF8idn7oD5MXhkS2TsxlS9flY6 Ee8cbk4iFkhdt7dteO4mw6a57/2GkfzjQi8q5bsWr4yjaN4QkqIXJugTvQQhyDJoeWuc 3NExoO0zbpUNLcyIpDRnPEPs7Wa3weHglLFxTgd4TC7ReTzhF6DsE8/IWLvDqWPXq5Ye lonYPbwYWy6jltsMbKrybXPRTF3Zlc+IWVXg2pYxpneSOmSxsFFXDI0LjsXp8NDJJk4B qPXg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:organization :from:references:cc:to:subject:dkim-signature; bh=DD4mokRPZD1wfFQpRszoR6T0yfqXsqqAJBdhLKkcJOY=; b=UGFFP5y2z5ZE6D5/nXgzDbtmS6UFqiuY1dnSJwFQHmWtPsNkwZZIp4k2Jd/XXhumCv 3RUB1Cci6m1stsDNFsSHzMd8xaEyZaxXatSjXNk2dTds2qettkAf6kq7zRmmC92CgU6H 5RhjsDJWSh1m4Jn2Jr3WreXV/ykGEL5RvckoveePBmXz8mkh7sVi258CbtultTmGTIrr W1Kc7yTIGJFz1y0OhtGn4iOlcwMbIRGQ0C+SDw2OHOBVflxx//2EmB69KctAJYd/OxDq TvttKtOU1fuOVxwsq6FOkJ91YRZb39ioEfAPgO9XCaVWs2J5Q4VmmnsRm23kLViZ8FlT FmNw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=WnytMSfN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id hx7si536129ejc.316.2021.02.01.02.57.43; Mon, 01 Feb 2021 02:58:07 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=WnytMSfN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S233256AbhBAK4f (ORCPT + 99 others); Mon, 1 Feb 2021 05:56:35 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:59405 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233300AbhBAK4V (ORCPT ); Mon, 1 Feb 2021 05:56:21 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1612176895; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=DD4mokRPZD1wfFQpRszoR6T0yfqXsqqAJBdhLKkcJOY=; b=WnytMSfNg1PUOBasQ/4+oanLqCfWHUbb5UG1PIK/Wa4WwzLRBr4/Id/ceb4a5Nx4sGIi3o E9viuv6fhvdH4WBGYQFZhgYEFrKOqkaO260zvfcGRRguCZrk+/nor+mylOD2ZXQmXp0cPa Fqwcot6TWTkXGEag4MLSc5MqnDwqBm8= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-292-hjen9oOgOcKNMV0I7C0dKg-1; Mon, 01 Feb 2021 05:54:53 -0500 X-MC-Unique: hjen9oOgOcKNMV0I7C0dKg-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 9B42B1005504; Mon, 1 Feb 2021 10:54:52 +0000 (UTC) Received: from [10.36.115.24] (ovpn-115-24.ams2.redhat.com [10.36.115.24]) by smtp.corp.redhat.com (Postfix) with ESMTP id B8A721840B; Mon, 1 Feb 2021 10:54:51 +0000 (UTC) Subject: Re: [PATCH] mm/huge_memory.c: use helper range_in_vma() in __split_huge_p[u|m]d_locked() To: Miaohe Lin , akpm@linux-foundation.org Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org References: <20210201093259.52798-1-linmiaohe@huawei.com> From: David Hildenbrand Organization: Red Hat GmbH Message-ID: Date: Mon, 1 Feb 2021 11:54:50 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.5.0 MIME-Version: 1.0 In-Reply-To: <20210201093259.52798-1-linmiaohe@huawei.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 01.02.21 10:32, Miaohe Lin wrote: > The helper range_in_vma() is introduced via commit 017b1660df89 ("mm: > migration: fix migration of huge PMD shared pages"). But we forgot to > use it in __split_huge_pud_locked() and __split_huge_pmd_locked(). > > Signed-off-by: Miaohe Lin > --- > mm/huge_memory.c | 6 ++---- > 1 file changed, 2 insertions(+), 4 deletions(-) > > diff --git a/mm/huge_memory.c b/mm/huge_memory.c > index 987cf5e4cf90..33353a4f95fb 100644 > --- a/mm/huge_memory.c > +++ b/mm/huge_memory.c > @@ -1959,8 +1959,7 @@ static void __split_huge_pud_locked(struct vm_area_struct *vma, pud_t *pud, > unsigned long haddr) > { > VM_BUG_ON(haddr & ~HPAGE_PUD_MASK); > - VM_BUG_ON_VMA(vma->vm_start > haddr, vma); > - VM_BUG_ON_VMA(vma->vm_end < haddr + HPAGE_PUD_SIZE, vma); > + VM_BUG_ON_VMA(!range_in_vma(vma, haddr, haddr + HPAGE_PUD_SIZE), vma); > VM_BUG_ON(!pud_trans_huge(*pud) && !pud_devmap(*pud)); > > count_vm_event(THP_SPLIT_PUD); > @@ -2039,8 +2038,7 @@ static void __split_huge_pmd_locked(struct vm_area_struct *vma, pmd_t *pmd, > int i; > > VM_BUG_ON(haddr & ~HPAGE_PMD_MASK); > - VM_BUG_ON_VMA(vma->vm_start > haddr, vma); > - VM_BUG_ON_VMA(vma->vm_end < haddr + HPAGE_PMD_SIZE, vma); > + VM_BUG_ON_VMA(!range_in_vma(vma, haddr, haddr + HPAGE_PMD_SIZE), vma); > VM_BUG_ON(!is_pmd_migration_entry(*pmd) && !pmd_trans_huge(*pmd) > && !pmd_devmap(*pmd)); > > Reviewed-by: David Hildenbrand -- Thanks, David / dhildenb