Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp5334977rwb; Wed, 17 Aug 2022 15:54:30 -0700 (PDT) X-Google-Smtp-Source: AA6agR5SiLFKFnQdzZBsoltfQE2Xg/LROK+gGC17mnxyTWI7lgXn7Cl2d9v0O9AfG5s7VYQttv01 X-Received: by 2002:a17:90b:33cb:b0:1f4:f635:93f8 with SMTP id lk11-20020a17090b33cb00b001f4f63593f8mr6119025pjb.74.1660776870474; Wed, 17 Aug 2022 15:54:30 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1660776870; cv=pass; d=google.com; s=arc-20160816; b=ShrvHJLf3uL6SRmcwQ9oAGPoRxv0D7W8FNaq9YIxYtUf7YyE0LgvtgWHSYnbN7pqk7 1kXZx5F0HiJhd79Dw7AIjQY0Gek5g7ehIP7QVfWigHgdLwnWP9vtwqbieQGAIugbZUFs yY4jkdvQV2Ss+Ljfd+IgCpAqpZBSEyMKUo/KEn7/oLw94wGhV1pXznVZ06LK02YJLEuX BzfehnwmrrmwCHbIAmgK149aXhO+xgFuGUbIQKxSJuuqU2BD4U1g/wKKJANJHV9K48NZ FMpz5V6npEvDbErg5H1pvgpKEwGh/uO30yv8G13G4NcUZrc5PT7iLOibzv+MTC+Pyi02 LMyg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:in-reply-to:content-disposition :references:message-id:subject:cc:to:from:date:dkim-signature; bh=C/CtIoNig97YsR4/teW4tjCmi6HIEPwB5xYMshscy6c=; b=IxqIZ1xaxSW//2lq3xDXC1XEnzT6+fLRyYIoz4z3SqunAT7idJWjwtFKw07aDOtU1i r4aCQCOgZI2zPlo6BCQkfrwK+8rRAIOmQZqSrvOaRrx+na/AnzKRbUjn3MqJGNgHg5VQ 7pd8oiO8zeUdaj6mikkPgwhcNfYp30ppVZigN0RazCE8Jl+sL65atnN2FIF3LnO5ygh0 TvOq/6y+hKFFXGuMlV/jMxE3Ro++S7o0y5iLtwfFLcENRb+bs2WsASJWZ6B5ZzWo/shk eUKeleoPMEcEfpaqCq4YWXjpTQpR83bCFRx0Nr6H/t0tV6Y4nzWc+6kHdVWzpWqJcDkf OU/A== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@Nvidia.com header.s=selector2 header.b=nuGoviNF; arc=pass (i=1 spf=pass spfdomain=nvidia.com dkim=pass dkdomain=nvidia.com dmarc=pass fromdomain=nvidia.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=nvidia.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h12-20020a056a00170c00b0052bee98ed2dsi176843pfc.81.2022.08.17.15.54.19; Wed, 17 Aug 2022 15:54:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@Nvidia.com header.s=selector2 header.b=nuGoviNF; arc=pass (i=1 spf=pass spfdomain=nvidia.com dkim=pass dkdomain=nvidia.com dmarc=pass fromdomain=nvidia.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=nvidia.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234593AbiHQWuQ (ORCPT + 99 others); Wed, 17 Aug 2022 18:50:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50174 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241662AbiHQWuL (ORCPT ); Wed, 17 Aug 2022 18:50:11 -0400 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2068.outbound.protection.outlook.com [40.107.220.68]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B3C64A220E for ; Wed, 17 Aug 2022 15:50:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GBdCtqjU4NJ9me+DilKEgGSsMLICcqXb9lwMV0BrRER+Z5aZZvhr1XAXwlOfz1dWH/3WN0ywlOgkGFBjBRWzLi/r8qt4xnm9SNI19wVDOX85/9z6cZ64zayAplJ9V3/vN+3D2qetF5SCpH1Y6eV79VOrKk3soHlBS/UXGPPFPBHDOxfLNEr4Y/1IR/TKj9f+O5ADczokqbB6DI6FgIThskaqXn+to7qkMjdGWT1P1NKDRsw6VcsGCVgHRZX48R0RoSshfLqI5vAIxSRn2nMK/4+mV65r/o/MnySYMyS88wdDeKQZh9sFS8RhcSuKg/Awnvq9qVbTw3ZHV+g6jPP+eg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=C/CtIoNig97YsR4/teW4tjCmi6HIEPwB5xYMshscy6c=; b=ALk3vUmPErhiVwKJLyTBogH+n1IQuVxFshW0S8Po2OEkLbFe4I1BGqmE+UsecmfAFODToGCCAS3pgjY7OVlnNFu/FxJxy6S/q3n3rxny1UJD93PDwQDHWhHQUrUynmhz7juE0Mjgh1vqjoYJcqtdMAg1j0Jci3T7D3/mb6H9lpBTUBEbWm7vDxGHIU4feSAZmRMEQeIIGEVk7Rj3rxppQyA53+tmCfhXU0HChXiWp2l4MmtGzJTAxIH4FzhoIIJwxGzslrUYtfTSWyxzNj2fG37/2Mct4wCgbRNYxLTrV1qYuzFGd6SjwhvtdvIqPIMPPayhOXwnECfdhS5Nws+cDA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=C/CtIoNig97YsR4/teW4tjCmi6HIEPwB5xYMshscy6c=; b=nuGoviNF5wUkTaQdFgYxpfR0bCkftGxUaSZ6x9yJhWNjNqlU9NJIi9EcEz82rU/kKQCz1Q0UI3mP28psfXnxuYUpqc7qlLv77CiTAurbsbKXQz8TEPkbtAjkKxSQiRDpMx4GSg/dMOEqA4pvvVAcOn0UWD4Ips4WRFudbBLk4BOjthzN0vLe7ZGALjmwid9z7eUR1yHnpNAPBR5AjfK3zPq4Q4Nvyfhe6T3ugBWUBJ0VwFwqHhzQJheNbmx3c1jlKneCkby+KJVprEy7K/v1GgOtt/ECnu25On/J7PdCULWvVAyKgwo37HTz9wBGmhUxE5WcTfl5fCIrqjYj3TsS0Q== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nvidia.com; Received: from MN2PR12MB4192.namprd12.prod.outlook.com (2603:10b6:208:1d5::15) by BN8PR12MB3041.namprd12.prod.outlook.com (2603:10b6:408:46::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5504.16; Wed, 17 Aug 2022 22:50:07 +0000 Received: from MN2PR12MB4192.namprd12.prod.outlook.com ([fe80::462:7fe:f04f:d0d5]) by MN2PR12MB4192.namprd12.prod.outlook.com ([fe80::462:7fe:f04f:d0d5%6]) with mapi id 15.20.5525.019; Wed, 17 Aug 2022 22:50:07 +0000 Date: Wed, 17 Aug 2022 19:50:06 -0300 From: Jason Gunthorpe To: John Hubbard Cc: Alistair Popple , linux-mm@kvack.org, akpm@linux-foundation.org, linux-kernel@vger.kernel.org, "Sierra Guiza, Alejandro (Alex)" , Chaitanya Kulkarni , Dan Williams , Felix Kuehling , Logan Gunthorpe , Miaohe Lin , Muchun Song , Ralph Campbell , David Hildenbrand , Matthew Wilcox Subject: Re: [PATCH v4 2/2] mm/gup.c: Refactor check_and_migrate_movable_pages() Message-ID: References: <487960bf67c7273ff5606c76f73bb51271bc7b90.1660269441.git-series.apopple@nvidia.com> <6b61e9bf7c65f78524db32ba3e65a7eb6b8a76a0.1660269441.git-series.apopple@nvidia.com> <87edxgvixy.fsf@nvdebian.thelocal> <87wnb7tycb.fsf@nvdebian.thelocal> Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-ClientProxiedBy: BLAPR03CA0128.namprd03.prod.outlook.com (2603:10b6:208:32e::13) To MN2PR12MB4192.namprd12.prod.outlook.com (2603:10b6:208:1d5::15) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 11b9fca3-a9d6-45a7-1951-08da80a2d4c0 X-MS-TrafficTypeDiagnostic: BN8PR12MB3041:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: sy/V/dEosrNeMG7cLfO6oXiEcJenDtXUoQMwElMMDwkQ16RjJ8oz3e2ctuOUrhgNyZiyFqrkKPuS/7566jRb14Mi9Be4IeeTWwZF1Ax8y+oLmfiFOg0s5P/akdEsMn3OpUN2Wdvjlg0H5CxE1TJfclg3djbBIkEhLK7mzBompOHp8xmhRStq1XfHMguMk6TuVTYZrkpAvyF7dm5snhMJYTDJKMlGFGJE44R96QKRRbC8zXFCVgwG+6kDvPNww9GJ2gNcca8Ko56wH/a4FK5YyEnTZqHHw2J5EiWLa/5yPu8QlGDpOYte/EjXFwbJwqqCeJ7jVpVrCvDT4SVnEAMxOpibwfB5XgxkHmmkpSB2BOZ7/8sQ7gm9ntAc5fxEWryMRMzzstubre24z/xWKT26f1qVNs1g8ZIz/HAKBR0QFekpzx3MiPGGBMPP1vSdSxsAt/I6nKaXTALbEXlt1pT3NaXh8i2HL09AWvoRHkSzqiHhdCsaeilcRW8dIqoo6pLm27GIObo8rP8dRXqHYUlZMDBNvUYT9za/hAket83K+fxPxLJKdg3t2W/24gl3B2HCJfV3mz9xOPDg/tYYWvxP4wMa3oRGzULlGbz7jm96xYjFN4IAMSuaAgb4alkG2Vvo01MJ0CQN0O4RDAPVgnm5eR9sczXUVmIpKAbDZDVhEKdbCo2qh83iNbfmIZmtmA8lrWWobxl/w9A4QygG9yZhqA== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MN2PR12MB4192.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230016)(4636009)(376002)(396003)(346002)(366004)(136003)(39860400002)(36756003)(6512007)(26005)(6506007)(38100700002)(41300700001)(7416002)(6862004)(5660300002)(4744005)(2906002)(8936002)(66476007)(4326008)(6486002)(186003)(66556008)(66946007)(478600001)(86362001)(8676002)(2616005)(6636002)(316002)(54906003)(37006003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?E9S1Rky5MLTgQiBaXC23FKNjPxTsPLEcNsqqqmBNSonP36NFsIBG79rXX8d1?= =?us-ascii?Q?uPeb0ljy4VF294wsXZh9vLOeCUD1Yw+HnJbv+mZ7B7Ny6F+vvGySXFKXZ4lo?= =?us-ascii?Q?DKukLLNxdOeqDmQNdGPcLBDXBO3NhB71BhjCppBnMs9yQ4GvEov4WQROmmj9?= =?us-ascii?Q?2q91cA3wW3p9trOEaAWCEdjlkJsNHhxaCE3Md1fUx4V8lDlukSTe6OcslUcv?= =?us-ascii?Q?BJJP+sohU7mp+y2FYJaCJ5SMyMjLeoAQv5sPXdhqgOLZoUxI8DttIxVseGVY?= =?us-ascii?Q?l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DSve2eseJvk?= =?us-ascii?Q?tavxmPLkHwBrrSTwKAq3whoZXHokyOqzlnwW1fbzae7GIc552V5fJs9JYMxR?= =?us-ascii?Q?lZ1MOa4O1mr5iHK6uUNAtedIOBVx9A3xtfYZy8oppnQ/ujTYM6r8gYY/dD/w?= =?us-ascii?Q?IFZzVzb7scXJGNut6fcaEbPQAP7Ka2XSG021dU+djj55KSrzEvrDD/auiyyv?= =?us-ascii?Q?7yW2z0cxkTHP1ZsNx00ElAtbKVfZwq9jZsssVyI5K/iQd69q0d8ICxH91irH?= =?us-ascii?Q?1XYWhf9jdvXec62INJOyW6uxsqSQBZCInQbvpD61pUdZcAaEBSr3YmRSeJqo?= =?us-ascii?Q?CHULB0oqmsHl03dhSZXOmh1JH0IA57PCY0g0SSKEOELtZo/WUVXxSJ8Tb/zT?= =?us-ascii?Q?PhI0PFR7RsB0ZzyBBsutTohidpeUY9LYtuWQqeC/?= X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: 11b9fca3-a9d6-45a7-1951-08da80a2d4c0 X-MS-Exchange-CrossTenant-AuthSource: MN2PR12MB4192.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Aug 2022 22:50:07.0337 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: mvxzPLGjxVk5GEVNFy8SspjuSfxtL2Kq5h6rdc0mPRC8tdZq50PZqQ4Pxo7RxQrL X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN8PR12MB3041 X-Spam-Status: No, score=-1.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FORGED_SPF_HELO, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_NONE, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Aug 17, 2022 at 01:35:12PM -0700, John Hubbard wrote: > How's this look to you: > > collected = collect_longterm_unpinnable_pages(&movable_page_list, > nr_pages, pages); > if (collected == 0) > return 0; > > ret = migrate_longterm_unpinnable_pages(&movable_page_list, nr_pages, > pages); > > /* If we got here, we have some unpinnable pages... */ > > if (ret == 0) { > /* > * ...and we successfully migrated those pages. Which means that > * the caller should retry the operation now. > */ > ret = -EAGAIN; return -EAGAIN > } > > return ret; But why return 0 from the helper function in the first place? Jason