From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pj1-f46.google.com (mail-pj1-f46.google.com [209.85.216.46]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4812131BCAE for ; Fri, 10 Jul 2026 03:03:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.46 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783652632; cv=none; b=uMeqkqYvtKvCh5a/6w1TG3uaWGTsIwtOcyVq8uRxzGjHkVFCVtmcnuaEEPWUIkmSkHNtSUSfmcJ06+i4/sULMhIfTFNWC6p+UqYqngiE66Tkf9tOV6jCWB7+lENG+2ORNEx56BrVPT7G3yIdFE4dSBnVrs3/6d8Co3G+ZrS0Z48= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783652632; c=relaxed/simple; bh=vplqpb0V0gmnbTgS5Z03vRulCrBLAYgvHpSoLCbvvKU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=XsQAgkF4JpGCE73x88froPYzkD3yJ0Jo9nrnsrqwzBCgiKLTmkI/UClLMfpH9XWdkHyznfOinR5V8Mk6TwfhAo+e1VvrgEE6ab91/sQV2WL5R3g+nYRkA9z63c17MuKfLjccTMrmcrwWkQRwG/bVTF84gZvKP31W4hrNu/bBe2o= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=KpDxlInP; arc=none smtp.client-ip=209.85.216.46 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="KpDxlInP" Received: by mail-pj1-f46.google.com with SMTP id 98e67ed59e1d1-3800f0907d5so107957a91.0 for ; Thu, 09 Jul 2026 20:03:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1783652630; x=1784257430; darn=vger.kernel.org; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to:content-type; bh=1ynSAhKjwAAjcKTYW0e4L0bg5A+RQVDw3lejJ8fmbfs=; b=KpDxlInPpxU0nCzrGM8SlUBPMSRcsu1vCSdXHK7il+UKAKwP4c4XLej661BRQQJoFV 2SmwospGuDH8iL9zudqD2+bzXj92wAAh5fvgebMb9ncBQe3QCoaHQd+ouEdglqC8Fzs5 yEracuZ43snUts6UhPqaXW3T6m/Hj6l6vKF9J3GiffXlI04SWl4cD7dnkoX7gdkjvJar aSYIrKKBWsgnd7inZrKB8l752eRkvk0q72ztj22AIF5HIY0GmPmh7xHBw59lYbz8OzUR VPtGgyDxvy5olsXDboGd7tsl7GEfwfC5MHFegLJWXHMGBwIFKV/a0Wdzldqt2WMaGQiv 2nEg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1783652630; x=1784257430; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=1ynSAhKjwAAjcKTYW0e4L0bg5A+RQVDw3lejJ8fmbfs=; b=NCkOvEQiWiCIQ79zFQi5fjkhYyPXuJ0tzGiKV4wHUV/Sc/c85W8lO3Q/0dOFaKaHPq SWbML0s93AIcVkwASUlwHyUXfyx5XQ4iLLh0xtCHZ4mjvd/PmYXvE2jwR8YqajzTbDfF Q5qhXXsGEU50ukB3PrcKxqVwgm9pF2oNiO3h73vhu+rR7UiNAmVdnzlo/cbFYAJE73yq CHyBcqFFJQCixmS/svEx0aed/Vtmrd4TF0bl5Gw6abhazxAV0iVnmiwY3VxVdSEQm7M6 bmBubsxPgwfbsaUT8118pLNXZvjlvjP5BmzCQoGVy4IvGr0L3vkDD1cq6C9HPztHnZPD w4pw== X-Forwarded-Encrypted: i=1; AHgh+RoToPZBQdSoCSUlTQKXhlAtepeN7rAoWDIdwgncCS7xRcpQnugrFeQsV7KM4FA0GjBFUGWU1vVAXSQUbv0=@vger.kernel.org X-Gm-Message-State: AOJu0Yz+aKiul0pV9sjjUmxpWEsypX1+DSMaEdWb0frUCAkRWEPpgp8r BvrxGaG5dhNiokLJKVNb9kDr0RKngdmRNfm4M6UT4JCysA7B2F4E2YQg X-Gm-Gg: AfdE7clkQSbB8LmVqGYoGfM4L+Rd7A98bWiPWkqtxq8Ozb8nZSBTKbgjKZeAoi4JtCj m3nWLsbgm0GlksrUtjca6l8bSmqrQpWuDgBZILs8bFy1B6c4FTHygU945rmidc1e2hJPFzvo01M 6dj3ZODyySJFjdRMhAJmLONeEsTNJqlPG0swsxFVopaATX5/p8EqMs1h1gooVi07SoYyXXxpX31 eOqRjEgSoutOkxa10GZdI9AVB/5GFWOBIDA8P8WPltbWkeLvjGZn1vmxW4JaabmkEITjDyrH+4G MmKkcYZrPvfpM2dHPPcFWv8PaXdF1ThDX6JoHXn1njtaw7UJxjDqyXT9kkTEJMTtFehxpsEMu/0 oTHAYL9t2Gwg8y1u5eFZJotCXRH8Fux72i+Mjro5MdW3Mdc1rGHxCM1ZcbM1v5mnP40Qzd9u1XZ /RJAHGov3VCoHV4IwvNsnKoN5it+JBENk4RxRsqzubtNXC+SrvyBfZmgU= X-Received: by 2002:a05:6a00:1804:b0:845:3ffb:ac1d with SMTP id d2e1a72fcca58-84842ee0509mr7628366b3a.2.1783652630328; Thu, 09 Jul 2026 20:03:50 -0700 (PDT) Received: from debian.lan ([240e:391:ea3:6910::1]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-847f6db29d1sm9594805b3a.53.2026.07.09.20.03.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Jul 2026 20:03:49 -0700 (PDT) From: Xueyuan Chen To: usama.arif@linux.dev Cc: xueyuan.chen21@gmail.com, akpm@linux-foundation.org, david@kernel.org, catalin.marinas@arm.com, will@kernel.org, tglx@kernel.org, mingo@redhat.com, bp@alien8.de, dave.hansen@linux.intel.com, x86@kernel.org, linux-mm@kvack.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, lance.yang@linux.dev, jannh@google.com, yang@os.amperecomputing.com, rppt@kernel.org, ljs@kernel.org, ziy@nvidia.com, baolin.wang@linux.alibaba.com, liam@infradead.org, npache@redhat.com, ryan.roberts@arm.com, dev.jain@arm.com, baohua@kernel.org, hpa@zytor.com, luto@kernel.org, peterz@infradead.org Subject: Re: [RFC PATCH v3 1/3] mm: make persistent huge zero folio read-only Date: Fri, 10 Jul 2026 11:03:41 +0800 Message-ID: <20260710030341.8527-1-xueyuan.chen21@gmail.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260707131714.3266156-1-usama.arif@linux.dev> References: <20260707131714.3266156-1-usama.arif@linux.dev> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On Tue, Jul 07, 2026 at 06:17:12AM -0700, Usama Arif wrote: Hi Usama, Sorry for the late reply. [...] >Can this really skip the TLB flush here? This runs from a >subsys_initcall, after smp_init() and after the folio was allocated and >zeroed through the writable direct map. The noflush helper updates the >direct-map PTEs but does not invalidate stale writable kernel TLB entries. > >I think we need a TLB flush here? I checked the code, and you are right. This runs after smp_init(), and the folio has already been allocated and zeroed through the writable direct map before changing the direct-map PTEs. So skipping the TLB flush is not safe. I will fix this in the next version. Thanks for catching this. Thanks, Xueyuan