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=-17.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,NICE_REPLY_A, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 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 88FA5C433E0 for ; Mon, 4 Jan 2021 22:40:22 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 1700C22525 for ; Mon, 4 Jan 2021 22:40:21 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1700C22525 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=oracle.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 204C88D002D; Mon, 4 Jan 2021 17:40:21 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 18E988D0033; Mon, 4 Jan 2021 17:40:21 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 088508D002D; Mon, 4 Jan 2021 17:40:21 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0023.hostedemail.com [216.40.44.23]) by kanga.kvack.org (Postfix) with ESMTP id E2B588D002D for ; Mon, 4 Jan 2021 17:40:20 -0500 (EST) Received: from smtpin15.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id B1E40362A for ; Mon, 4 Jan 2021 22:40:20 +0000 (UTC) X-FDA: 77669562600.15.gun74_4d0fb63274d4 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin15.hostedemail.com (Postfix) with ESMTP id 8C6691814B0CA for ; Mon, 4 Jan 2021 22:40:20 +0000 (UTC) X-HE-Tag: gun74_4d0fb63274d4 X-Filterd-Recvd-Size: 5171 Received: from userp2130.oracle.com (userp2130.oracle.com [156.151.31.86]) by imf25.hostedemail.com (Postfix) with ESMTP for ; Mon, 4 Jan 2021 22:40:19 +0000 (UTC) Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 104MV3U4145356; Mon, 4 Jan 2021 22:40:11 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=subject : to : cc : references : from : message-id : date : mime-version : in-reply-to : content-type : content-transfer-encoding; s=corp-2020-01-29; bh=LixbOTy4EF+FNs39RrzUBWIvM+s7f+0XmxarmtWP29Q=; b=yjh+g0OSUpXwCRH2z563xoL/PwcarClS0Vz23CE7vnzhzNL4nb7AxfyRJKqXGx8q+69A t5WEq7wIjZaqxQcwWfkhQ2+HMDFQ/yO2Y64aCnpDTtejpAP7m2GpvfHe0aGoGZq4AC0s HjGq/KMx3dgxbD0L2NswSf4oG4WvIbZTKPBf2HR1mq3/dJ7yBNX824IU8rUwm2VB3qTR yPXZMfkmxBie4ZlIsm0PMxL53IcjGWJCuvQLiGSNboWhxvVoIuTNP2poUB1Iy6dtUdJZ O5mujCuXdA/4GHfht6zfwyXmB47MjX3QKBgv20FEDUxHmFbaA5OLNKTP7iynUPRDsYCX 9A== Received: from aserp3030.oracle.com (aserp3030.oracle.com [141.146.126.71]) by userp2130.oracle.com with ESMTP id 35tg8qxggx-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 04 Jan 2021 22:40:11 +0000 Received: from pps.filterd (aserp3030.oracle.com [127.0.0.1]) by aserp3030.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 104MXd5G031590; Mon, 4 Jan 2021 22:38:10 GMT Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by aserp3030.oracle.com with ESMTP id 35v4raq1ey-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 04 Jan 2021 22:38:10 +0000 Received: from abhmp0004.oracle.com (abhmp0004.oracle.com [141.146.116.10]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id 104Mc4BC013030; Mon, 4 Jan 2021 22:38:06 GMT Received: from [192.168.2.112] (/50.38.35.18) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 04 Jan 2021 14:38:04 -0800 Subject: Re: [PATCH 2/6] hugetlbfs: fix cannot migrate the fallocated HugeTLB page To: Muchun Song , akpm@linux-foundation.org Cc: hillf.zj@alibaba-inc.com, n-horiguchi@ah.jp.nec.com, ak@linux.intel.com, yongjun_wei@trendmicro.com.cn, mhocko@suse.cz, linux-mm@kvack.org, linux-kernel@vger.kernel.org References: <20210104065843.5658-1-songmuchun@bytedance.com> <20210104065843.5658-2-songmuchun@bytedance.com> From: Mike Kravetz Message-ID: <09be227a-4e16-1960-c8e9-609c35a80ef5@oracle.com> Date: Mon, 4 Jan 2021 14:38:03 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.1.1 MIME-Version: 1.0 In-Reply-To: <20210104065843.5658-2-songmuchun@bytedance.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9854 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 mlxscore=0 bulkscore=0 suspectscore=0 spamscore=0 adultscore=0 malwarescore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2101040134 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9854 signatures=668683 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 clxscore=1015 phishscore=0 bulkscore=0 spamscore=0 impostorscore=0 suspectscore=0 adultscore=0 mlxlogscore=999 mlxscore=0 malwarescore=0 lowpriorityscore=0 priorityscore=1501 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2101040134 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 1/3/21 10:58 PM, Muchun Song wrote: > Because we only can isolate a active page via isolate_huge_page() > and hugetlbfs_fallocate() forget to mark it as active, we cannot > isolate and migrate those pages. > > Fixes: 70c3547e36f5 (hugetlbfs: add hugetlbfs_fallocate()) > Signed-off-by: Muchun Song > --- > fs/hugetlbfs/inode.c | 5 +++-- > 1 file changed, 3 insertions(+), 2 deletions(-) Good catch. This is indeed an issue. > > diff --git a/fs/hugetlbfs/inode.c b/fs/hugetlbfs/inode.c > index b5c109703daa..2aceb085d202 100644 > --- a/fs/hugetlbfs/inode.c > +++ b/fs/hugetlbfs/inode.c > @@ -737,10 +737,11 @@ static long hugetlbfs_fallocate(struct file *file, int mode, loff_t offset, > > /* > * unlock_page because locked by add_to_page_cache() > - * page_put due to reference from alloc_huge_page() > + * put_page() (which is in the putback_active_hugepage()) > + * due to reference from alloc_huge_page() Thanks for fixing the comment. > */ > unlock_page(page); > - put_page(page); > + putback_active_hugepage(page); I'm curious why you used putback_active_hugepage() here instead of simply calling set_page_huge_active() before the put_page()? When the page was allocated, it was placed on the active list (alloc_huge_page). Therefore, the hugetlb_lock locking and list movement should not be necessary. -- Mike Kravetz > } > > if (!(mode & FALLOC_FL_KEEP_SIZE) && offset + len > inode->i_size) >