From patchwork Wed Jan 13 05:22:03 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Muchun Song X-Patchwork-Id: 12015793 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 4B7E3C433E0 for ; Wed, 13 Jan 2021 05:25:36 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 8662722B37 for ; Wed, 13 Jan 2021 05:25:35 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8662722B37 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 EB48E6B00B7; Wed, 13 Jan 2021 00:25:34 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id E8B8A8D000F; Wed, 13 Jan 2021 00:25:34 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id DA2648D0007; Wed, 13 Jan 2021 00:25:34 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0127.hostedemail.com [216.40.44.127]) by kanga.kvack.org (Postfix) with ESMTP id BD0AA6B00B7 for ; Wed, 13 Jan 2021 00:25:34 -0500 (EST) Received: from smtpin14.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 737AE181AEF30 for ; Wed, 13 Jan 2021 05:25:34 +0000 (UTC) X-FDA: 77699614188.14.earth60_6303f182751b Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin14.hostedemail.com (Postfix) with ESMTP id 5753418229818 for ; Wed, 13 Jan 2021 05:25:34 +0000 (UTC) X-HE-Tag: earth60_6303f182751b X-Filterd-Recvd-Size: 4170 Received: from mail-pj1-f46.google.com (mail-pj1-f46.google.com [209.85.216.46]) by imf40.hostedemail.com (Postfix) with ESMTP for ; Wed, 13 Jan 2021 05:25:33 +0000 (UTC) Received: by mail-pj1-f46.google.com with SMTP id md11so418936pjb.0 for ; Tue, 12 Jan 2021 21:25:31 -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=29017Imny4RA8XIngcwyWbDxuQg3R7iFq2JrClv6FPA=; b=yX8sYo9koIVE87mJ3FG0kE3DJ5zS6yvPRy/U8SvXbVFMnmZxagOx5v5sSXwpIapsV+ 6zx9C5A/ZKFkJxuMn6aSw5VOUITqR3DCpmqll5TfsxcuHOiV7Kar292ldyukcagoS5o+ AdGQE5u5JklYexs5UeSjPu9XwAxnDWanKk69PTudk1WMvTgFEToZXWbdUNNsEZ8pQFug 2Can8kKF1meFVkCoFuHMWeXZy9DLfEOpHiukDHGZa9gqBdDxKInBGIphzxjilIJiPIes zTuFpOkwkR8f51LJbodlD3LkHzmLYOXzTXEcQa4k98RzEGuRe4JKMfNWL93EkmAumszr roJQ== 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=29017Imny4RA8XIngcwyWbDxuQg3R7iFq2JrClv6FPA=; b=P73L0zZHh5o7UIsosf4IPIhevJPDA5XcpJa0ZZF2M0UUkd9Vx3ZsHxXiHdPLz0xbf/ wgAV9Mor8phI1wWeZh+Pnh576mDgM0URZIu6Bo+ei2XI0rniJ3gdv6wp5u1MkhGzgJib 6/FZ8l/+S27JrCwacETE+TAxrXSK5Re9rQPdWNDoWxb16EqOUNOGtODBiDd2MzQvkag4 dsICCqqgbhjNMxpBoSXZFcueVmMSIYQbOPbAAfr4pNtQ653fS8SrLP1/6GiB2da2P7NM 3udu14nL6GtNEdJGfPN2wgggt8ygjEEBolW6VUV12VSjQf1C3KbQKOEU61gNhLtvrq4Z KZnw== X-Gm-Message-State: AOAM53043N+Pk2w1ngHiLmgFmUhCH9iVpw9JYAp7fBs/561s5+CVn2HT KXm3JhXykbSWQlH+O/I//rhRkA== X-Google-Smtp-Source: ABdhPJwJaESneQy7ApflfsmLCgfFSITQRI5+f/UZqAUKxWrcmkwEqYzTxt6uigIszmNJdfa8B+WWeA== X-Received: by 2002:a17:902:7592:b029:dc:3c87:1c63 with SMTP id j18-20020a1709027592b02900dc3c871c63mr389854pll.47.1610515531113; Tue, 12 Jan 2021 21:25:31 -0800 (PST) Received: from localhost.localdomain ([139.177.225.247]) by smtp.gmail.com with ESMTPSA id x15sm893081pfa.80.2021.01.12.21.25.26 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 12 Jan 2021 21:25:30 -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 v4 0/6] Fix some bugs about HugeTLB code Date: Wed, 13 Jan 2021 13:22:03 +0800 Message-Id: <20210113052209.75531-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 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 (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: retry dissolve page when hitting race 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 | 51 ++++++++++++++++++++++++++++++++++++++++++++----- mm/migrate.c | 6 ++++++ 4 files changed, 56 insertions(+), 6 deletions(-)