Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp2429152ybl; Sun, 26 Jan 2020 02:28:55 -0800 (PST) X-Google-Smtp-Source: APXvYqzXYpZyJMAlM0KFlfWOHifDj49cJr/cmD4FXQUftA0Od1rYfW3v4/fx9Juk2ELzB8z4Mz7N X-Received: by 2002:a9d:6a4f:: with SMTP id h15mr359818otn.86.1580034535325; Sun, 26 Jan 2020 02:28:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580034535; cv=none; d=google.com; s=arc-20160816; b=W9Nd26dNImznaqcGof6cLVLqVvzQBpB9wsBCOQd1yoWE53W9bEpvfYPTOpqmg6+RoR Z6myaspoQZzAuJDJo7TrRQwWEQ0TIwxsXx52gayNu8UwXXNtENEUHKTzVAYPCW1T2hT6 YTv1HF4vH4q6XlYydNSvkKC/URtfvba3H5d2tuOsNMaWa9lvfnvSsw40gI6sa8XhQCmz 90ni0LNjhdUhi12FiRkyMILc0bhIImEn06sgn5cl/Ee/WetSOnp59Yk0loXRE9q0afTP NlaRNYDU0rUNi9Dpvw7/umvOpR9Q8zfH+pC1iBMN2lS6RbQobwj2ZkzXvkHzLEmbBzVJ OZAg== 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=u0vg6MG2ozWI+E+wCax64/UAnUl7IXDY1NJWdCyEtFE=; b=naeGXfcFT7CoxjOef8mszi27cobD/d/YXJ+ZSF6M2xbr5XqglJNw6bcFKTOwrCSsqk ROJJMFrbKyZSkFvVNKbHuouiejSfACOFTMRpCD6SsdgMrPoqEM1AYCDy6DEosDwi9Egx fy0O+U1kuMNVoKvUmsbhCbpUGii+oTi2sImUwKiYrKOF5duvqAx1b059/T5rIZQCMpLW /hxqbjnHgxdNRe3l9RsggBFixDHnkELyghqLx1E04bQetjp78IwEq07nHZ6DqEhQVK/b TGXCTydTsthS85lq9gXyfki//BT7HZFNTZ8GltorL8HukdpeF5fEYGx/alFWUAE/wS3/ 4vLw== 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 t184si2356880oig.184.2020.01.26.02.28.17; Sun, 26 Jan 2020 02:28:55 -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 S2387405AbgAZK1S (ORCPT + 99 others); Sun, 26 Jan 2020 05:27:18 -0500 Received: from mga17.intel.com ([192.55.52.151]:7005 "EHLO mga17.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729213AbgAZK1S (ORCPT ); Sun, 26 Jan 2020 05:27:18 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 26 Jan 2020 02:27:17 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,365,1574150400"; d="scan'208";a="428720075" Received: from richard.sh.intel.com (HELO localhost) ([10.239.159.54]) by fmsmga006.fm.intel.com with ESMTP; 26 Jan 2020 02:27:16 -0800 From: Wei Yang To: akpm@linux-foundation.org Cc: mhocko@suse.com, yang.shi@linux.alibaba.com, rientjes@google.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Wei Yang Subject: [Patch v3 0/4] cleanup on do_pages_move() Date: Sun, 26 Jan 2020 18:26:19 +0800 Message-Id: <20200126102623.9616-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. v3: * rebase on top of Yang Shi's fix "mm: move_pages: report the number of non-attempted pages" 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 | 90 ++++++++++++++++++++++++---------------------------- 1 file changed, 42 insertions(+), 48 deletions(-) -- 2.17.1