From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BCF441CAA4 for ; Sat, 6 Dec 2025 19:53:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765050806; cv=none; b=AV4w4v9JWo7KWP2CNFGGhYfJMVgQGQd1gdaaTB3D/G5dFnN0bnhI8oQ/yR+YTOCIjY1oTfgbuxFHL0Ji5aN4oI27PaDz5uA1t3C/8wxtmwY+agMa5VWpvvSsExbGUcGcRbSLwfv2c2P4QJgRsa+MV7lfIMUXzwg74EEjR+kH0ug= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765050806; c=relaxed/simple; bh=NCc/R1bNVmzY0LJnU4UrFWR+uh0aAjEdIugQhYqdToM=; h=Message-ID:Subject:From:To:Cc:Date:In-Reply-To:References: Content-Type:MIME-Version; b=noWN4jXOhhRoyKRpo21Y6bME4LAlX5hX6z3loL+Ojct5baftIRBb5N2FmF97VayPl8ddaW8tyjhDD69UddBXVB+zfZD/t8WMle1plTN4i529OEkoH02plomumftdr6yQXznaen6jfRlfE3BPlqH4edYP1s5pf4OsU9KnAYY56R0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=JaSpxg/V; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b=mDVr8RhB; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="JaSpxg/V"; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b="mDVr8RhB" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1765050799; h=from:from: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; bh=qrpYMWO98nw/C1zuKpSbDBvFxM74soYI7+nWen4/2Ko=; b=JaSpxg/VIukJUT5VJzQ0TJ46c21U3q8ygt1+HtIfHHP5H3Io1FpR++hq8q19C4K2m+psfI e+OePDpRtCYXR8dd3wF/EyLvpGAtbI7tyvL/iZZLGFuQhUyTaNWq/cuOHSS0iIx6KVCxTX tBNKuex0MSEYv00+niPjKjojIW2Oiww= Received: from mail-pl1-f199.google.com (mail-pl1-f199.google.com [209.85.214.199]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-629-XxXGtUmmP8K3n3T1z6t0PA-1; Sat, 06 Dec 2025 14:53:18 -0500 X-MC-Unique: XxXGtUmmP8K3n3T1z6t0PA-1 X-Mimecast-MFC-AGG-ID: XxXGtUmmP8K3n3T1z6t0PA_1765050797 Received: by mail-pl1-f199.google.com with SMTP id d9443c01a7336-29845b18d1aso57270835ad.1 for ; Sat, 06 Dec 2025 11:53:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1765050797; x=1765655597; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:user-agent:references :in-reply-to:date:cc:to:from:subject:message-id:from:to:cc:subject :date:message-id:reply-to; bh=qrpYMWO98nw/C1zuKpSbDBvFxM74soYI7+nWen4/2Ko=; b=mDVr8RhBf/r1AYCdiAFmrCJElCEqcjVzGS5kUB64t8fEjYoeQWfhob5FFeTvzzCY0D oMVV8bZvoml0R1WoN99rTIzWddVYn45sKs3yGUofZAosn5CAoNyAi9uO+FvcHOUC/PfC kwbesfmIKkXDEwbqethiSZF2PnFeQv7qAcOXKdlAD7hocIXUMVm82DKRdmHcGC0oHkUl ZGarnMdKDM4c+y2Lv+4T5B8b9aHqvwOxCY6l6nDLqywF9xIK4yejlGVgUTCQY1wyDQWg 467IzUCkHRkcQP9cL+Q7ewVPHhxle4OFXx46J0Gar8SQv2lXeanWra/zr7ez+unEIiiT +jeg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1765050797; x=1765655597; h=content-transfer-encoding:mime-version:user-agent:references :in-reply-to:date:cc:to:from:subject:message-id:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=qrpYMWO98nw/C1zuKpSbDBvFxM74soYI7+nWen4/2Ko=; b=JrXjz4pGaETpp0VtytFbu12G1LVoAqgc2RYzAi0kK3+UzTx0PnCkdCD2AiywRzwpGL lEsfe8+42nxM8GwhzkHF0GKcS5isNpdEZA8bvyH9LXgNM36Vj3iS2Pees6dIQlUPBJMv 89lGst6Xr2dwid2GZWKhxgPEzYnviOrARymZtisaoHrOnCDU6DaoPKeFrONNemi6Z1TQ eQZCujSovR9I5PoB2MGRIizAbrfbM3l4otSndqkEIbEX7nfTCncIpuEoa46YtUBRz2T1 2Y9uNWQn6+tGjim7/f6ytwE/nEUj7Lc4iVAxY+uPqg9DdUsoGsDIltvJxmxSyijKfNI4 +waA== X-Forwarded-Encrypted: i=1; AJvYcCWxGyqS2nHtVZmq/EAZA3qH1FdFUsEHkZau/Bh4FtsSkdi//pqrAXm8W10Vh3vKPVjoM5Z3zn0piP28zpY=@vger.kernel.org X-Gm-Message-State: AOJu0Yw5aHyroZJpOEvXgF05GDH/Psz8SVyvNKJJ3DBL+PzK7kAobq7c jIcKam3tto4LZjZ87wxRz5eZq0Q7F3KAkpzAEr+hEh8YuJ3rWZ9hKbhLHVRb1dgW68myO9SczXN ShwrPXg2rUwp4JRT+kht3UJb8tSy5tyDVJJCmngLJWWudtEThv4A9x9aYqTBLBvZ5fA== X-Gm-Gg: ASbGncvnbfP4wXL+wNvdyyU9VIdKxaQ7GGDGWltjKfNKqRJqd8ofNOy3Fd3h6BqKiGo srccsm2vjoLTnZVBbyV53au4tKGiQ2It11CUXZTUIlxSPpbdFBEViE6j0edukvhKTqMM39sYYOY 8vpMugeOTHah73fvohs03JfGZqmcr6i3t4LZ5aOA7RzSOftnJLjTvwAkz/MuvTdpl+w+2J1s1Uj guWPEH+k/SNTe1cfXp2IKFWa4y3mAcFfPE7KtbGMtSIlW1zcUWXwGctk0oTeRs4ReOVmkqdxCDo JRjZhH6f38MPGiNMACjwjgNJgnQFyhgJ2Afbfq+hUQOh6Yj8mTjYP1CzeEEehRyvsLcgeCl+UQb nKvrHnSxfRTFKZsoBtrzkMZ1efsidN5rps1iLoxJGsPH9E3+rndFQPq8yDFgL00d20X+IccTxbb AWXN8= X-Received: by 2002:a05:7023:b01:b0:11b:d4a8:d24d with SMTP id a92af1059eb24-11e03260ecamr2282838c88.12.1765050796773; Sat, 06 Dec 2025 11:53:16 -0800 (PST) X-Google-Smtp-Source: AGHT+IH2aPGE6vYb1dltrITpg8eumtVfZJj4Id5GKymqQwmguys9MRcgGbHoYX1yIz3YPyGVGfbLsw== X-Received: by 2002:a05:7023:b01:b0:11b:d4a8:d24d with SMTP id a92af1059eb24-11e03260ecamr2282813c88.12.1765050796257; Sat, 06 Dec 2025 11:53:16 -0800 (PST) Received: from syn-2600-6c64-4e7f-603b-9b92-b2ac-3267-27e9.biz6.spectrum.com ([2600:6c64:4e7f:603b:9b92:b2ac:3267:27e9]) by smtp.gmail.com with ESMTPSA id a92af1059eb24-11df7703bd7sm35128784c88.10.2025.12.06.11.53.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 06 Dec 2025 11:53:15 -0800 (PST) Message-ID: <6640379f1ef7e9305b77d1e322b04d9534a3fff5.camel@redhat.com> Subject: Re: [PATCH v1 0/4] mm/hugetlb: fixes for PMD table sharing (incl. using mmu_gather) From: Laurence Oberman To: "David Hildenbrand (Red Hat)" , linux-kernel@vger.kernel.org Cc: linux-arch@vger.kernel.org, linux-mm@kvack.org, Will Deacon , "Aneesh Kumar K.V" , Andrew Morton , Nick Piggin , Peter Zijlstra , Arnd Bergmann , Muchun Song , Oscar Salvador , "Liam R. Howlett" , Lorenzo Stoakes , Vlastimil Babka , Jann Horn , Pedro Falcato , Rik van Riel , Harry Yoo , Prakash Sangappa , Nadav Amit Date: Sat, 06 Dec 2025 14:53:02 -0500 In-Reply-To: <20251205213558.2980480-1-david@kernel.org> References: <20251205213558.2980480-1-david@kernel.org> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.40.4 (3.40.4-11.el9_6.1) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit On Fri, 2025-12-05 at 22:35 +0100, David Hildenbrand (Red Hat) wrote: > One functional fix, one performance regression fix, and two related > comment fixes. > > I cleaned up my prototype I recently shared [1] for the performance > fix, > deferring most of the cleanups I had in the prototype to a later > point. > While doing that I identified the other things. > > The goal of this patch set is to be backported to stable trees > "fairly" > easily. At least patch #1 and #4. > > Patch #1 fixes hugetlb_pmd_shared() not detecting any sharing > Patch #2 + #3 are simple comment fixes that patch #4 interacts with. > Patch #4 is a fix for the reported performance regression due to > excessive > IPI broadcasts during fork()+exit(). > > The last patch is all about TLB flushes, IPIs and mmu_gather. > Read: complicated > > I added as much comments + description that I possibly could, and I > am > hoping for review from Jann. > > There are plenty of cleanups in the future to be had + one reasonable > optimization on x86. But that's all out of scope for this series. > > Compile tested on plenty of architectures. > > Runtime tested, with a focus on fixing the performance regression > using > the original reproducer [2] on x86. > > I'm still busy with more testing (making sure that my TLB flushing > changes > are good), but sending this out already so people can test and review > while I am soon heading for LPC. > > [1] > https://lore.kernel.org/all/8cab934d-4a56-44aa-b641-bfd7e23bd673@kernel.org/ > [2] > https://lore.kernel.org/all/8cab934d-4a56-44aa-b641-bfd7e23bd673@kernel.org/ > > Cc: Will Deacon > Cc: "Aneesh Kumar K.V" > Cc: Andrew Morton > Cc: Nick Piggin > Cc: Peter Zijlstra > Cc: Arnd Bergmann > Cc: Muchun Song > Cc: Oscar Salvador > Cc: "Liam R. Howlett" > Cc: Lorenzo Stoakes > Cc: Vlastimil Babka > Cc: Jann Horn > Cc: Pedro Falcato > Cc: Rik van Riel > Cc: Harry Yoo > Cc: Uschakow, Stanislav" > Cc: Laurence Oberman > Cc: Prakash Sangappa > Cc: Nadav Amit > > David Hildenbrand (Red Hat) (4): >   mm/hugetlb: fix hugetlb_pmd_shared() >   mm/hugetlb: fix two comments related to huge_pmd_unshare() >   mm/rmap: fix two comments related to huge_pmd_unshare() >   mm/hugetlb: fix excessive IPI broadcasts when unsharing PMD tables >     using mmu_gather > >  include/asm-generic/tlb.h |  69 +++++++++++++++++++- >  include/linux/hugetlb.h   |  21 ++++--- >  mm/hugetlb.c              | 129 ++++++++++++++++++++---------------- > -- >  mm/mmu_gather.c           |   6 ++ >  mm/mprotect.c             |   2 +- >  mm/rmap.c                 |  45 +++++++------ >  6 files changed, 178 insertions(+), 94 deletions(-) > For the Series passed generic testing with a focus on the CVE regression and looks good. Tested-by: Laurence Oberman