Message ID | 20210113052209.75531-6-songmuchun@bytedance.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show
Return-Path: <SRS0=ytkm=GQ=kvack.org=owner-linux-mm@kernel.org> 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=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,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 BAA0EC433E0 for <linux-mm@archiver.kernel.org>; Wed, 13 Jan 2021 05:25:55 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 3B1D822B37 for <linux-mm@archiver.kernel.org>; Wed, 13 Jan 2021 05:25:55 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3B1D822B37 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 BF43D8D0012; Wed, 13 Jan 2021 00:25:54 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id BA41E8D0007; Wed, 13 Jan 2021 00:25:54 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id ABBAD8D0012; Wed, 13 Jan 2021 00:25:54 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0143.hostedemail.com [216.40.44.143]) by kanga.kvack.org (Postfix) with ESMTP id 958B38D0007 for <linux-mm@kvack.org>; Wed, 13 Jan 2021 00:25:54 -0500 (EST) Received: from smtpin02.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 5FF3C180AD81F for <linux-mm@kvack.org>; Wed, 13 Jan 2021 05:25:54 +0000 (UTC) X-FDA: 77699615028.02.soup93_4d15a672751b Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin02.hostedemail.com (Postfix) with ESMTP id 486FC10097AA0 for <linux-mm@kvack.org>; Wed, 13 Jan 2021 05:25:54 +0000 (UTC) X-HE-Tag: soup93_4d15a672751b X-Filterd-Recvd-Size: 5119 Received: from mail-pg1-f182.google.com (mail-pg1-f182.google.com [209.85.215.182]) by imf23.hostedemail.com (Postfix) with ESMTP for <linux-mm@kvack.org>; Wed, 13 Jan 2021 05:25:53 +0000 (UTC) Received: by mail-pg1-f182.google.com with SMTP id n7so779727pgg.2 for <linux-mm@kvack.org>; Tue, 12 Jan 2021 21:25:53 -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:in-reply-to:references :mime-version:content-transfer-encoding; bh=7IILliy6HAELOAf2o6Y4OfnqFvSJBzlwsRQjJedxot0=; b=dJSU9wJz/3rQWPdMgFSeLg9iISXgA+mrG+M6gt+bsIjssGtFTfPEsERPEUS/5t83/a LUUhWWNg/MtzqsN1Kcpq3X30J5yof6IfmScrbd2duBHq6YKTHipysgbq0GgU5xk6pS2e zjsxPKhbFQ3aQpWwXgTAKahmN+gYTipJrmzzMWPn1qre9ExAnmti5MKJc035HZOxbRYj iHy8ulllb0ZqY2Um8SLjP+3fu+8cZOBSSgRpFiASO+QylIjnslUNIoap6l6hYXze4wgD w4WSsWwgioG3c1Cy6a1OJW3JNITIUff9+LHkCpsmdjVxblAQrvZnTkHGQvdlc1TgFK6d 1KbA== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=7IILliy6HAELOAf2o6Y4OfnqFvSJBzlwsRQjJedxot0=; b=QcJkFuPNrhMNiLT4JhmJyOLpjXYV7GS4ocMR9xo/gc3lnPVWw74q20ZTHE//vXGIlT k8eiOQbZXtA9j0odckIIfqBN4O/sDjvvusL5Js8G+lXtyN5Vri9CjhwwpyCGLri6yBEZ GuB65AtUpMVfNdlkQAIjWCWASTTWPlsGDxQyfY9SFpujWxCi02Erg5WTfGg1df4U81kY l1ttsyH7PDq/SaZrkHVGIjjQy+qkdjFzqT6qH69g2cKkvrwIhST5yodC9rxHCADBtVMZ 5+LKEUVZ4tNLXjHUYoIXKb+iuEmyLAsfRKRPwqzF4Qwo3fiSxSzeo0F3Khc1uR/jXFyb PLwA== X-Gm-Message-State: AOAM533nTR1ix2kx5NURSCjf/hDnP2QxCBG3uf4kQ5qmUokz7ZD8ZS/D 6lQmCaYqrmnYfMwFIxIXFd6G4A== X-Google-Smtp-Source: ABdhPJyzBXCuQ9SD6Bb7oZ1eb4Ev3kY+H2KEd84rW3RSKql2lLp9DD8eqP0VXQA4l2FJ/CVALwQ2ZQ== X-Received: by 2002:a63:1110:: with SMTP id g16mr459913pgl.357.1610515552956; Tue, 12 Jan 2021 21:25:52 -0800 (PST) Received: from localhost.localdomain ([139.177.225.247]) by smtp.gmail.com with ESMTPSA id x15sm893081pfa.80.2021.01.12.21.25.48 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 12 Jan 2021 21:25:52 -0800 (PST) From: Muchun Song <songmuchun@bytedance.com> 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 <songmuchun@bytedance.com>, Michal Hocko <mhocko@suse.com>, stable@vger.kernel.org Subject: [PATCH v4 5/6] mm: hugetlb: fix a race between isolating and freeing page Date: Wed, 13 Jan 2021 13:22:08 +0800 Message-Id: <20210113052209.75531-6-songmuchun@bytedance.com> X-Mailer: git-send-email 2.21.0 (Apple Git-122) In-Reply-To: <20210113052209.75531-1-songmuchun@bytedance.com> References: <20210113052209.75531-1-songmuchun@bytedance.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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: <linux-mm.kvack.org> |
Series |
Fix some bugs about HugeTLB code
|
expand
|
diff --git a/mm/hugetlb.c b/mm/hugetlb.c index 898e4ea43e13..a7ed22811672 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c @@ -5575,9 +5575,9 @@ bool isolate_huge_page(struct page *page, struct list_head *list) { bool ret = true; - VM_BUG_ON_PAGE(!PageHead(page), page); spin_lock(&hugetlb_lock); - if (!page_huge_active(page) || !get_page_unless_zero(page)) { + if (!PageHeadHuge(page) || !page_huge_active(page) || + !get_page_unless_zero(page)) { ret = false; goto unlock; }