From patchwork Thu Jan 14 10:35:10 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Muchun Song X-Patchwork-Id: 12019187 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 AD1DEC433E0 for ; Thu, 14 Jan 2021 10:38:28 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 037B423A50 for ; Thu, 14 Jan 2021 10:38:27 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 037B423A50 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 1C9748D00CE; Thu, 14 Jan 2021 05:38:27 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 17A688D008E; Thu, 14 Jan 2021 05:38:27 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 01A178D00CE; Thu, 14 Jan 2021 05:38:26 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0250.hostedemail.com [216.40.44.250]) by kanga.kvack.org (Postfix) with ESMTP id DCD6D8D008E for ; Thu, 14 Jan 2021 05:38:26 -0500 (EST) Received: from smtpin07.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 9EA1A824C741 for ; Thu, 14 Jan 2021 10:38:26 +0000 (UTC) X-FDA: 77704031412.07.loaf52_3f0beee27526 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin07.hostedemail.com (Postfix) with ESMTP id 80D241803F9B0 for ; Thu, 14 Jan 2021 10:38:26 +0000 (UTC) X-HE-Tag: loaf52_3f0beee27526 X-Filterd-Recvd-Size: 4239 Received: from mail-pl1-f179.google.com (mail-pl1-f179.google.com [209.85.214.179]) by imf48.hostedemail.com (Postfix) with ESMTP for ; Thu, 14 Jan 2021 10:38:25 +0000 (UTC) Received: by mail-pl1-f179.google.com with SMTP id be12so2706623plb.4 for ; Thu, 14 Jan 2021 02:38: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=QrOmhB7i9+qkZva086G38OQVxrszXWzF+P/Di/GDiCE=; b=L410lzPHvZaCyW4bsco326t4nOEdvJLl5jouDYXX71Q/wyRaQ6Em0pVPCRu/d2j5x+ vS7Kz09FAKCZZglke1R9bqbjTDDHXe5BYJus31D+5vSjKkyYVGRF4ax5eIBm0+fLYsfJ vo5FnjUSpzVfUZp7qCSfYGgjp8i/e+sL0JNyi3aH/JrEk8Y11oqvV3Se8ZiMO74phNa2 HLZtwhfsgYcfYvTe3RafSLm58e9yi6Jm7HqLkDygeKozkTv23NkFVwHYmrUEDaF+oo+U ob2AovK3ncshwm+d0OzXsFJrxtlg2cYraSxSR3th5X04n+RfcrnoFehU/1cAgO2EqRUa KdEQ== 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=QrOmhB7i9+qkZva086G38OQVxrszXWzF+P/Di/GDiCE=; b=OtlGuDUFg8igwZLRAbKaVpbyBBrc6/pvXj9ZC+QEKbQclR4PZQY6ZAYwBzsUSeUFdZ dn80bsmpS3bajXA4sak41UeIGvVvxGvHe+YNXOj9ha9HPZcYp/cViCh7qZCtdXAltJEE 9dFohBoNv0ISCsQE/8mbleUfxIMAlapUf+vW2PxCO8WHIioWBvBvISC3YmlxXvPbvNo9 GcjlD8ZXmWbaoWcGmAswglqfUXEJmc+0YUtWRMCmIhNAxxa6VgWVVTNtV+qeCyzx6376 i+uQgzStZ/jyGR+bQqFextQ5oW6TymEiAUTXBW7zHPfKuhGp5hr2KB89hFPuGi+z/AxH eVEQ== X-Gm-Message-State: AOAM5315PVAX4caVYE2pqGxAL8WVmCNrl9FHHeiM83/yopnHMIWkyegW B9KRO8TurmjgV0YI981FPCVryQ== X-Google-Smtp-Source: ABdhPJxR+p09qkrkTFcEQjlE3vqR/ZNUisEOOfH/zoSyoCUeCFjBe5tqJE8JFlCq9MbnJuKJsp8CAA== X-Received: by 2002:a17:90a:4b0a:: with SMTP id g10mr4318834pjh.78.1610620704710; Thu, 14 Jan 2021 02:38:24 -0800 (PST) Received: from localhost.localdomain ([139.177.225.247]) by smtp.gmail.com with ESMTPSA id l12sm4970112pjq.7.2021.01.14.02.38.19 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 14 Jan 2021 02:38: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 v5 0/5] Fix some bugs about HugeTLB code Date: Thu, 14 Jan 2021 18:35:10 +0800 Message-Id: <20210114103515.12955-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 v4 -> v5: - Squash "mm: hugetlb: retry dissolve page when hitting race" to "mm: hugetlb: fix a race between freeing and dissolving the page" Changelog since v3 -> v4: - Update commit log of patch #1. - Drop "mm: hugetlb: add return -EAGAIN for dissolve_free_huge_page" - Add "mm: hugetlb: retry dissolve page when hitting race" 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 (5): 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: 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 | 50 ++++++++++++++++++++++++++++++++++++++++++++----- mm/migrate.c | 6 ++++++ 4 files changed, 55 insertions(+), 6 deletions(-)