From patchwork Thu Feb 16 17:07:03 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SeongJae Park X-Patchwork-Id: 13143522 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6808BC636CC for ; Thu, 16 Feb 2023 17:07:27 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id EBF806B0075; Thu, 16 Feb 2023 12:07:26 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id E6F9F6B0078; Thu, 16 Feb 2023 12:07:26 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D373B6B007D; Thu, 16 Feb 2023 12:07:26 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id B88226B0075 for ; Thu, 16 Feb 2023 12:07:26 -0500 (EST) Received: from smtpin25.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 8950E407CF for ; Thu, 16 Feb 2023 17:07:26 +0000 (UTC) X-FDA: 80473786092.25.D69EC91 Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) by imf21.hostedemail.com (Postfix) with ESMTP id D474F1C0028 for ; Thu, 16 Feb 2023 17:07:22 +0000 (UTC) Authentication-Results: imf21.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=hDtS9I6s; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf21.hostedemail.com: domain of sj@kernel.org designates 145.40.73.55 as permitted sender) smtp.mailfrom=sj@kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1676567244; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:references:dkim-signature; bh=kfQwTxGuflXsK/rRgxQHCQNDMz22LotLnqHbIBo53pc=; b=pde2sdf0CTECr+m6/wXRYkMlorVcECTY3ox84KofZ88DL9eTRMiAunThCwpagXc0rDjV1R QcOjQWIJLvzuPM8K8bGWDuky4ZLFVAY9TYNwpWU/HKyF6SH5dBFwEz5o185Q6bL5c5Gpm8 by8vf9kD4pZkgDteUSjXHxx4hk+jhe0= ARC-Authentication-Results: i=1; imf21.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=hDtS9I6s; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf21.hostedemail.com: domain of sj@kernel.org designates 145.40.73.55 as permitted sender) smtp.mailfrom=sj@kernel.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1676567245; a=rsa-sha256; cv=none; b=LzuJlquddqslC3W8pMavgp4SVEjB2mgHpCCAjFScO9S0b1nOcjouKSXz7RAVC6hnR2hEH1 Q9C/0p+oa6JYWHEOXPOQRB8rZv9AexhRWB1JBpb+UHuzKOdCO4/YzHofQ5Jcxexly83Q6O 1P1KfxcPrsV9i/XoOGlmjN+kSvC/qBQ= Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sin.source.kernel.org (Postfix) with ESMTPS id ABB4CCE2A4B; Thu, 16 Feb 2023 17:07:16 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 68F00C433D2; Thu, 16 Feb 2023 17:07:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1676567235; bh=GtSTUkCXK1My+Jx8HkQB4IxgNaeWPvF4xmOLmoRW+tc=; h=From:To:Cc:Subject:Date:From; b=hDtS9I6sBwZ7jiOd2SRV98PtYO6lel6tRvet9AiiTVSp56uhyqy4PIr+I/pGKCvEj E0ghd10Lp0Qw70DYSVKtes6yVdWKEluq6gu18Ya8pysIb87ePVXn2y8Gtm6cVvnZx4 Wd41bUwAtyWT0VkQB7qkq+cIkJrkLUkyIxzwHcns7RIW75Aq9esaQO135tuLbOQFcY hUjQeUmJeOaiCSi0ABLpCsVLajtV4Dqm9o6XFxgLkonixdH7Mw5p4xW8l7SOSOCjsq LTPoSxNvaQP9s/EjfeDnYX9hjdepE5O3OVvLqWmAmR5JIJBx6zt5As+hGE5kDqZFWc E9McxnLL7muLQ== From: SeongJae Park To: Andrew Morton Cc: SeongJae Park , David Hildenbrand , Oscar Salvador , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Baolin Wang Subject: [PATCH v3 mm-unstable] mm/memory_hotplug: cleanup return value handing in do_migrate_range() Date: Thu, 16 Feb 2023 17:07:03 +0000 Message-Id: <20230216170703.64574-1-sj@kernel.org> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Rspamd-Queue-Id: D474F1C0028 X-Rspamd-Server: rspam09 X-Rspam-User: X-Stat-Signature: ueuqnwiheeiz8sj9qfesuju7cwa4i73m X-HE-Tag: 1676567242-122949 X-HE-Meta: U2FsdGVkX1/Zxvor+2pRGbey2ZaOKRqn9N8Y/ncZ2KvpX/oGeQ4aJSdTrvmHAAOgINpGZUvigIE0irTuwbi7XqKvoCNy/3d+h+9qpG3nLRggbjtiE6IY3iAQJGgccBB2KoT+v1znGfdd/S5UyGdRarXkw+59Qary1cX9kOZ4fi+E09FSf0WcLFKSdMbM06WLUhTbxuDrDcEzZBNOJYm4erKlgbspHKkmSe3b9At8t0mCk6vMrCvl6GfmoMrJx5DwarHTMlusmFSxFjRyAeyw1K+vHHV/sqltHM0/5NxKTa9z9nLPGM+AIQ+KXmQu5s8h2okc2pKgRZ1beLCK7XzDC7qEw5KTc4Axw3b9bJ9A2B3QWex2TkBRuse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DpWbiHIug9BJg X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Return value mechanism of do_migrate_range() is not very simple, while no caller of the function checks the return value. Make the function return nothing to be more simple, and cleanup related unnecessary code. Suggested-by: David Hildenbrand Acked-by: David Hildenbrand Reviewed-by: Baolin Wang Signed-off-by: SeongJae Park --- Changes from v2 (https://lore.kernel.org/linux-mm/20230215230300.61125-1-sj@kernel.org/) - Squash patches into one - Add Acked-by from David and Reviewed-by from Baolin Andrew, I saw you already added v2 of this patch into mm-unstable[1], but David asked me to squash the two patches into this one. Could you please replace already merged patches with this one? [1] https://lore.kernel.org/mm-commits/20230215233032.0CECAC433EF@smtp.kernel.org/ mm/memory_hotplug.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c index bcb0dc41c2f2..6df3072d11df 100644 --- a/mm/memory_hotplug.c +++ b/mm/memory_hotplug.c @@ -1620,12 +1620,10 @@ static int scan_movable_pages(unsigned long start, unsigned long end, return 0; } -static int -do_migrate_range(unsigned long start_pfn, unsigned long end_pfn) +static void do_migrate_range(unsigned long start_pfn, unsigned long end_pfn) { unsigned long pfn; struct page *page, *head; - int ret = 0; LIST_HEAD(source); static DEFINE_RATELIMIT_STATE(migrate_rs, DEFAULT_RATELIMIT_INTERVAL, DEFAULT_RATELIMIT_BURST); @@ -1679,7 +1677,6 @@ do_migrate_range(unsigned long start_pfn, unsigned long end_pfn) page_is_file_lru(page)); } else { - ret = -EBUSY; if (__ratelimit(&migrate_rs)) { pr_warn("failed to isolate pfn %lx\n", pfn); dump_page(page, "isolation failed"); @@ -1693,6 +1690,7 @@ do_migrate_range(unsigned long start_pfn, unsigned long end_pfn) .nmask = &nmask, .gfp_mask = GFP_USER | __GFP_MOVABLE | __GFP_RETRY_MAYFAIL, }; + int ret; /* * We have checked that migration range is on a single zone so @@ -1721,8 +1719,6 @@ do_migrate_range(unsigned long start_pfn, unsigned long end_pfn) putback_movable_pages(&source); } } - - return ret; } static int __init cmdline_parse_movable_node(char *p)