Received: by 2002:a05:7412:37c9:b0:e2:908c:2ebd with SMTP id jz9csp1040616rdb; Tue, 19 Sep 2023 19:34:01 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHg8rKj24Y2eDMXdY2DwN8bx/Zy0MqFZU8Di2qsMVINpGKhLvcs0PY+YEHAN4i0LfnzKvSx X-Received: by 2002:a17:90b:1e0a:b0:269:85d:2aef with SMTP id pg10-20020a17090b1e0a00b00269085d2aefmr1451690pjb.20.1695177241050; Tue, 19 Sep 2023 19:34:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695177241; cv=none; d=google.com; s=arc-20160816; b=uq6Pa5M5TFeOG/VPCGefE9i8MQc2PZsgJzBRrzzTjrd5GqSkl+xaBV6p/yHSae2tLr gfkr1Udz6PpJn5KKsd8+E2fB6FlDEOzEC7bRClEW4j/37tTZcNi3h5482Sj1xKXXXqpO Sv5YnLbzFFaDBhxbWml1QxeCRP4hZ+C7ojE9QXftIesB/4ihsXMPAk0LBjkYmqxkfhj5 98AHRdIFY9kddpM1K1LLxZKBBPkJXesJIyHK8ajqRI1xb0x/3eirQl4jmq3hX9UaWQj0 GIzYR3r0BGwgeBPkZ5KLxBQHlFMu/VazzUEk2aU6d6y3UuCvvHk92Or2fz8GbzwTE0pn W2zg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=pa2Q4AVd0DaDLynzk11Wz6VXixHJPHsc2evKc7fSPcw=; fh=LYUYjL0CjiPutGoxwd7bsMUBeFKiH+cy6npfpS+wzHg=; b=NnxmMiVdSx7eGzn4OcZ6AReLz1KRlBQZGfTto7l9VUtFz/v56Kz/hs6QQW8jAMP1cv 3cnUTKTqFGZyMDPeeNs+j787JH/x4vUwuZCG2fa226Ucf8xFy9WWZwj4OpAzcusY0nCk d36hTwNsgOQMP4zLx/qIzGUq0YvJ9pLtTpXwL6tswFWUoWJkmXnSJtewThNVCurdFKDg Bk85OF7zw8MRo8Jb0FlUVyz3ue/EzphDoBzpjpr9idUxDs5ImEoPyJWzZSRgge0NMmgb 7GxMFmLelyCH6O9cebYnX2887yWaeXHOkvSyqyEB76qB7+VmMMbi8jMjKx74Lavk+5BJ 9smQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=ZeM3ElQ1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from morse.vger.email (morse.vger.email. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id my1-20020a17090b4c8100b00263c23a5693si612464pjb.13.2023.09.19.19.34.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Sep 2023 19:34:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) client-ip=2620:137:e000::3:1; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=ZeM3ElQ1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id 866BE826FAA4; Tue, 19 Sep 2023 16:20:32 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229988AbjISXUa (ORCPT + 99 others); Tue, 19 Sep 2023 19:20:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56258 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233760AbjISXJo (ORCPT ); Tue, 19 Sep 2023 19:09:44 -0400 Received: from mail-yw1-x1142.google.com (mail-yw1-x1142.google.com [IPv6:2607:f8b0:4864:20::1142]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AB6EC1AD; Tue, 19 Sep 2023 16:09:28 -0700 (PDT) Received: by mail-yw1-x1142.google.com with SMTP id 00721157ae682-59bdad64411so63541537b3.3; Tue, 19 Sep 2023 16:09:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1695164967; x=1695769767; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=pa2Q4AVd0DaDLynzk11Wz6VXixHJPHsc2evKc7fSPcw=; b=ZeM3ElQ1HzVqwFGCEyA0SUPPF9ZYdWj2/KiyTpGR+/UFzkU4LNFrJ4UeJcZw4jZ/kI igtg8I7bc8Pw+vIE4aXADggMmcp47VST0Ie3r003trGperGCoHDPxMVEN6cq2+YWO/Wp 3gKXLFRk2fEmn5SEVtCeBqTVrZc7szn2ceOkrT//IJKQAh5pxx9x0MJ0n7smnpnWV/cK 5YJutzbePLuCjdLMyJu9+thlyky8hBM+R6fDrDT8iKwQ79UwuEB/Q8HAJ1fHzaSfHs0s gsOiYKxHHEOUbv40maSdHWk4jWc5f641aA5KTfytv1Igs9yomtJu/zcRWhavcvoRdCoZ eOgA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695164967; x=1695769767; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=pa2Q4AVd0DaDLynzk11Wz6VXixHJPHsc2evKc7fSPcw=; b=MwHLsg/CWyH78bT9ux0laxU/bg5PRoGSaCDdLDYNK2LyxGa6QsXGm0In3EDyRW6dhG T7HlFp1nFLvtpX4F78dWHjERzuY3BFuv0byqo1qxckga32CDlirwyfRXW3wteAev3Lja GYvidzhuTRrEFEuUJnftghhneXTzZIyAOxmVT9Y7LhoMTjcx+hhUy1+8U51szv5f3h64 72Q94qK+xLcnuHFBdTe5VeqsLM/tOB34E0iE2nxkgAhTxierNBshBRUdXKdFnaiFTT6i eSh+Z5EKOE8l1ufARXq1qMz7EAq/45Z1WSZyjimoc38SocN+UNRLQDZl8/vAM4h2Iso1 +qhg== X-Gm-Message-State: AOJu0YwKxkYOS6zY1F+SEa+POy4fkSV+dlVJ+Yj65BM72Ky0UeF2v1Bp 18BIj9OGl7YTfVq/HCnY5l2ZYwY8nS9y X-Received: by 2002:a81:9106:0:b0:59e:7f14:4b48 with SMTP id i6-20020a819106000000b0059e7f144b48mr878908ywg.41.1695164966663; Tue, 19 Sep 2023 16:09:26 -0700 (PDT) Received: from fedora.mshome.net (pool-173-79-56-208.washdc.fios.verizon.net. [173.79.56.208]) by smtp.gmail.com with ESMTPSA id d128-20020a0df486000000b005925765aa30sm3476327ywf.135.2023.09.19.16.09.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Sep 2023 16:09:26 -0700 (PDT) From: Gregory Price X-Google-Original-From: Gregory Price To: linux-mm@vger.kernel.org Cc: linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, linux-api@vger.kernel.org, linux-cxl@vger.kernel.org, luto@kernel.org, tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, dave.hansen@linux.intel.com, hpa@zytor.com, arnd@arndb.de, akpm@linux-foundation.org, x86@kernel.org, Gregory Price Subject: [RFC v2 2/5] mm/migrate: remove unused mm argument from do_move_pages_to_node Date: Tue, 19 Sep 2023 19:09:05 -0400 Message-Id: <20230919230909.530174-3-gregory.price@memverge.com> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230919230909.530174-1-gregory.price@memverge.com> References: <20230919230909.530174-1-gregory.price@memverge.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Tue, 19 Sep 2023 16:20:32 -0700 (PDT) preparatory work to re-use do_move_pages_to_node with a physical address instead of virtual address. This function does not actively use the mm_struct, so it can be removed. Signed-off-by: Gregory Price --- mm/migrate.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/mm/migrate.c b/mm/migrate.c index a0b0c5a7f8a5..dbe436163d65 100644 --- a/mm/migrate.c +++ b/mm/migrate.c @@ -2026,8 +2026,7 @@ static int store_status(int __user *status, int start, int value, int nr) return 0; } -static int do_move_pages_to_node(struct mm_struct *mm, - struct list_head *pagelist, int node) +static int do_move_pages_to_node(struct list_head *pagelist, int node) { int err; struct migration_target_control mtc = { @@ -2123,7 +2122,7 @@ static int add_page_for_migration(struct mm_struct *mm, const void __user *p, return err; } -static int move_pages_and_store_status(struct mm_struct *mm, int node, +static int move_pages_and_store_status(int node, struct list_head *pagelist, int __user *status, int start, int i, unsigned long nr_pages) { @@ -2132,7 +2131,7 @@ static int move_pages_and_store_status(struct mm_struct *mm, int node, if (list_empty(pagelist)) return 0; - err = do_move_pages_to_node(mm, pagelist, node); + err = do_move_pages_to_node(pagelist, node); if (err) { /* * Positive err means the number of failed @@ -2200,7 +2199,7 @@ static int do_pages_move(struct mm_struct *mm, nodemask_t task_nodes, current_node = node; start = i; } else if (node != current_node) { - err = move_pages_and_store_status(mm, current_node, + err = move_pages_and_store_status(current_node, &pagelist, status, start, i, nr_pages); if (err) goto out; @@ -2235,7 +2234,7 @@ static int do_pages_move(struct mm_struct *mm, nodemask_t task_nodes, if (err) goto out_flush; - err = move_pages_and_store_status(mm, current_node, &pagelist, + err = move_pages_and_store_status(current_node, &pagelist, status, start, i, nr_pages); if (err) { /* We have accounted for page i */ @@ -2247,7 +2246,7 @@ static int do_pages_move(struct mm_struct *mm, nodemask_t task_nodes, } out_flush: /* Make sure we do not overwrite the existing error */ - err1 = move_pages_and_store_status(mm, current_node, &pagelist, + err1 = move_pages_and_store_status(current_node, &pagelist, status, start, i, nr_pages); if (err >= 0) err = err1; -- 2.39.1