From patchwork Sun Jan 10 12:40:11 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Muchun Song X-Patchwork-Id: 12009089 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-11.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 639D9C433E0 for ; Sun, 10 Jan 2021 12:41:28 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id C91AB22ADF for ; Sun, 10 Jan 2021 12:41:27 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C91AB22ADF Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=bytedance.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id DFF728D0018; Sun, 10 Jan 2021 07:41:26 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id DAFEF8D0019; Sun, 10 Jan 2021 07:41:26 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id CA9F68D0018; Sun, 10 Jan 2021 07:41:26 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0001.hostedemail.com [216.40.44.1]) by kanga.kvack.org (Postfix) with ESMTP id B4BA88D0018 for ; Sun, 10 Jan 2021 07:41:26 -0500 (EST) Received: from smtpin11.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 7B41F824556B for ; Sun, 10 Jan 2021 12:41:26 +0000 (UTC) X-FDA: 77689826172.11.army36_3c0662d27504 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin11.hostedemail.com (Postfix) with ESMTP id 5FA07180F8B80 for ; Sun, 10 Jan 2021 12:41:26 +0000 (UTC) X-HE-Tag: army36_3c0662d27504 X-Filterd-Recvd-Size: 3988 Received: from mail-pg1-f175.google.com (mail-pg1-f175.google.com [209.85.215.175]) by imf05.hostedemail.com (Postfix) with ESMTP for ; Sun, 10 Jan 2021 12:41:25 +0000 (UTC) Received: by mail-pg1-f175.google.com with SMTP id c22so10756584pgg.13 for ; Sun, 10 Jan 2021 04:41:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=yGxCcrxh54+vPfh3fs1S1PZ/SzgrrSbJ2Q0Nc+3EuUs=; b=IwVBgHapflIcDSeNj0zPo8Tm7lwZLA+1MxcCqdhLHnwIPqvTQPW89aBzjSn39DUsW3 JiugI3PTNVmVygbTSordkL5/6NsQN0iIWqvpbUSsJ18pwLBeP83GTqwF5cUq6bgImBC4 N7yTJAGXF7l1DYxRyj6AEyVylPa/aE7pY40J9pp/WzyaVDHiQKChvzmv226Vm9OIzJVD zm1E/2hOKFb2LCJL3OiYms6NiO0RQ/luhF4iy9Pzs8AWcJb8td90eVnavX7bo4YoHyrH vfQnHpK8EMcPsX24pNwAbLgxM3w5Fh7IDfDw1s4DTMHgurGZmgT0xZWo/P6+EA1j83rh HlmA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=yGxCcrxh54+vPfh3fs1S1PZ/SzgrrSbJ2Q0Nc+3EuUs=; b=Q/oH4RV1EYasMq1sAUpVne0tEg+AplYBjwaxg1HG+RFM9V9gJupkvsJnYjfRdR36lt 6aj1Lem89Xn1TtAjwzqmVjukDjjnJHMu3LWJcq96kRhan1HmqcBSMLa5b8vZHiLXlnpX +odFsSQ5is9Wyv4U8z7viP8692M3b53ezPQXaOdr9IVY0dsWKJxIdB2IEcJU4tLHLpVJ +bQZBrSLHjYP5i9zwhIvmMEnlt476XTP1D9XeXrtuzNMigTe5oktEqNaDoGHkQIfdHYP x6KDYi0vFDdFV4w4TWQrbxZKsQKU4QLrjZzJXMRsIsRcb1zveXByonApAosOIZfmcRuI dVIw== X-Gm-Message-State: AOAM532fmut84oMtGh8ao0FGUxguzt4x2M4C3AxKnnGVnQhIOHkzJk/r pTBT7Xlzw/Tv4/kh5tM67f+3nA== X-Google-Smtp-Source: ABdhPJzJjWQkqBYxHgJ/to1raXIAPjeBoRyD7EwUD82uVDv3de0Gfek6s7XWrA0pqe6vgvcmfVHuCQ== X-Received: by 2002:a62:384b:0:b029:19d:a5c6:d76 with SMTP id f72-20020a62384b0000b029019da5c60d76mr12391113pfa.16.1610282484286; Sun, 10 Jan 2021 04:41:24 -0800 (PST) Received: from localhost.localdomain ([139.177.225.247]) by smtp.gmail.com with ESMTPSA id p9sm16176960pfq.136.2021.01.10.04.41.20 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 10 Jan 2021 04:41:23 -0800 (PST) From: Muchun Song To: mike.kravetz@oracle.com, akpm@linux-foundation.org Cc: n-horiguchi@ah.jp.nec.com, ak@linux.intel.com, mhocko@suse.cz, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Muchun Song Subject: [PATCH v3 0/6] Fix some bugs about HugeTLB code Date: Sun, 10 Jan 2021 20:40:11 +0800 Message-Id: <20210110124017.86750-1-songmuchun@bytedance.com> X-Mailer: git-send-email 2.21.0 (Apple Git-122) MIME-Version: 1.0 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 patch series aims to fix some bugs and add some improvements. Changelog since v2 -> v3: - Update commit log. - Using head[3].private to indicate the page is freed in patch #3. Changelog since v1 -> v2: - Export set_page_huge_active() in patch #2 to fix. - Using head[3].mapping to indicate the page is freed in patch #3. - Flush @free_hpage_work in patch #4. Muchun Song (6): mm: migrate: do not migrate HugeTLB page whose refcount is one mm: hugetlbfs: fix cannot migrate the fallocated HugeTLB page mm: hugetlb: fix a race between freeing and dissolving the page mm: hugetlb: add return -EAGAIN for dissolve_free_huge_page mm: hugetlb: fix a race between isolating and freeing page mm: hugetlb: remove VM_BUG_ON_PAGE from page_huge_active fs/hugetlbfs/inode.c | 3 ++- include/linux/hugetlb.h | 2 ++ mm/hugetlb.c | 59 +++++++++++++++++++++++++++++++++++++++++-------- mm/migrate.c | 6 +++++ 4 files changed, 60 insertions(+), 10 deletions(-)