From patchwork Thu Jul 6 06:20:43 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Aneesh Kumar K.V" X-Patchwork-Id: 13303227 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 30805EB64DC for ; Thu, 6 Jul 2023 06:21:16 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id B39FF8D0005; Thu, 6 Jul 2023 02:21:15 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id A9AA38D0001; Thu, 6 Jul 2023 02:21:15 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 914898D0005; Thu, 6 Jul 2023 02:21:15 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 8391F8D0001 for ; Thu, 6 Jul 2023 02:21:15 -0400 (EDT) Received: from smtpin18.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 56E5EC0496 for ; Thu, 6 Jul 2023 06:21:15 +0000 (UTC) X-FDA: 80980189710.18.A31B207 Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by imf14.hostedemail.com (Postfix) with ESMTP id E7A0F100018 for ; Thu, 6 Jul 2023 06:21:12 +0000 (UTC) Authentication-Results: imf14.hostedemail.com; dkim=pass header.d=ibm.com header.s=pp1 header.b=U2q6ivyM; spf=pass (imf14.hostedemail.com: domain of aneesh.kumar@linux.ibm.com designates 148.163.156.1 as permitted sender) smtp.mailfrom=aneesh.kumar@linux.ibm.com; dmarc=pass (policy=none) header.from=ibm.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1688624473; 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:in-reply-to:references:references:dkim-signature; bh=yr1a0s2KumhZ0CFkrU7sUoWndUDGgUO1gGa/UV3sVPQ=; b=lwXBELUQjJXBD1kCDWnXbgebatDNGuwpugcF7x6rPnp7+dlyxJcloXF3v6vKVx9c7AyF1k QZ9yZv5fV4CHED7EFpKcsbxKCb6BjJNqGynl88oMktdBdIaqyundCjKWE7hn4vUQqAd/HS wLXn0WLxlVLa5v4sIP2tfrcuoIIJjuw= ARC-Authentication-Results: i=1; imf14.hostedemail.com; dkim=pass header.d=ibm.com header.s=pp1 header.b=U2q6ivyM; spf=pass (imf14.hostedemail.com: domain of aneesh.kumar@linux.ibm.com designates 148.163.156.1 as permitted sender) smtp.mailfrom=aneesh.kumar@linux.ibm.com; dmarc=pass (policy=none) header.from=ibm.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1688624473; a=rsa-sha256; cv=none; b=2aQg/R2FV+YawDZHVT6P2GGrKQzHw2lI/Ho5LlG7E1oAWnpRFik2GNI7YitAVh0oVuVvQ9 MKNQSlTIwHqbPh/iLNTn3GX64FgdY+2MzG1usgi90voLLd4ETfeoFKQHmOBi5WhZNydZ45 ELyF4qhXFLSI+1g7wOFbRkezozhftHc= Received: from pps.filterd (m0353726.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 3666H6Gw030031; Thu, 6 Jul 2023 06:21:11 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding; s=pp1; bh=yr1a0s2KumhZ0CFkrU7sUoWndUDGgUO1gGa/UV3sVPQ=; b=U2q6ivyMyuPCUMy2h4h7dbE7/+zm2UKDjQ5b9d/hjnKWUdlzFiy/YNaY0hto+1Dbwuvf HXleaZK8oKdYJeotQJ+a9GT321Ri3yjjYCaX0QjhliPufV2X8138GRUK45AT0fSWVbo2 PFXraZY999aKKlJKkDg61awVXdAh34t0cbraRfzm/RALnHoByyO1jt7pnKBcUR5MDwcr m70IKIDuofZOhE3hcZNiY+14gogrrgjWMS0d03clY4dMOe6ibLyNJ9NgSI9cFQwWE4yC bqjua/v7pylE5JN4jT0Bihukft46eu+gKdY5e3gyg0j9EY3TD/U3Dw1BPZMAU7gexbL3 SA== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3rnr7702em-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 06 Jul 2023 06:21:11 +0000 Received: from m0353726.ppops.net (m0353726.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 3666HeF8032010; Thu, 6 Jul 2023 06:21:10 GMT Received: from ppma04wdc.us.ibm.com (1a.90.2fa9.ip4.static.sl-reverse.com [169.47.144.26]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3rnr7702e6-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 06 Jul 2023 06:21:10 +0000 Received: from pps.filterd (ppma04wdc.us.ibm.com [127.0.0.1]) by ppma04wdc.us.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 3663S0pu023006; Thu, 6 Jul 2023 06:21:09 GMT Received: from smtprelay07.wdc07v.mail.ibm.com ([9.208.129.116]) by ppma04wdc.us.ibm.com (PPS) with ESMTPS id 3rjbs5qe6s-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 06 Jul 2023 06:21:09 +0000 Received: from smtpav01.dal12v.mail.ibm.com (smtpav01.dal12v.mail.ibm.com [10.241.53.100]) by smtprelay07.wdc07v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 3666L8Gr63439340 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 6 Jul 2023 06:21:08 GMT Received: from smtpav01.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 1EEE758058; Thu, 6 Jul 2023 06:21:08 +0000 (GMT) Received: from smtpav01.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 439A758061; Thu, 6 Jul 2023 06:21:06 +0000 (GMT) Received: from skywalker.in.ibm.com (unknown [9.109.212.144]) by smtpav01.dal12v.mail.ibm.com (Postfix) with ESMTP; Thu, 6 Jul 2023 06:21:05 +0000 (GMT) From: "Aneesh Kumar K.V" To: linux-mm@kvack.org, akpm@linux-foundation.org Cc: Yu Zhao , "Aneesh Kumar K.V" Subject: [PATCH v2 4/5] mm/mglru: move iterate_mm_list_walk Helper Date: Thu, 6 Jul 2023 11:50:43 +0530 Message-ID: <20230706062044.816068-5-aneesh.kumar@linux.ibm.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230706062044.816068-1-aneesh.kumar@linux.ibm.com> References: <20230706062044.816068-1-aneesh.kumar@linux.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-GUID: 07TClkUMhIei1Ay7t6zSQTdS9UF-K6Yc X-Proofpoint-ORIG-GUID: 7Hnd3S7y7YS0MZ6vaSPyUqtla9Ghov18 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.591,FMLib:17.11.176.26 definitions=2023-07-06_02,2023-07-06_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 adultscore=0 malwarescore=0 spamscore=0 mlxscore=0 bulkscore=0 mlxlogscore=999 lowpriorityscore=0 impostorscore=0 priorityscore=1501 clxscore=1015 phishscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2305260000 definitions=main-2307060052 X-Rspamd-Queue-Id: E7A0F100018 X-Rspam-User: X-Stat-Signature: 1efzmcmr7e4a17aqmb3ie7k9qm43yazz X-Rspamd-Server: rspam01 X-HE-Tag: 1688624472-67123 X-HE-Meta: U2FsdGVkX19INP/DoOjDFG0ldItwBj9fCj/idaymkSAiMPxoyBeA/NAyAPCGqOAxmvNs3iL7r/7//5hsBsja8wz23DvaVCqeDYKowd2j6yG7aH8mApjxuylFbk8vE/SrYlhgtGGpgV7oBQmkuaL33jrxs/JjZ4lQemg01sr+iIOVvfX/9Yk5PZUhtWfoDUpYBC/XNNzEKBIzmnZDA6rqLDjcAm2FyIRizB0PgnWBHKxwemEfzZMAV24lyAlhrqhQXl9dwqGtxPO2NqzXOycevVL00EX5biF3vRJbw4vGsD2jfBm9ig1bExxDXKdQsAZFrM2yvlvDGucOd7IclMGfbcn8Omf1+qy22/rHlpuKtJb6t1SH6KaH7Dlub/+odUNFbLvT1V/VOkVtkNkdn4sbviZpkkIrMj4CBUf43acn8ttyOQzEsY/D8Jvuk3UwbT14tHk/RV/nfV6+3KW/0TORVz9AP2IMsYLhI6eC1JQSLESBscEx6iWcKdsravdFAJzc4moK39OyUNij04PUgXMnKB2fBiE5hsUNCARZ5aLvu+yE0ySdNHAVxkL23NEZ2j8axe5ju6AA/yiD+pBK+leUR5IZ8gtBmffH63ggFL2VwdQWvPnrRW446BC6h5h/GiDGZhHNTWcqve5A8r3yjyCAA96DjPiMfLdwIwIbMDPY5dBn5DiTkDvP2pgSpp62eSBBSMozmyo7CYEXD7hYiyPQrHGefwepyZydgPY2d8ueuVhHuVLHt5r1NDeNzQh3Ae6PBEnQCbl1t7BTe5yjyynlMe5n5krXrKdA5ZmWgGQ8lGt//ZGu8CfiEqi9eFkH2YPpNy0jNlPVG5rfXpMmljqa88CUGNz92wmB/VtKySl27Dzkp/ePuWPVQDzScIdZBl8Gtxu0l88CP879j1gfXBhyOIVOr9ougG0KRSWlPIEjk3ea7j6RlhSMpboNDsL56f6TgbZFbnFBFYlQTOCpFhC fjUUI7Oc 6lv35CunWR5F1VMStR0FvNZJTKu58st1gy8bAh1Go1pKnWaJCHdY1fxDAQonCW6Zq7MMiS+jDWkwzNadKmZx6TZ3xlCgaE3RSthkCKm+l4RO1kmqebz0FL8m29/Cu25SYZjUluIkjw/KcsVtGdECbhPnoSVU1BZJ+UETsjBICw7Bp2ER5DqI+J1hlSA== 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: This helps to avoid building this code on powerpc. No functional change in this patch. Signed-off-by: Aneesh Kumar K.V --- mm/vmscan.c | 54 ++++++++++++++++++++++++++--------------------------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/mm/vmscan.c b/mm/vmscan.c index a846a62df0ba..0ea7a07990d3 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c @@ -4356,6 +4356,33 @@ static void walk_mm(struct lruvec *lruvec, struct mm_struct *mm, struct lru_gen_ } while (err == -EAGAIN); } +static bool iterate_mm_list_walk(struct lruvec *lruvec, unsigned long max_seq, + bool can_swap, bool force_scan) +{ + bool success; + struct mm_struct *mm = NULL; + struct lru_gen_mm_walk *walk; + + walk = set_mm_walk(NULL, true); + if (!walk) { + success = iterate_mm_list_nowalk(lruvec, max_seq); + return success; + } + + walk->lruvec = lruvec; + walk->max_seq = max_seq; + walk->can_swap = can_swap; + walk->force_scan = force_scan; + + do { + success = iterate_mm_list(lruvec, walk, &mm); + if (mm) + walk_mm(lruvec, mm, walk); + } while (mm); + + return success; +} + static bool inc_min_seq(struct lruvec *lruvec, int type, bool can_swap) { int zone; @@ -4491,33 +4518,6 @@ static void inc_max_seq(struct lruvec *lruvec, bool can_swap, bool force_scan) spin_unlock_irq(&lruvec->lru_lock); } -static bool iterate_mm_list_walk(struct lruvec *lruvec, unsigned long max_seq, - bool can_swap, bool force_scan) -{ - bool success; - struct mm_struct *mm = NULL; - struct lru_gen_mm_walk *walk; - - walk = set_mm_walk(NULL, true); - if (!walk) { - success = iterate_mm_list_nowalk(lruvec, max_seq); - return success; - } - - walk->lruvec = lruvec; - walk->max_seq = max_seq; - walk->can_swap = can_swap; - walk->force_scan = force_scan; - - do { - success = iterate_mm_list(lruvec, walk, &mm); - if (mm) - walk_mm(lruvec, mm, walk); - } while (mm); - - return success; -} - static bool try_to_inc_max_seq(struct lruvec *lruvec, unsigned long max_seq, struct scan_control *sc, bool can_swap, bool force_scan) {