Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp2382712ybl; Mon, 20 Jan 2020 01:47:17 -0800 (PST) X-Google-Smtp-Source: APXvYqzyok0KXLSypaZ1Q7aYoFkBCxg1ulEBvc4mdx40JhOp69rTC9hIHxQFMI8rZddXJj8CeA7M X-Received: by 2002:aca:ba46:: with SMTP id k67mr12202345oif.38.1579513637049; Mon, 20 Jan 2020 01:47:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579513637; cv=none; d=google.com; s=arc-20160816; b=Qc55JDk1vpUvretjHoEgWZhb19Iw59eP4B1w5SdmIKSVlFRv9cwmo2m6BOc/kyefUu jIYDp839Cm7BYmnD02SX9xlrNcH7DWk7ArSPM8nlxeJT5aWtnZL40Stws92ablrBtZ3y lt2NaAgQ+Yc9DqIgkBnEofjC5R9ux3yiLaiPlW7gFgNlM2OQqBu9P+oH70RLR646sRMu XYk9OuffB3A+95FbnjOjvQxTu3dKw9VclVq/f7tYsg2h1ajGBYyB9CRvC/G9VjieeTQv 0zjPtpG+jx4jvRxukhT3tlUfiWy5QubhDlb1+z7bxWXLUrAbGaIugn+Q2qCygIM6tnX7 SqZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=7VdZ/NoDHGeQH6szStgVZMI/Om0YjW5KDW+nhhNOKoM=; b=EWquU3Z98owBahv/Oo071ngLiYqEpTyIEC6B5ltsxCiHvC51KNXVSYwJUdIR1tcyRm 0vS8rqYtqGdYdTg1Gbw9FbA2dlOfWoUlbQTRee28B15MDX5FjSVqI+UZluY0Dm/nzdfQ /VvCQpX33hJR3A13ukot82kpYimt+SHU8RfqwhNTM7BJswaUXXLuI/DaYclTYUvb90JN 6Yxgr2dA8fRkVoKX0YNPAypLGVK/NzA8ShGjfonKRibm1f8nQ7h3VrcXsCUnurMm0iN5 7ZC9zvF5WuY/R1N3sMYOJm9nu0+kaRgqisVr/KU2W57ikAx+yaH4y9XDAAf4F656Ugv8 C4dg== 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v25si17808330ote.90.2020.01.20.01.47.05; Mon, 20 Jan 2020 01:47:17 -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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726621AbgATJqL (ORCPT + 99 others); Mon, 20 Jan 2020 04:46:11 -0500 Received: from mail-wm1-f67.google.com ([209.85.128.67]:39167 "EHLO mail-wm1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726039AbgATJqL (ORCPT ); Mon, 20 Jan 2020 04:46:11 -0500 Received: by mail-wm1-f67.google.com with SMTP id 20so13973480wmj.4 for ; Mon, 20 Jan 2020 01:46:09 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=7VdZ/NoDHGeQH6szStgVZMI/Om0YjW5KDW+nhhNOKoM=; b=TanLV92lg8FrIngV5/ycBIHjFcmhW/qdc2r5BadRlMaaIlztcColGKW37i4MbmESRX qWv+B9A4zEpF6KG3Mc+F3Nid9h8afOfN6y9ff2pOWOEcK+VkcLnT7zOtmVF3rBocKz60 dO3QnwqHrKDVzEj+dKsyyUGJfmmqzzUJcNDVYJ14t6ZN/rBu57XX46adNKfmLYFk98I6 +xv/w8hbCRIdCrgZMIYEm7pa4LBYXUn42IROOZtc2l9iNRF4Ju8l+T5EjRSVNZT1nc8/ dU9Nx7V8ktNP9CAa/QeXO9c55p0wTfHWFg1Uh/mrzIxNWY0aL+uRYVbGFX3swTvtz/6X C9VA== X-Gm-Message-State: APjAAAV6ZRwK2zpYwPFHl0dUOY/z73u5SBSunte0ewbkwFh9LDRFnxVo IJDEUx0Ofwon3BH8xlk7CaA= X-Received: by 2002:a05:600c:24d1:: with SMTP id 17mr17967184wmu.188.1579513569343; Mon, 20 Jan 2020 01:46:09 -0800 (PST) Received: from localhost (prg-ext-pat.suse.com. [213.151.95.130]) by smtp.gmail.com with ESMTPSA id j12sm50668940wrw.54.2020.01.20.01.46.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 Jan 2020 01:46:08 -0800 (PST) Date: Mon, 20 Jan 2020 10:46:08 +0100 From: Michal Hocko To: Wei Yang Cc: akpm@linux-foundation.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, yang.shi@linux.alibaba.com Subject: Re: [PATCH 3/8] mm/migrate.c: reform the last call on do_move_pages_to_node() Message-ID: <20200120094608.GN18451@dhcp22.suse.cz> References: <20200119030636.11899-1-richardw.yang@linux.intel.com> <20200119030636.11899-4-richardw.yang@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200119030636.11899-4-richardw.yang@linux.intel.com> User-Agent: Mutt/1.12.2 (2019-09-21) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun 19-01-20 11:06:31, Wei Yang wrote: > No functional change, just reform it to make it as the same shape as > other calls on do_move_pages_to_node(). > > This is a preparation for further cleanup. > > Signed-off-by: Wei Yang > --- > mm/migrate.c | 8 ++++++-- > 1 file changed, 6 insertions(+), 2 deletions(-) > > diff --git a/mm/migrate.c b/mm/migrate.c > index c3ef70de5876..4a63fb8fbb6d 100644 > --- a/mm/migrate.c > +++ b/mm/migrate.c > @@ -1675,8 +1675,12 @@ static int do_pages_move(struct mm_struct *mm, nodemask_t task_nodes, > > /* Make sure we do not overwrite the existing error */ > err1 = do_move_pages_to_node(mm, &pagelist, current_node); > - if (!err1) > - err1 = store_status(status, start, current_node, i - start); > + if (err1) { > + if (err >= 0) > + err = err1; > + goto out; > + } > + err1 = store_status(status, start, current_node, i - start); Please don't. This just makes the code harder to follow. The current err and err1 is already quite ugly so do not make it more so. > if (err >= 0) > err = err1; > out: > -- > 2.17.1 -- Michal Hocko SUSE Labs