From patchwork Fri Nov 5 20:42:01 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Morton X-Patchwork-Id: 12605643 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D2EB2C433EF for ; Fri, 5 Nov 2021 20:42:03 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id A1C49611C0 for ; Fri, 5 Nov 2021 20:42:03 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org A1C49611C0 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linux-foundation.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 45A3A940088; Fri, 5 Nov 2021 16:42:03 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 408AB94007C; Fri, 5 Nov 2021 16:42:03 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 346E1940088; Fri, 5 Nov 2021 16:42:03 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0132.hostedemail.com [216.40.44.132]) by kanga.kvack.org (Postfix) with ESMTP id 2733894007C for ; Fri, 5 Nov 2021 16:42:03 -0400 (EDT) Received: from smtpin30.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id D9AB58249980 for ; Fri, 5 Nov 2021 20:42:02 +0000 (UTC) X-FDA: 78776048484.30.921CD11 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf11.hostedemail.com (Postfix) with ESMTP id 83D60F0000B4 for ; Fri, 5 Nov 2021 20:42:02 +0000 (UTC) Received: by mail.kernel.org (Postfix) with ESMTPSA id 92D7561262; Fri, 5 Nov 2021 20:42:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1636144921; bh=2ID/AI5rqphJTJ7DPV8bsvOzveeYczPqGUWG3G1vemM=; h=Date:From:To:Subject:In-Reply-To:From; b=k5Kkc13nw9hhpAiYr4+j0JWsfbRXNkc+0ODdEot8VVFVG/oX9PAlKb0Gel0N7T8Sd r2TcF2cwW7hI8IRasrG7jP+8IqzxUS8gmZMsZ7uG9ltLqA/sSzlStxBJsjlVNJzYsS 5D+jDuoUZmCnZlh+qme2ib6TICzDHQewsQheBJWU= Date: Fri, 05 Nov 2021 13:42:01 -0700 From: Andrew Morton To: akpm@linux-foundation.org, baolin.wang@linux.alibaba.com, linux-mm@kvack.org, mhocko@kernel.org, mike.kravetz@oracle.com, mm-commits@vger.kernel.org, torvalds@linux-foundation.org Subject: [patch 141/262] hugetlb: remove redundant VM_BUG_ON() in add_reservation_in_range() Message-ID: <20211105204201.Udvk59sOV%akpm@linux-foundation.org> In-Reply-To: <20211105133408.cccbb98b71a77d5e8430aba1@linux-foundation.org> User-Agent: s-nail v14.8.16 Authentication-Results: imf11.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=korg header.b=k5Kkc13n; dmarc=none; spf=pass (imf11.hostedemail.com: domain of akpm@linux-foundation.org designates 198.145.29.99 as permitted sender) smtp.mailfrom=akpm@linux-foundation.org X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: 83D60F0000B4 X-Stat-Signature: iwqk8hhyboqeq5abd43pkj4up6momi4s X-HE-Tag: 1636144922-40135 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: From: Baolin Wang Subject: hugetlb: remove redundant VM_BUG_ON() in add_reservation_in_range() When calling hugetlb_resv_map_add(), we've guaranteed that the parameter 'to' is always larger than 'from', so it never returns a negative value from hugetlb_resv_map_add(). Thus remove the redundant VM_BUG_ON(). Link: https://lkml.kernel.org/r/2b565552f3d06753da1e8dda439c0d96d6d9a5a3.1634797639.git.baolin.wang@linux.alibaba.com Signed-off-by: Baolin Wang Reviewed-by: Mike Kravetz Cc: Michal Hocko Signed-off-by: Andrew Morton --- mm/hugetlb.c | 1 - 1 file changed, 1 deletion(-) --- a/mm/hugetlb.c~hugetlb-remove-redundant-vm_bug_on-in-add_reservation_in_range +++ a/mm/hugetlb.c @@ -445,7 +445,6 @@ static long add_reservation_in_range(str add += hugetlb_resv_map_add(resv, rg, last_accounted_offset, t, h, h_cg, regions_needed); - VM_BUG_ON(add < 0); return add; }