Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp1131760ybv; Thu, 13 Feb 2020 16:32:33 -0800 (PST) X-Google-Smtp-Source: APXvYqznH6EztXNjpvU/rVIE7np5TvC7Gm9pzvBQDKhsYnkHpfD/gBW0IfnB4/bRHGJfXjQolxN0 X-Received: by 2002:a9d:6c55:: with SMTP id g21mr168449otq.264.1581640353487; Thu, 13 Feb 2020 16:32:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581640353; cv=none; d=google.com; s=arc-20160816; b=SOqxNmDHvyY75/pbF69zLrJPROoc9LBIpCmbI7JhpAaCSBjnL1CEHWMdvccYY7vse2 yx2a6vKdTiJJwlOEG/htnhTILycDHO7kk0CU6EPcEdOTiJAyE4Hk3dTIch8DtYmfw4XC FqT6H6uTmWtsya2+USyNw5YuUcB2I7LRxMSOAejajbPyKoV1zz+jAzFpqZTRFLROSbN1 fZlLY6TOKk7blVNPByUiM6KSusTdZg6HJ0Ey+HikqXv3S+/pM9eEzDJCQ3q6ViuhN+mk YYJ/wdSbuOagFdEoTABGPecdOytrfoRUgVAsOuNRuinyydvhymDlPJTCFqQ/8C3M/o1i TUWg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=AfNe4/Roz3BYTY2Sn++tysueKwylaOEqHZ1jY6Rjoqo=; b=K7pfT2znnhixBWyUVh495O5WhRsHLng9+e6JsHdvKhz+RV7LE7I3npzD68+BaV9D31 Iemmbaup7pHQoLHhXX7P6Pn1Sn8j7D/APs/ANetQ1Wy9n1wUBjiuJ7ukD7aHdTp/ooIq NtMgQNr8Hh5RbVPxLLT01sHENkITpicCj+784spAHgi2VIm2rogIkubuE3jY0nReybyh 564MlSyaTa2KVVUqi5OflWIoB5CIbERANyU8ZazrSa9VVY7dOC/8/XmovQT3g7c1Kq47 yUNNPjrlDF4q8lCvpnPq1qGF/djht84ICn5wla2t67s1DLg2/AEfDnV1hN5VTHcavs6E 9/9A== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r82si1899338oie.116.2020.02.13.16.32.21; Thu, 13 Feb 2020 16:32:33 -0800 (PST) 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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728061AbgBNAaR (ORCPT + 99 others); Thu, 13 Feb 2020 19:30:17 -0500 Received: from mga09.intel.com ([134.134.136.24]:25633 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728034AbgBNAaR (ORCPT ); Thu, 13 Feb 2020 19:30:17 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 13 Feb 2020 16:30:16 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,438,1574150400"; d="scan'208";a="227246059" Received: from richard.sh.intel.com (HELO localhost) ([10.239.159.54]) by fmsmga007.fm.intel.com with ESMTP; 13 Feb 2020 16:30:14 -0800 From: Wei Yang To: akpm@linux-foundation.org Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, mhocko@suse.com, yang.shi@linux.alibaba.com, rientjes@google.com, david@redhat.com, Wei Yang Subject: [Patch v5 1/4] mm/migrate.c: no need to check for i > start in do_pages_move() Date: Fri, 14 Feb 2020 08:30:14 +0800 Message-Id: <20200214003017.25558-2-richardw.yang@linux.intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200214003017.25558-1-richardw.yang@linux.intel.com> References: <20200214003017.25558-1-richardw.yang@linux.intel.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org At this point, we always have i >= start. If i == start, store_status() will return 0. So we can drop the check for i > start. [david@redhat.com rephrase changelog] Signed-off-by: Wei Yang Acked-by: Michal Hocko Reviewed-by: David Hildenbrand --- mm/migrate.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/mm/migrate.c b/mm/migrate.c index b1092876e537..6d466de4d1d0 100644 --- a/mm/migrate.c +++ b/mm/migrate.c @@ -1675,11 +1675,9 @@ static int do_pages_move(struct mm_struct *mm, nodemask_t task_nodes, err += nr_pages - i - 1; goto out; } - if (i > start) { - err = store_status(status, start, current_node, i - start); - if (err) - goto out; - } + err = store_status(status, start, current_node, i - start); + if (err) + goto out; current_node = NUMA_NO_NODE; } out_flush: -- 2.17.1