Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp3680536pxb; Mon, 1 Feb 2021 01:35:33 -0800 (PST) X-Google-Smtp-Source: ABdhPJwhPuj494XkvNtrEFLua2+8aT//bGvpr5f49S5e/mvMZVHwelDszrRakV6DbU8N4FI4TaYY X-Received: by 2002:a17:906:ae51:: with SMTP id lf17mr16910493ejb.330.1612172132869; Mon, 01 Feb 2021 01:35:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612172132; cv=none; d=google.com; s=arc-20160816; b=MoCed+ZbftZvtVRPY1JBZR72M6T4Ht+IwdNyikarwdCiNRZvIGolNe/AJLBFTeTzKD xWtxR+oko9+iUZ7ZM9PsNynrPxuhsE5Db9e5TKkmpQkl/Lm26bN9WvGB0RF2L1Zy8Hou 71dXhiWNeJ6ONZSOaTUXlnU7WexhYqKgXSqWrTmcvARS2EfERg7hqsrfLDZ5Dx05l2nJ 0HFY7+SZXT5nxC9PNi3RjsVCPpqlVozgs/4tzJ3LgyKL472UQwVgLMybL2BFEaiYdtjw DB4AMWLnVJMkc9ZbmDe1QwZwvEfChf8lL5Gy88OpA2A+yMHon1kNTcohEwYwE+h0zWty NxdQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=MmDApqWX2MTZfk0jJ9MNSeS8dgpobCnYcbLf1nvU8nc=; b=ydWztPa4yFD/uwEh10oomkjItnxSjrg9Gwg7rXtEW2pQH0CIoaVdm0IoPU9Ic9n9iR nnUeMvOy5fbXL4/PswYulvlesNTqNtXiPkhiJMwL42sH6EsTxE4MCnKucKx8TvmPsmUT iIWalKbcA3pIgkWwtbcSl6Z6fV2dxEchauzJ8FTahbiycoZ9dDQajg28qYlUwiEcyVlo 6MPW0QS5QjcHtrEFiDGQsL631lBpEQR7sClB8p6DOSrJ1AGNMH98oQBF3Sg6bdahKn5J JrHs3fURRxZtjdq95LdtksL9jTwQX1T5dNhTnOdMKyz/k8c1tOZNaqWjRCLla8INSEAX MSgA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b21si9742213ejv.648.2021.02.01.01.35.07; Mon, 01 Feb 2021 01:35:32 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232690AbhBAJeB (ORCPT + 99 others); Mon, 1 Feb 2021 04:34:01 -0500 Received: from szxga04-in.huawei.com ([45.249.212.190]:11664 "EHLO szxga04-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232623AbhBAJeA (ORCPT ); Mon, 1 Feb 2021 04:34:00 -0500 Received: from DGGEMS409-HUB.china.huawei.com (unknown [172.30.72.60]) by szxga04-in.huawei.com (SkyGuard) with ESMTP id 4DTjPm0PZqzlDlc; Mon, 1 Feb 2021 17:31:40 +0800 (CST) Received: from huawei.com (10.175.104.175) by DGGEMS409-HUB.china.huawei.com (10.3.19.209) with Microsoft SMTP Server id 14.3.498.0; Mon, 1 Feb 2021 17:33:09 +0800 From: Miaohe Lin To: CC: , , Subject: [PATCH] mm/huge_memory.c: use helper range_in_vma() in __split_huge_p[u|m]d_locked() Date: Mon, 1 Feb 2021 04:32:59 -0500 Message-ID: <20210201093259.52798-1-linmiaohe@huawei.com> X-Mailer: git-send-email 2.19.1 MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.175.104.175] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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)); -- 2.19.1