From patchwork Wed Jan 6 08:47:33 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Muchun Song X-Patchwork-Id: 12001129 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 4A643C433E0 for ; Wed, 6 Jan 2021 08:49:43 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 5D9DD23107 for ; Wed, 6 Jan 2021 08:49:42 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5D9DD23107 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 B1F858D00F4; Wed, 6 Jan 2021 03:49:41 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id ACF8C8D0090; Wed, 6 Jan 2021 03:49:41 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9BE5C8D00F4; Wed, 6 Jan 2021 03:49:41 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0039.hostedemail.com [216.40.44.39]) by kanga.kvack.org (Postfix) with ESMTP id 854BF8D0090 for ; Wed, 6 Jan 2021 03:49:41 -0500 (EST) Received: from smtpin08.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 414D0824556B for ; Wed, 6 Jan 2021 08:49:41 +0000 (UTC) X-FDA: 77674726962.08.arch27_2f17fbf274e0 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin08.hostedemail.com (Postfix) with ESMTP id 326471819E76F for ; Wed, 6 Jan 2021 08:49:41 +0000 (UTC) X-HE-Tag: arch27_2f17fbf274e0 X-Filterd-Recvd-Size: 3856 Received: from mail-pl1-f171.google.com (mail-pl1-f171.google.com [209.85.214.171]) by imf06.hostedemail.com (Postfix) with ESMTP for ; Wed, 6 Jan 2021 08:49:40 +0000 (UTC) Received: by mail-pl1-f171.google.com with SMTP id 4so1220211plk.5 for ; Wed, 06 Jan 2021 00:49:40 -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=MJ7EXnrnjhy7+uYeV34kijGi9OXt4E2hNZBzDKNjCfU=; b=asObGoSIMPvAwU5SHqpDMotcGC0UjYsXRcsgmrKMTgKJ1dNK/O5ouxREgMZDHIDIyE TctjLAYpcLcS/+PctbvaJv5wJGj2ajWaEH9r5896EeRNTvdv68aT23SBy0yXSxvS/vVW HLgWpwELnYK0FnYyLMZ71ET0u0m5UiqcWNeITKd5BeqLfOuJTm4HZ2HyxVl7NQkNSXeT PqZ7opAzPZiFmjvsXW4nRxQdsiajL5Q5A0jiy2W53M3laLFVyvzUR4b3XJHgGrPrZHhb qDr5HL+X8TZd8PDjmsng90OzUQ6bX9cNEM7x/vwQ/nblg/dJqFtgrI33Az7Ou36+3lWM R+HQ== 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=MJ7EXnrnjhy7+uYeV34kijGi9OXt4E2hNZBzDKNjCfU=; b=I1tN8XZ15K6hMCnKQ0j8O4WLryb9dWHj6nnUTj7FlIm32v9D89/T0BhZuLCMkj0GYu rfOXblZs2r2p03/ClNtL0q1PhKXxZCApusaXSsNbMya4RFkErh5oh+XuAL6xOFDsjOow MRCVIE8z6fIhAIFSVAXDa1pCbYaWZFstDbOBpEcVgqZnziqOLhFkgAqYycDiyorVLVf6 icSnSsoIFY1x841nsqgoQt10pLxHyXyU8iNbk7NyxYMjjXHKhceHmMuqOEuH862pqfKz x2JmoT1rDFJzBXDQ92X9cZnAJhKbqm8nD34q3FgaDoHN7UMQZ8/c32iOcwLuM2TFHY7p aIJA== X-Gm-Message-State: AOAM533cZjn2e+gZoPnW2x1nE8KD+uJWRPM5ajSAwXAvxgSXVaR/zZbx Qp9+TxqSaxZHLF5a635byMkdWQ== X-Google-Smtp-Source: ABdhPJyPVD0EI/kuz45CeSBqtJJ2E0++1zedCl9qsb+hROtQBU2JorcSzunxBILZ7c4GNzUPeDM9Fg== X-Received: by 2002:a17:902:b943:b029:dc:6bd:5562 with SMTP id h3-20020a170902b943b02900dc06bd5562mr3563335pls.59.1609922979261; Wed, 06 Jan 2021 00:49:39 -0800 (PST) Received: from localhost.localdomain ([139.177.225.232]) by smtp.gmail.com with ESMTPSA id h8sm1851806pjc.2.2021.01.06.00.49.35 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 06 Jan 2021 00:49:38 -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 v2 0/6] Fix some bugs about HugeTLB code Date: Wed, 6 Jan 2021 16:47:33 +0800 Message-Id: <20210106084739.63318-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 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 | 69 +++++++++++++++++++++++++++++++++++++++++++------ mm/migrate.c | 6 +++++ 4 files changed, 71 insertions(+), 9 deletions(-)