Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp7154319ybi; Mon, 8 Jul 2019 15:44:53 -0700 (PDT) X-Google-Smtp-Source: APXvYqwmkJcjmz+re6+rGTYccfaw/WT+PKJ//+N1MsTXxUd+04fZpZSNjJl3GPdI2Za4PGTsVZoy X-Received: by 2002:a63:5147:: with SMTP id r7mr26386803pgl.320.1562625893374; Mon, 08 Jul 2019 15:44:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562625893; cv=none; d=google.com; s=arc-20160816; b=x0MBDtutCjQIh1PnkvBvHoSw7kaMcv1VTx7xDtDk/W+3Kno3C0dD+C554OxesHz0vm yiPg/F8K3THgWtXqBSq7/Q0pNcAUodgcSMpSnmsCCagnF3XzU59YhKoQEr91+d/jhBl+ qh/lYx78PexMC0v64wCN1xeyie+w5acbtJYwhHmsDg8OOjPxwmj7CjFW0yIqLZ9t6Urp TzN647vGUxLHhviEXJhEiL3ruzTuXr1pYSrkveqw9EusmxouukZZpiQDP9vFxnt+CFuQ +wrX/WtH/wC7ilDM1m48H2eMq/Gaax94i9lUXWqz3wgdUUg0UaotyvClVeu2FFBlUCRe ggJA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=n9fo3wNw7aw0RbIvRpzphALTB15Qd7wOzZ709YJZYuY=; b=VBdUNUpJKF829e7qJWBjYP28O3VBwsR3j9w0gD709Pw38fBAhS/j2ft4JjEHIeAkyi e9JZz4HjlSHmUQe6C63XsYGnWJ/8NEQjtzoUR9++7MoTxZHAxtbQ7vBebz1J4OS0Immc ujVWpZkq4vSGUv7ay9fTM0e6wKK7xN+9s7QOERtdMEv0XHH7zX/h9OFz3E4IT3eETVnx Ul4kk+NTMJS/h/cv75okxnPoVmtMypaUBRij3ueofMqKkMcgC9YWykAxRJxr3bXQ8Y+7 cQ6T4ROO7C+VIYxLwnaAAYFnPXJ75VaRSFgWX+sJxBu1B1mgfFOHGVK20E3v65jGOHtW CdXg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=oIfcgycO; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d5si18203415pgv.584.2019.07.08.15.44.38; Mon, 08 Jul 2019 15:44:53 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=oIfcgycO; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730778AbfGHRfm (ORCPT + 99 others); Mon, 8 Jul 2019 13:35:42 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:36538 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726997AbfGHRfm (ORCPT ); Mon, 8 Jul 2019 13:35:42 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.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:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=n9fo3wNw7aw0RbIvRpzphALTB15Qd7wOzZ709YJZYuY=; b=oIfcgycOcXRvCrTXgzSUV3Bbf KxQgqOLbwzHQGVNcZ7LSDii9CxBNLC5dofvJT19StoJNVlTzLJeQMrZ4MDiLx8JWqU9/dAlS8j4rs x3Cjiih3NScNZa19n6elIHzrcKQNF/BnylzXlnLZ6FbTZCo0oVYG5LuOfOj3yMH5DmF5nlBBi/lCi QKu8WOzXkvlFv4ag30R/h4cbVeI3BCx11EqJI5VVi7aT+6gD0MS493/D0mhY+otM0exYLPWc79BJ4 5/ffMw6ehL1nj9mt8Yo3CRY11wQVVZ6ZR3lTUgVce2PL8EKpnd2GtWPjkUGTpACd3m3/PQudvUw6z n0VyKrmZA==; Received: from willy by bombadil.infradead.org with local (Exim 4.92 #3 (Red Hat Linux)) id 1hkXY6-0006it-Eo; Mon, 08 Jul 2019 17:35:34 +0000 Date: Mon, 8 Jul 2019 10:35:34 -0700 From: Matthew Wilcox To: Pengfei Li Cc: akpm@linux-foundation.org, urezki@gmail.com, rpenyaev@suse.de, peterz@infradead.org, guro@fb.com, rick.p.edgecombe@intel.com, rppt@linux.ibm.com, aryabinin@virtuozzo.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] mm/vmalloc.c: Remove always-true conditional in vmap_init_free_space Message-ID: <20190708173534.GF32320@bombadil.infradead.org> References: <20190708170631.2130-1-lpf.vector@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190708170631.2130-1-lpf.vector@gmail.com> User-Agent: Mutt/1.11.4 (2019-03-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jul 09, 2019 at 01:06:31AM +0800, Pengfei Li wrote: > When unsigned long variables are subtracted from one another, > the result is always non-negative. > > The vmap_area_list is sorted by address. > > So the following two conditions are always true. > > 1) if (busy->va_start - vmap_start > 0) > 2) if (vmap_end - vmap_start > 0) > > Just remove them. That condition won't be true if busy->va_start == vmap_start.