Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp1044436ybl; Wed, 29 Jan 2020 14:17:38 -0800 (PST) X-Google-Smtp-Source: APXvYqyAKVnQsKwdYb6MSDH5ZH+a7FveHyEtY2PlO/Iiteb0P8tyAUfCB9jlqAUFqpJB+w+BT3pj X-Received: by 2002:a9d:74c4:: with SMTP id a4mr1192110otl.119.1580336258359; Wed, 29 Jan 2020 14:17:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580336258; cv=none; d=google.com; s=arc-20160816; b=V01/esZErmVq/BrfaeHgWV9IL6U/RtR29g1L+AAZjwBxnbH3ta1q2C1gxwqBjmsobR EMY26Crt+AmpLNJyKuJV44VrQgEwRFcRPv5UW6fm9OMj1TFB9LvXPdfbsPqRBjydu9LH dSzR53HjMpGvmUm+VS5pMJGAadQcJ/wgOwrzd/wgMsLy3gNJk20tKpRNxdkmSpqr0TJN MG/r9MuClFu1h3NqbGA79sIe8NiVMnoMY7UxI3ioUSn6VuEUx/t4TdTyw6Z9Zu7wtUYs bh7ENWWCCX0v4SyIs/cWoyVN2gu35QuJ3Gx6DzML5tjZW9yxba4MeLFeedvkTnQ/TaBS Ie6g== 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=xOvLGEqIXLISAFRrgputMCISxuat62tDLX/eEbxS2ws=; b=g4URzJkh78tzAAbnhc5nUwTe49DiO62bQOWFM7VW8C7CDF0mTty+RNyWwRxV+ocwXF nlOpMnPB5kgkbV8Gmd7ljI/YEZMrRSmn+3eSULd2T3TALy//At8udZXnDMCR9pTtXZgL rmEKJ802jrJO/qUQlfSawoHFzKgEYRPxNWxX5HukhCHDvhdgmU/2LWJHsHld2tibi5ba U0wk0DkxHYsa+6snfhRD13D1rOZs3vCjTMgDNS1aBtrp9O+gMvaZ/uFaRG4v5qJl+Z5x oFca0dZjAUA4YGG7/i6SyhawI/9BKbeI29UPPE83AEZpRGVRwW94pHLTSsDWMyMqvm5h DHjw== 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 j2si1832719otr.255.2020.01.29.14.17.26; Wed, 29 Jan 2020 14:17:38 -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 S1726764AbgA2WQd (ORCPT + 99 others); Wed, 29 Jan 2020 17:16:33 -0500 Received: from mga02.intel.com ([134.134.136.20]:4886 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726222AbgA2WQb (ORCPT ); Wed, 29 Jan 2020 17:16:31 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 29 Jan 2020 14:16:31 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,379,1574150400"; d="scan'208";a="261959914" Received: from richard.sh.intel.com (HELO localhost) ([10.239.159.54]) by fmsmga002.fm.intel.com with ESMTP; 29 Jan 2020 14:16:28 -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 v4 1/4] mm/migrate.c: no need to check for i > start in do_pages_move() Date: Thu, 30 Jan 2020 06:16:13 +0800 Message-Id: <20200129221616.25432-2-richardw.yang@linux.intel.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200129221616.25432-1-richardw.yang@linux.intel.com> References: <20200129221616.25432-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 430fdccc733e..4c2a21856717 100644 --- a/mm/migrate.c +++ b/mm/migrate.c @@ -1661,11 +1661,9 @@ static int do_pages_move(struct mm_struct *mm, nodemask_t task_nodes, err = do_move_pages_to_node(mm, &pagelist, current_node); if (err) 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