Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp4302499ybl; Tue, 21 Jan 2020 17:18:18 -0800 (PST) X-Google-Smtp-Source: APXvYqw4alytevjCcSdqOuqZ7z3VPbXIwhJlgYAZ/IFbku4VGGs0dmhOIcXLVQ/AsWMJJmwzH198 X-Received: by 2002:a9d:6f11:: with SMTP id n17mr5626039otq.126.1579655898055; Tue, 21 Jan 2020 17:18:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579655898; cv=none; d=google.com; s=arc-20160816; b=IZhrtWmO+cUzewNb2yA1NmrHjF+/0CeLVYladjrctu4auRIF9bzOnDk5oKTm31pFf7 6tEY9UvPD0fO9Eik7i5IqBfwUSdxJOg6tkugGCiVfi39cCvWO5uJrsCTFFOhRZKGMS2l hMmtSwvaAmtgGiCI/pMfqLOej77RvOMSCWZPlHSxMhbW2/IWAD/kyIwCWQIQUu36t+Hx JJh0pdKwyGvvElwDEAunaq61e6Dg6ne904HzQSe2A9qoulrncb1gof3Tezcyf9lVc/or 5esGoDbrD5SjAmP3qwW/DlikiF9JCiJOert8WPvEYCG4jg6P/AsMTKB85As67KmlLUYY 8TBg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from; bh=WCDt2qig5DfVip3IlKL4BhWkdJlik6KwBhQ8nMi+8z4=; b=z64cL4ofdqiRdCEEnypWiafietEO+MjP2qW0jVIp5C1yVqS6LgJvGXoWXOB/9KOQGW iUaFdx0jJDPfmbT7JfbQs3ta6q2AY6SNioF4lCbu8ewpwcanCap3yJDTTxHG87Lfa5QE KAXoj+j/YsBYutXqMHUP3JoJ+9ye0tQY37g3bopPYUlB7Y/bSY2yEoh60hJjR1v1pJyS oDzay15/GDZP73y80q6HSzG0tfWiBD2GfcG8bvLBtpYJtxd+NXcQyP1A8V05miyRuTKE cnk7/UIWopR6vFeA2skE/pVAQoN1O0Z2aWom/PGC+fG20HdWUcfKbTGxR5gxy5J+/FCo 4foA== 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 q131si18963533oig.203.2020.01.21.17.18.05; Tue, 21 Jan 2020 17:18:18 -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 S1729028AbgAVBRH (ORCPT + 99 others); Tue, 21 Jan 2020 20:17:07 -0500 Received: from mga04.intel.com ([192.55.52.120]:21618 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728900AbgAVBRH (ORCPT ); Tue, 21 Jan 2020 20:17:07 -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 fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 21 Jan 2020 17:17:06 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,347,1574150400"; d="scan'208";a="221088258" Received: from richard.sh.intel.com (HELO localhost) ([10.239.159.54]) by fmsmga007.fm.intel.com with ESMTP; 21 Jan 2020 17:17:05 -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, Wei Yang Subject: [Patch v2 0/4] cleanup on do_pages_move() Date: Wed, 22 Jan 2020 09:16:43 +0800 Message-Id: <20200122011647.13636-1-richardw.yang@linux.intel.com> X-Mailer: git-send-email 2.17.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The logic in do_pages_move() is a little mess for audience to read and has some potential error on handling the return value. Especially there are three calls on do_move_pages_to_node() and store_status() with almost the same form. This patch set tries to make the code a little friendly for audience by consolidate the calls. After this, we can do a better fix. v2: * remove some unnecessary cleanup Wei Yang (4): mm/migrate.c: not necessary to check start and i mm/migrate.c: wrap do_move_pages_to_node() and store_status() mm/migrate.c: check pagelist in move_pages_and_store_status() mm/migrate.c: handle same node and add failure in the same way mm/migrate.c | 57 +++++++++++++++++++++++++++------------------------- 1 file changed, 30 insertions(+), 27 deletions(-) -- 2.17.1