Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp7155976ybi; Mon, 8 Jul 2019 15:46:51 -0700 (PDT) X-Google-Smtp-Source: APXvYqyCRjZTD+i5vHliWzKUM3srffns60sfm/Oa7XvcE6yoHWeLyfTYHiVsQhuY32bQM1bjLkbk X-Received: by 2002:a17:902:c509:: with SMTP id o9mr28294667plx.222.1562626011217; Mon, 08 Jul 2019 15:46:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562626011; cv=none; d=google.com; s=arc-20160816; b=I1itz3NdFLJHEfToEkwbbKXzmjGGXE78uvE6UOm3HeW0Rf6ntbV/K2XLiT5xNa/eND sFjxiaLhgc+/162igZnL65VbNWPEmbJ/qiHBJ/hx+PX42zaQuGQbJGrmldEeHLJXwH9i /VyZWdwG78rhZH4EXePaywJ7Bc7WOSYpSmgXYW7lCj3Ve+TmLftQeSb5XNqzf3Z/R8QP qGaoGkm9+vSoUji01XKTgyuZ5snyGPnLLMu/WEBaIMwpj9fvDYvu0TbGl8wI6U9W00ha xW9hAXE+UGWt3ZWFXIz/UGz5vjzco650sgeOkhBjFRbh2/fmJC57zU+PhRK9k8n6sg4Y m1yw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=J6BYXR7+fOdaYBcbsh3ughBec33Q5ZK6pIAnMm20zX4=; b=thulaR4oqZlve5HYQ22weVULeVJB+y2Q+EceSyKrwu/KHFK2+2N1kg57dco+oAAdq7 /WUL2FHWf2EVFg8TkuL0YG53GXVnMT4gY56MCqSOihRvod2AEZcXxXI8uQemLxS5YIUp g6/AhXRA1DkQekehq8AAOcGLu4rmxhRwQNp7x8DBDkg/AvSJHJ1jMbN4n9XnDMsyVznp KD+mBj+04rPnjBSTW0NoZyvqGnv7h9Xf9reXY3pYce+uPwG19kWQYzVJtLuKQ0ENTh3V QLVDI7SlmsLPiSDySg53dxPLK095MtIeLVQMk3idxYswYE0AyIAjmVDvA1LjLQP3vygk 4l7g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Kn+ywXAH; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a23si17974113pls.189.2019.07.08.15.46.36; Mon, 08 Jul 2019 15:46:51 -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=pass header.i=@gmail.com header.s=20161025 header.b=Kn+ywXAH; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732448AbfGHR6M (ORCPT + 99 others); Mon, 8 Jul 2019 13:58:12 -0400 Received: from mail-oi1-f196.google.com ([209.85.167.196]:38125 "EHLO mail-oi1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729052AbfGHR6L (ORCPT ); Mon, 8 Jul 2019 13:58:11 -0400 Received: by mail-oi1-f196.google.com with SMTP id v186so13302841oie.5 for ; Mon, 08 Jul 2019 10:58:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=J6BYXR7+fOdaYBcbsh3ughBec33Q5ZK6pIAnMm20zX4=; b=Kn+ywXAHUiDPK5+TJCW6kotSSgpd2BHUDV/2hUkPZNa+N4r5coXiFuu3l6K3D1Zbwj FI9bcHWA1ajVrR3Y0W6Xix4ewCKitv2pdqvT1+r1V7z72PVfPoRnL84Euav+NXe19qT4 rODKJZieMLdDEq4CRj7FZ4/qJRAduZpTAFy697lgHDkcdIi0A2biKe3/IuvACWtpEJ3G Mg54FTPHln+5J8ONLpPXf6a0oVi1rYUU6poMXe1I2pCulaFXMsEWq2Cl5zVGjyCoCpiY i5TEN97zqBk2QVfWX0w/bn/A8w0ZSYvne/1WI777j8ypcyqwQ3zrUNeBVZsLeYWnTF46 cEog== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=J6BYXR7+fOdaYBcbsh3ughBec33Q5ZK6pIAnMm20zX4=; b=ch35ECqDbZhf/XKYi1rbXh3KTjp8jAIoZqErtjVm0Rmv3X11o88vKeLWPCeo8nU7hn hI6ULobTQy1nnmy0La+d3hu3LgHaYNhUR7TBKjKEpMBRdebtBwX/feY2+BFIRXUL4t4H MJtJeYdUoK8I2vAa7ioDjlr1Erpin5hDTHHYuB1T0Q5Oum9QJYs5u2sNzOZ8KlbdKsAV cq+zlu+s7VbSZMo8mPrqtAVuEZ4lIvFioRYAxISg2d35I/h9TbBu0LwDfrWJkqhEQ/jH SUt5yJjvVxpeeBDdpRWaM/YS38DxDQXAg+cBSWByB7RzOqaR7zx1PN/m3qgvI4CUCFj4 zf7Q== X-Gm-Message-State: APjAAAXSdlpyIDF4mvdMzqzLa8Ppsg7sMA89Xl4GT/LuFTaLYt0B0FHe 737Cm/tw6MdTkhGrs3noPyrI9vRzzmO64M4PTl8= X-Received: by 2002:aca:4d12:: with SMTP id a18mr10154747oib.33.1562608690964; Mon, 08 Jul 2019 10:58:10 -0700 (PDT) MIME-Version: 1.0 References: <20190708170631.2130-1-lpf.vector@gmail.com> <20190708173534.GF32320@bombadil.infradead.org> In-Reply-To: <20190708173534.GF32320@bombadil.infradead.org> From: Pengfei Li Date: Tue, 9 Jul 2019 01:57:59 +0800 Message-ID: Subject: Re: [PATCH] mm/vmalloc.c: Remove always-true conditional in vmap_init_free_space To: Matthew Wilcox Cc: akpm@linux-foundation.org, Uladzislau Rezki , 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 Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jul 9, 2019 at 1:35 AM Matthew Wilcox wrote: > > 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. Yes, you're right. Sorry for my bad job.