Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp1388725pxk; Mon, 31 Aug 2020 18:49:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxv8+dY1HbqlEY+zO3GipRqwH/sooiDPTpL4es4J+2WcfRXznQXWj7SHHLgrzcnP/HWs3Id X-Received: by 2002:a50:8e58:: with SMTP id 24mr3697819edx.226.1598924943474; Mon, 31 Aug 2020 18:49:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598924943; cv=none; d=google.com; s=arc-20160816; b=lV1IGydY/cGx/NOJzamC9vbAnLASaT52fLmtBPkx86O6yri0tJCNA66W4rUOz+H0mM cR0CIHDTdydjHWNgFau6/AKjj+Ad29D11cf9IHNKmmOOMVVYrBIvuRM9gfD63JD8tP1B +XSLnI0natBFktQPZdEadxtRESX0Zg0rLUNLMW2vOxlYPO9QSTDGulKikw4ZHvHOtMeb VqJwEeAfYzTh4T5v3zm1xhyl3qkvzXxxNMJCd+GYEdBvczXFxeTHQVVekVGZ74bOjK37 WQ6Wm0sr4BlNoFx6evExC5iJNoFjZJPZ+CiL6MiTC5T2CR4Xq1c3Nx+G3uVMRxWVWFyL qHWA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=o6fK4QU0V00LoU57tqHhvil0E6Qr/vpFkOYvwQHa1yI=; b=soqhK1WVHNjc6BseQwOz7xbE0chU6H08XzOW/w8ZRQmp7OQGuu4pIBRuhwAbLXGQ6j tbwrWCyhx1n8dufdhzpPuNXBAt4oWVRkWwgwgtsEMyXMkDlMdsmKdaJe4qEb2hoyNrdx cRKgG7N9W4vwQHEr/NiCnVxPXYS3/mSAGyqpFhlRC3sxvEg5KUaCwQ0U9uy7ez/fyjar DmL4OFfsXpSIOZBeBNTbKp8kbt0xgOIJXs0CRS7P0+aaZ8khZSOFcSbglkTN85efZbO2 RC+ouGcPuBZ4wP5+cF9KzK73hM2MGzfcho0pihZqJaut6Ogz30icVe09Owk/AAxdgIbW i0KQ== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dr21si8592234ejc.470.2020.08.31.18.48.40; Mon, 31 Aug 2020 18:49:03 -0700 (PDT) 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726293AbgIABqr (ORCPT + 99 others); Mon, 31 Aug 2020 21:46:47 -0400 Received: from out30-45.freemail.mail.aliyun.com ([115.124.30.45]:47877 "EHLO out30-45.freemail.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726044AbgIABqp (ORCPT ); Mon, 31 Aug 2020 21:46:45 -0400 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R881e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e01355;MF=richard.weiyang@linux.alibaba.com;NM=1;PH=DS;RN=6;SR=0;TI=SMTPD_---0U7UAs.4_1598924802; Received: from localhost(mailfrom:richard.weiyang@linux.alibaba.com fp:SMTPD_---0U7UAs.4_1598924802) by smtp.aliyun-inc.com(127.0.0.1); Tue, 01 Sep 2020 09:46:43 +0800 From: Wei Yang To: mike.kravetz@oracle.com, akpm@linux-foundation.org Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, bhe@redhat.com, Wei Yang Subject: [Patch v4 2/7] mm/hugetlb: remove VM_BUG_ON(!nrg) in get_file_region_entry_from_cache() Date: Tue, 1 Sep 2020 09:46:31 +0800 Message-Id: <20200901014636.29737-3-richard.weiyang@linux.alibaba.com> X-Mailer: git-send-email 2.20.1 (Apple Git-117) In-Reply-To: <20200901014636.29737-1-richard.weiyang@linux.alibaba.com> References: <20200901014636.29737-1-richard.weiyang@linux.alibaba.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org We are sure to get a valid file_region, otherwise the VM_BUG_ON(resv->region_cache_count <= 0) at the very beginning would be triggered. Let's remove the redundant one. Signed-off-by: Wei Yang Reviewed-by: Mike Kravetz --- mm/hugetlb.c | 1 - 1 file changed, 1 deletion(-) diff --git a/mm/hugetlb.c b/mm/hugetlb.c index db6af2654f12..fbaf49bc1d26 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c @@ -240,7 +240,6 @@ get_file_region_entry_from_cache(struct resv_map *resv, long from, long to) resv->region_cache_count--; nrg = list_first_entry(&resv->region_cache, struct file_region, link); - VM_BUG_ON(!nrg); list_del(&nrg->link); nrg->from = from; -- 2.20.1 (Apple Git-117)