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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4E8ABC4332F for ; Sat, 17 Dec 2022 01:59:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229894AbiLQB74 (ORCPT ); Fri, 16 Dec 2022 20:59:56 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37564 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230004AbiLQB7q (ORCPT ); Fri, 16 Dec 2022 20:59:46 -0500 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7FC37BCA4 for ; Fri, 16 Dec 2022 17:59:45 -0800 (PST) Received: from canpemm500002.china.huawei.com (unknown [172.30.72.55]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4NYpzT0hg9zJqS4; Sat, 17 Dec 2022 09:58:45 +0800 (CST) Received: from [10.174.151.185] (10.174.151.185) by canpemm500002.china.huawei.com (7.192.104.244) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Sat, 17 Dec 2022 09:59:41 +0800 Subject: Re: [PATCH 1/2] hugetlb: really allocate vma lock for all sharable vmas To: Mike Kravetz , , CC: Muchun Song , David Hildenbrand , Peter Xu , Naoya Horiguchi , "Aneesh Kumar K . V" , James Houghton , Mina Almasry , Andrew Morton References: <20221212235042.178355-1-mike.kravetz@oracle.com> From: Miaohe Lin Message-ID: Date: Sat, 17 Dec 2022 09:59:40 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.6.0 MIME-Version: 1.0 In-Reply-To: <20221212235042.178355-1-mike.kravetz@oracle.com> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.174.151.185] X-ClientProxiedBy: dggems701-chm.china.huawei.com (10.3.19.178) To canpemm500002.china.huawei.com (7.192.104.244) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2022/12/13 7:50, Mike Kravetz wrote: > Commit bbff39cc6cbc ("hugetlb: allocate vma lock for all sharable vmas") > removed the pmd sharable checks in the vma lock helper routines. > However, it left the functional version of helper routines behind #ifdef > CONFIG_ARCH_WANT_HUGE_PMD_SHARE. Therefore, the vma lock is not being Oh, we missed !CONFIG_ARCH_WANT_HUGE_PMD_SHARE case in the previous review. :( > used for sharable vmas on architectures that do not support pmd sharing. > On these architectures, a potential fault/truncation race is exposed > that could leave pages in a hugetlb file past i_size until the file is > removed. > > Move the functional vma lock helpers outside the ifdef, and remove the > non-functional stubs. Since the vma lock is not just for pmd sharing, > rename the routine __vma_shareable_flags_pmd. > > Fixes: bbff39cc6cbc ("hugetlb: allocate vma lock for all sharable vmas") > Signed-off-by: Mike Kravetz Thanks for fixing. This patch looks good to me. Thanks. Reviewed-by: Miaohe Lin Thanks, Miaohe Lin