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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1B174C71135 for ; Mon, 16 Jun 2025 03:21:52 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 857B46B0088; Sun, 15 Jun 2025 23:21:52 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 82F756B0089; Sun, 15 Jun 2025 23:21:52 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 76D0E6B008A; Sun, 15 Jun 2025 23:21:52 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 65AB16B0088 for ; Sun, 15 Jun 2025 23:21:52 -0400 (EDT) Received: from smtpin11.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 0F74156139 for ; Mon, 16 Jun 2025 03:21:52 +0000 (UTC) X-FDA: 83559814464.11.C8E4355 Received: from fanzine2.igalia.com (fanzine2.igalia.com [213.97.179.56]) by imf11.hostedemail.com (Postfix) with ESMTP id 0F10040006 for ; Mon, 16 Jun 2025 03:21:49 +0000 (UTC) Authentication-Results: imf11.hostedemail.com; dkim=pass header.d=igalia.com header.s=20170329 header.b=Ega9clBs; spf=pass (imf11.hostedemail.com: domain of gavinguo@igalia.com designates 213.97.179.56 as permitted sender) smtp.mailfrom=gavinguo@igalia.com; dmarc=pass (policy=none) header.from=igalia.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1750044110; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=I0U5A7FJgi12973WypMGIo03+bwAPexjAJ02BZ8i1PI=; b=L4rGwXs6Yzrt7X7XKwvKI0082aaST7fqaYLnCfw3J7SrRB8vWcgzLB8ZhWta4/5o6QBP+O FdrWciV2ZzWRrpZOOVeyjCM75Vn5YLWx3vmG2E1U5F028/vs9AsA6uGCE4Sw1aAgK8GiWs EqWv55kQOERMmKSJtqgqSW3vT3BMo10= ARC-Authentication-Results: i=1; imf11.hostedemail.com; dkim=pass header.d=igalia.com header.s=20170329 header.b=Ega9clBs; spf=pass (imf11.hostedemail.com: domain of gavinguo@igalia.com designates 213.97.179.56 as permitted sender) smtp.mailfrom=gavinguo@igalia.com; dmarc=pass (policy=none) header.from=igalia.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1750044110; a=rsa-sha256; cv=none; b=P/pFsDWV1DOzIStCzElG/8qYvAnsnITOvmvqN9Ka+VLZn0x/lUO0uzWv5LDaObdCo+rKNj jUVPT5KfjglVwwiKup2WAZZn70aG5YTzPy0OLrTpfkpBIGy9y5mQtLlIzhE+rN6TJCwfNG 7o8cCq+BxwhDrx01E03uEuv67KGv7N0= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=igalia.com; s=20170329; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From: References:Cc:To:Subject:MIME-Version:Date:Message-ID:Sender:Reply-To: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=I0U5A7FJgi12973WypMGIo03+bwAPexjAJ02BZ8i1PI=; b=Ega9clBsN8p/W9NzQsiJRfmQ68 Wbse4MO+epmyekIhlzuMoqF4lvHZm0RrMNwgEKCJeBWK8BchxZjARZnH0acG1vq2MoR0C+fbmuQb1 aM5299ayxrng8Ln526B0faCJ/N1MmVg2S057AEsim6MXPKJxBrxrCPPkcfhlnm/Pw/fdLyHLmZSP2 1cqKjMCAKyQ6W9OW0KNGRMgabTTraJvBAZpDS8IZzZJaAp35OATxnzFZQkjFxMIYoZz04knSNyZJJ qmplvNNioXk0swbV8YyOFFPowsDcCs+UxdT7Z0VEt66P3PzmEiBzr9rDTA7dmAOweVeHrDTx4dZji OPg6yjAg==; Received: from 106-64-96-84.adsl.fetnet.net ([106.64.96.84] helo=[192.168.238.43]) by fanzine2.igalia.com with esmtpsa (Cipher TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_128_GCM:128) (Exim) id 1uR0Pf-003wEg-1e; Mon, 16 Jun 2025 05:21:35 +0200 Message-ID: Date: Mon, 16 Jun 2025 11:21:26 +0800 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [RFC PATCH 0/3] Clean up locking in hugetlb faulting code To: Oscar Salvador , Andrew Morton Cc: Muchun Song , David Hildenbrand , James Houghton , Peter Xu , linux-mm@kvack.org, linux-kernel@vger.kernel.org References: <20250602141610.173698-1-osalvador@suse.de> Content-Language: en-US From: Gavin Guo In-Reply-To: <20250602141610.173698-1-osalvador@suse.de> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 0F10040006 X-Rspamd-Server: rspam03 X-Rspam-User: X-Stat-Signature: 1du489cd13sfmjm3yjkij7yfgrh87cqf X-HE-Tag: 1750044109-915574 X-HE-Meta: U2FsdGVkX19kxb2+dyqTTe2aBIULaFHDrd5utf+z5gNEEDqtmfZ9CIHQX9Yu32eBaG+ZtyJCHcrhCEA4AXBepRRl3wj7/jch52qH1225VvIFhSEZTgLDd4vgW+rRTmAUjfdchy0Cb99XaSt8zDtSuRyW56NHTyKyP667VrYyZBfxxvhshhCzeGlDiPPgFzoSsBpF5sCZJQgGr8i8o3t7+UeSUfjbRuGJnVZyqeKTk/5tBPueNZg02C8qsVowJExPY7JBzS1OD1fUF9hSWZ1MD9/vsfQ6diWlsPc0iP78J8w9hjpF5G7yjPQmjwWDqw2b/hjChJDb9OQ0uVLrtLnIlJr7TzrwxriM+Hv7kVy7BhzbvXScdpNkczWnpQnkteU1JOa+xWmqSAKKO1H2jae/QY/c/8ThPDBvdsTiIfTmu6QrQvf5QexVHG1njcwtVE/t5Pyecf/3W5Ldeu1e3jJYhGyuLykmlfh5zEVgmQoVGQ9LLu/kE1KjjHEI3UUv/leAODlrDpTm3+8DPvG5aJwWMFEyNCDnQXzMbR5P8l7u9r979QxEkONddZFTGQ7QQeVaPMsCNDdiPc46dSpwlYVmcZx3915viAgUs6O57TMrHDAZBBAUWpmY4Bb843JgNmfOVH4AAN9xj+FdhdF/2vcMttxFD04CiGLwl4Nig0fI3gTcxkYzNtNvB44kO70VHNR3JzDJTjZX6CetbfeRS5ZxXqLMH7VinrYDIQHdxz417lPyMN+QC0UErggXU9ymL/KaoJ57todiXE5ovs5QNSlm9sNPunOmd/v/QkHW2KQKidzslBqPHxueF+zzIvOudvOdtYCA0YTZvdJHAutTBvNIbUHYjmSTfkkhuaP13mLh0GT8M7BJqSP6s+nfn5v7XrVgD3UDbsTV6wzOU1Z1W9oi29bJKGWSwQ/jF6sLOKauRpZKJs/67s2NYQ== 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: List-Subscribe: List-Unsubscribe: Hi Oscar, On 6/2/25 22:16, Oscar Salvador wrote: > Hi all, > > This RFC is the culmination of the discussion that happened in [1]. > TLDR: No one really knew what the locks were protecting us against, and > whether we needed them at all. > > Some reasearch showed that most of them were introduced in a time were > truncation was not serialized with the mutex, as it is today, so we were > relying on the lock for the page to not go away from the pagecache. > More details can be find in patch#1. > > This is for the locks, but I also started to look at the references > we take in hugetlb_fault and hugetlb_wp as it seems to me we are taking > more than actually needed, but that is once we manage to sort this out. > > I ran hugetlb LTP tests and nothing screamed, and I also plan to run selftests > later on. > > @Galvin. Could you please run your syzkaller with this patchset applied and > see whether you can trigger something? Sorry for the late response. My capacity is limited in the last two weeks of joining an event and didn't notice the talk. And it seems already huge discussions and good progress. Currently, I saw the discussion is in another latest thread: https://lore.kernel.org/linux-mm/20250612134701.377855-1-osalvador@suse.de/ Please let me know if the testing is still useful. > > Special thanks to David and Peter Xu that were helping out with this mess. > > [1] https://lore.kernel.org/linux-mm/aDeBUXCRLRZobHq0@localhost.localdomain/T/#md02880ebc2c679678b7f326c5e9e93992428e124 > > Oscar Salvador (3): > mm, hugetlb: Clean up locking in hugetlb_fault and hugetlb_wp > mm, hugetlb: Update comments in hugetlb_fault > mm, hugetlb: Drop unlikelys from hugetlb_fault > > include/linux/hugetlb.h | 12 +++++ > mm/hugetlb.c | 117 +++++++++++++++++----------------------- > 2 files changed, 62 insertions(+), 67 deletions(-)