Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp2017652pxp; Fri, 18 Mar 2022 00:48:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx/Wmkbq//qi+4W1dLCMwRH26AxF1lRR8WivLnAagl6wgXOz2ZaC8XFADe89/GVnSDE8kIy X-Received: by 2002:a17:906:a4b:b0:6d0:fbdd:7cb5 with SMTP id x11-20020a1709060a4b00b006d0fbdd7cb5mr7892896ejf.152.1647589684819; Fri, 18 Mar 2022 00:48:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647589684; cv=none; d=google.com; s=arc-20160816; b=gaRwsxFwbhom8iieMphVw66tG+yWSwxwfmgOR+Bf/fGf0ILyo9lbszVx2fPB2iBmvf m8BxNjSwT5sApsUgKGUnnK2y1Gjy5hDzLb2mGcqvTWkAb6geYyB4R38k7t4WW1XTl7Ew pCItYR6QPN3RTXEZrPNgtIDmyV4dewrtLrfbr/+cXRO/4PA2Q+p9QtmUuq8MF+1zsa1p QkMOj7vcSKNARQKbl3Qz2KlEsFjdLVfHidQ98VW9TGOBkMPk3905Z2w1uiyFq45PjCw0 Xy2xzM85j3IdBwGNZWe5C53nP/teZwrMVInsoTQoBM5YvpZgNJngTr3JJbFNqgcq/hco 9APg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=9b/KRxUeKJdr9tBjx3GZecOKR9c6gmbiKalwI9udBpo=; b=rtqwa5Mve0qS3fV3uDVJu5QXvdD6EaCKugopnXgfTY94hajRhiSn68+LD4neCL3GvX mN4ukBJyvvO8+bCOfGSHuirZ8yNTsCyN2hKWGo+LEGuBy4l5qtsr+3wDVOXkyHMl3sfA ygERc7RaMBT0c45tFcjhDuhfQjMflcJCUR3q4uQW03+8T6nvojwZuAUZPDof8kzM5xdH Xu9zoPt2lwg318QE3kg3h6u4vgv1LrAi9Vm3eqpnbPUckUNOekqHWJeiGvddtceknjap j1hhs2uDgsxfO/28t0EMf/r7XsnYAS6dKHAxuokpyBuYRTKyeFagFB1TAC+kpKrZiMsx v94g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bytedance-com.20210112.gappssmtp.com header.s=20210112 header.b=0BZnH5Vm; 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=fail (p=NONE sp=NONE dis=NONE) header.from=bytedance.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v2-20020a50d582000000b00418c2b5bd42si3262979edi.36.2022.03.18.00.47.39; Fri, 18 Mar 2022 00:48:04 -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=@bytedance-com.20210112.gappssmtp.com header.s=20210112 header.b=0BZnH5Vm; 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=fail (p=NONE sp=NONE dis=NONE) header.from=bytedance.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232795AbiCRHCx (ORCPT + 99 others); Fri, 18 Mar 2022 03:02:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38440 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229943AbiCRHCv (ORCPT ); Fri, 18 Mar 2022 03:02:51 -0400 Received: from mail-yb1-xb31.google.com (mail-yb1-xb31.google.com [IPv6:2607:f8b0:4864:20::b31]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3595725CBB9 for ; Fri, 18 Mar 2022 00:01:33 -0700 (PDT) Received: by mail-yb1-xb31.google.com with SMTP id f38so14344907ybi.3 for ; Fri, 18 Mar 2022 00:01:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance-com.20210112.gappssmtp.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=9b/KRxUeKJdr9tBjx3GZecOKR9c6gmbiKalwI9udBpo=; b=0BZnH5Vm/s0PNxUpyB9nyOVytbFTh0wVLkEgEkhIW6R1QA5OSApfh7dtnd1Pnc0I1b VUyn/7uuT6QrHv7qoCRkluAM8/SQXmSM5+CWwKPEKapkaYJZLNaLtfO6d9S12MN1o6Nz JfYZ/Aga+bNgb5aOseYnbo5yDjPljX21nfgV/dhaByhGCBWBEebvvtQHliNJfl/p+wqp AItD4tO9BGdk9anftCzypvwdPEN+rCgIURH1C3O09KNZlUfISSo5R6re80PB7dLkO0BN +0KDblWDOJQ5vVuyXFXoAvUcEL+JiOnYodk7GflTHYoCOphXRDe9FhZ2J8SRuZGbRnB0 6Spg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=9b/KRxUeKJdr9tBjx3GZecOKR9c6gmbiKalwI9udBpo=; b=IgmlHu7lCDEWnDPftg6NDM5lVM3XBJqA7kSzToX4N1oqazk1IuV/64wttvGIbGhGGC AKCMAIvQa7zE3l1co3E+DcYLZGGpx2sklprY81VcRPuNqSJR8gN4iXpdthf4BbODoawp ACz9k3UwIQbLR+UJ0/A7wgmPJDhTKmILQtkieysGCacESv8fWRa8ud61hH7p+WpKzAqK G6lnzebCiusZvwvZGurcRhk2SgVXrF89QgTYJW9zsi4zZ5O/fCEDU49fmdpHgY+KGY1f +cXTH4ZcvIXThNMomkGKqh3k1IaVhOxxlhOgpEmKDJHIymLZIMDwFZtfdhX7tjiYKaOI JBHg== X-Gm-Message-State: AOAM531XXNIrt903wlOHZbRFiUoUuPDgltZ76ptDp1qCHhhoi999ckMi xA6jRCztN0kTUitiktN9IrhbVlAIUemz7hUEpv5X9CKqm3HYmg== X-Received: by 2002:a25:3d47:0:b0:624:7b42:9f0f with SMTP id k68-20020a253d47000000b006247b429f0fmr8984898yba.254.1647586892489; Fri, 18 Mar 2022 00:01:32 -0700 (PDT) MIME-Version: 1.0 References: <20220318111709.60311-1-linmiaohe@huawei.com> <20220318111709.60311-12-linmiaohe@huawei.com> In-Reply-To: <20220318111709.60311-12-linmiaohe@huawei.com> From: Muchun Song Date: Fri, 18 Mar 2022 14:59:40 +0800 Message-ID: Subject: Re: [PATCH v2 11/11] mm/migration: fix possible do_pages_stat_array racing with memory offline To: Miaohe Lin Cc: Andrew Morton , Zi Yan , baolin.wang@linux.alibaba.com, Huang Ying , Alistair Popple , Linux Memory Management List , LKML Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE autolearn=ham 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 Thu, Mar 17, 2022 at 10:42 PM Miaohe Lin wrote: > > When follow_page peeks a page, the page could be migrated and then be > offlined while it's still being used by the do_pages_stat_array(). > Use FOLL_GET to hold the page refcnt to fix this potential race. > > Signed-off-by: Miaohe Lin Reviewed-by: Muchun Song