Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp518325pxp; Sat, 19 Mar 2022 08:42:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy0ALZMbCd+KH3LFoZTT3g+l8JnGbIHbmsNt64k1JXRzNpRup16K1lPNssW4y07CKaq3oCh X-Received: by 2002:a62:e215:0:b0:4fa:87f1:dc16 with SMTP id a21-20020a62e215000000b004fa87f1dc16mr1683399pfi.19.1647704578121; Sat, 19 Mar 2022 08:42:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647704578; cv=none; d=google.com; s=arc-20160816; b=mS/QrVNA+TM5tr/MSBRH65mBLuqiaHFDmHAR4T3m99LehSxfT0FkAGm8y5FfvUNHL+ ydVZeH5SdhrLcfj/V0kbL2RCDsncN2DNJJg69p7rELHB4h5JW5k9BxSQELA1bMZIJBd0 uXLf9Mqv3VxCD4BAOToAD60ethuahAGZFz4F2tH64iRmP/z/m2lXAfUOAgVwWEXRJ1Pb yMFaalGPdOJ4mhwO22arR5h8n4+FmO3k8Ba9JR+Du/HIa+0iNYyBVFmUjaQVqigjIUKL 55IstuC1JwkIalWrHP5SxA+bSglFWkbyoY1QUbO8EOUOAY7CShe5M9xNrVU39VJH8Wyo J0eQ== 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=mBzdXH14sNTPS2biTeLVHAwNzH4AqH+YPPgAMnqAjy0=; b=Wv5rq3XyUqNUJ1lUce5jJfZ25Fzj8UbbYO49Obpx/13Mm4Nadw/lg1CqZG8r5QCxdA Apfy3tPm0PrQq2wbTGz0TrCL6LQt402mqqJIRW6AADS8FEeMtQpct1ziVEy7e5smoMNK hNhkFSs5nlxCcQnc0BaF4A/wnNUF7oifl2HaA+CQ1UndwuDDkkskm3m2tSc1M0FoAonD gBWPVLgtAVT6bl7M8MrWUfFpcsz2U3XL4oJyhkkh2HREM9fbbkVQ84MEoN6v9Q9R+cew n5dUTFZm4T3HMVgjaV6dDv0jIFW1JqCoh47vs0h8UXxooOIe971H8Y0UraakVRRhIoge I1iA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bytedance-com.20210112.gappssmtp.com header.s=20210112 header.b=gfoHkNQo; 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 p17-20020a170902ead100b00151f8f6cce5si5269618pld.3.2022.03.19.08.42.35; Sat, 19 Mar 2022 08:42:58 -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=gfoHkNQo; 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 S233794AbiCRI2c (ORCPT + 99 others); Fri, 18 Mar 2022 04:28:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38220 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233804AbiCRI2A (ORCPT ); Fri, 18 Mar 2022 04:28:00 -0400 Received: from mail-yw1-x1131.google.com (mail-yw1-x1131.google.com [IPv6:2607:f8b0:4864:20::1131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A79FB184620 for ; Fri, 18 Mar 2022 01:26:40 -0700 (PDT) Received: by mail-yw1-x1131.google.com with SMTP id 00721157ae682-2e5827a76f4so83753617b3.6 for ; Fri, 18 Mar 2022 01:26:40 -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=mBzdXH14sNTPS2biTeLVHAwNzH4AqH+YPPgAMnqAjy0=; b=gfoHkNQokHiSsL2oyZtVNFLI08STGD0lbZbe6YWRufgZZMTC/O+wtNbAuCmIbc/QmB 4DCWDvVb34zUpe28mt/yzyPAY6tGPL00CrkXdaeF0F7vSKOuvCxAm4XcqF/0+6qJ3pB+ csA78xcZh55zs9blxkIUT3fmIehVjaoclX3tragC0NPhCh50XtBHmaVyO/+H/a6+JORd f84wp6I/1SoFQ7Qn34WYPJa7XeXwBaXuNempw9xqyRol4dht95wwNzdJWOeOljlWfd0F GsVaV9UntWm2N/9FYNjiFSm9ASDGaCGh8uTKmPU6eEAi0fpAAUaVmOg6wjiYIav60elj qEfw== 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=mBzdXH14sNTPS2biTeLVHAwNzH4AqH+YPPgAMnqAjy0=; b=KBqzKrVz7AX1t/EHd+IgBFxyUZTiaRNhXL+dX4X7zGhh+HupFxZaR3pYutKrioGd4J KCfC8Ovho9QPWod59H9kVbblLqKCXCmd0qmZjjfvYSvjzSWmQ28w8J1uAKNpLQdBQhXD GQlLDh5sh/kGGpLEm96zgiXeRcynotamaI1AdfzbHhbyAoDuzNVp6Lj9yd11OX09PclF fNOHqrWr3ntHDLZ1RbVTeWR6DYuwrt+gQl5zj5IW5GaGeR4ndoSDFJVO3WCgdlyKLyAz D13OMjE1xNkmGcvw4foRhxR6OOkrasXCbSjC+y0VZvLfMrfkb0CP+7HIjePVV9tluA4m mSew== X-Gm-Message-State: AOAM5330wTnzllGMDKWKFYjK+mkVWZ/TQTIzlDhKYNb8MFpGl5Ks0s6Y 4vtRQlMAWrG08ZzUlpJLymGD9YZoMMyMvHyAZ+SlOg== X-Received: by 2002:a81:1c4f:0:b0:2e5:9db3:7a8e with SMTP id c76-20020a811c4f000000b002e59db37a8emr9412053ywc.319.1647591999889; Fri, 18 Mar 2022 01:26:39 -0700 (PDT) MIME-Version: 1.0 References: <20220318111709.60311-1-linmiaohe@huawei.com> <20220318111709.60311-10-linmiaohe@huawei.com> In-Reply-To: <20220318111709.60311-10-linmiaohe@huawei.com> From: Muchun Song Date: Fri, 18 Mar 2022 16:24:48 +0800 Message-ID: Subject: Re: [PATCH v2 09/11] mm/migration: fix potential page refcounts leak in migrate_pages 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:41 PM Miaohe Lin wrote: > > In -ENOMEM case, there might be some subpages of fail-to-migrate THPs > left in thp_split_pages list. We should move them back to migration > list so that they could be put back to the right list by the caller > otherwise the page refcnt will be leaked here. Also adjust nr_failed > and nr_thp_failed accordingly to make vm events account more accurate. > > Fixes: b5bade978e9b ("mm: migrate: fix the return value of migrate_pages()") > Signed-off-by: Miaohe Lin > Reviewed-by: Zi Yan > Reviewed-by: "Huang, Ying" > Reviewed-by: Baolin Wang Reviewed-by: Muchun Song