From mboxrd@z Thu Jan 1 00:00:00 1970 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=-13.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS 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 0F11FC433DB for ; Wed, 3 Feb 2021 07:43:37 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 772C564E3E for ; Wed, 3 Feb 2021 07:43:36 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 772C564E3E 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 A85BB6B006E; Wed, 3 Feb 2021 02:43:35 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id A35796B0070; Wed, 3 Feb 2021 02:43:35 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9262D6B0071; Wed, 3 Feb 2021 02:43:35 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0070.hostedemail.com [216.40.44.70]) by kanga.kvack.org (Postfix) with ESMTP id 787D66B006E for ; Wed, 3 Feb 2021 02:43:35 -0500 (EST) Received: from smtpin16.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 3ECB2180AD81A for ; Wed, 3 Feb 2021 07:43:35 +0000 (UTC) X-FDA: 77776166790.16.night66_2a10142275d1 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin16.hostedemail.com (Postfix) with ESMTP id 15976100E6917 for ; Wed, 3 Feb 2021 07:43:35 +0000 (UTC) X-HE-Tag: night66_2a10142275d1 X-Filterd-Recvd-Size: 4809 Received: from mail-pj1-f51.google.com (mail-pj1-f51.google.com [209.85.216.51]) by imf49.hostedemail.com (Postfix) with ESMTP for ; Wed, 3 Feb 2021 07:43:34 +0000 (UTC) Received: by mail-pj1-f51.google.com with SMTP id e9so4071208pjj.0 for ; Tue, 02 Feb 2021 23:43:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=PLK0fXGTV/aZy60gi4sbWRXrm5oJCyOUmMAwYs2l3kc=; b=DWHoq4YfpZvfFPggnMRXa0ICoZ94Hca5DYROPg7sTO1jlkKDNNlf8LrmNXukorgM2h L8/XCU/tUoRbqvRMa3OwT9jVSdeEndAUkZCxXmks1TM5rM05BaHcDa073DhuvXkVREae ARdnnoIIIU4ykk6DaR/PGU/fq/qKYll2HWK7We7sIumbRpNOqk93QQ5s6+pnzct0rn9H 2y4SyZVcLXkpPi51NA9bqb7ygwGm1LXmqAddHulW2m4A0v95dMjb3KHGgPI4fv7iWVQZ FS/JazxwqUYvHkp+pFCQRoOJPDEPfFSW+qqFnbu0mXUtQHr0DIafJSs5ZTwQ6LGBz1Cv J+2g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=PLK0fXGTV/aZy60gi4sbWRXrm5oJCyOUmMAwYs2l3kc=; b=m/wCoDorLDE8ipCZhpYIMZiOAAdnIAE37KUmi1/5xoiU/phcvQ1Nx4a3gak3XQwFWX iCJjsaiOx6Q64Q7sdTQBIAJJ5XG78U9cIL3hfEOVJnurOfZNPygUbCHEPfar0sQTvveH xtsxUPyW3TJHU8LXqbO3HyfAonWdBzaRpzZiIInVIQOTNuhzClAu/nQSyDQwTqgKwdTN 62MnB1VuJ4Miz+XwOIyHOPymnDf7iqb6zwQ2O8i6HokiPbWdO038qPufwF6/+XtuKMz7 mL+bONfqR7b6bNT+vNnuC65d5KiV0w7m9rNEr5TZpj5TowRDQkmapDdSTGeK7LaKHNw0 Th/A== X-Gm-Message-State: AOAM532UjJhYf/3LjkeEB5mRrGXCJ6s1w97FzyusxKfV9Jmn6nYMTl/M ee0emhWuj3pZT06Is9ltLS/l4fiOh0+MzfpM+9ByHQ== X-Google-Smtp-Source: ABdhPJzWVaFIMz8/t6fWqkHg2driCh5/ifol7AZ9aj3rQdByOff7VRFs3n8EC750wIpZm23gngPk83gscPdA4v4clPE= X-Received: by 2002:a17:902:b7c7:b029:e1:6cbe:db19 with SMTP id v7-20020a170902b7c7b02900e16cbedb19mr2161965plz.20.1612338213170; Tue, 02 Feb 2021 23:43:33 -0800 (PST) MIME-Version: 1.0 References: <20210120013049.311822-1-mike.kravetz@oracle.com> <20210120013049.311822-3-mike.kravetz@oracle.com> In-Reply-To: <20210120013049.311822-3-mike.kravetz@oracle.com> From: Muchun Song Date: Wed, 3 Feb 2021 15:42:57 +0800 Message-ID: Subject: Re: [External] [PATCH v2 2/5] hugetlb: convert page_huge_active() HPageMigratable flag To: Mike Kravetz Cc: LKML , Linux Memory Management List , Michal Hocko , Naoya Horiguchi , David Hildenbrand , Oscar Salvador , Matthew Wilcox , Andrew Morton Content-Type: text/plain; charset="UTF-8" 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: On Wed, Jan 20, 2021 at 9:33 AM Mike Kravetz wrote: > > Use the new hugetlb page specific flag HPageMigratable to replace the > page_huge_active interfaces. By it's name, page_huge_active implied > that a huge page was on the active list. However, that is not really > what code checking the flag wanted to know. It really wanted to determine > if the huge page could be migrated. This happens when the page is actually > added the page cache and/or task page table. This is the reasoning behind > the name change. > > The VM_BUG_ON_PAGE() calls in the *_huge_active() interfaces are not > really necessary as we KNOW the page is a hugetlb page. Therefore, they > are removed. > > The routine page_huge_active checked for PageHeadHuge before testing the > active bit. This is unnecessary in the case where we hold a reference or > lock and know it is a hugetlb head page. page_huge_active is also called > without holding a reference or lock (scan_movable_pages), and can race with > code freeing the page. The extra check in page_huge_active shortened the > race window, but did not prevent the race. Offline code calling > scan_movable_pages already deals with these races, so removing the check > is acceptable. Add comment to racy code. > > Signed-off-by: Mike Kravetz Hi Mike, I found that you may forget to remove set_page_huge_active() from include/linux/hugetlb.h. diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h index 37fd248ce271..6f680cf0eee6 100644 --- a/include/linux/hugetlb.h +++ b/include/linux/hugetlb.h @@ -852,7 +852,7 @@ static inline void huge_ptep_modify_prot_commit(struct vm_area_struct *vma, } #endif -void set_page_huge_active(struct page *page); + Thanks.