Received: by 2002:ab2:7903:0:b0:1fb:b500:807b with SMTP id a3csp1097480lqj; Mon, 3 Jun 2024 10:01:49 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUm1etRYzsfd1tr66jU5WYtrwMcEFvtJbgibDkrnREO9k2CbNnGcUxN6DzZamfdYruVs7bc7PdAWePA0l0paQx2ZvRI9s04oqs536q7iw== X-Google-Smtp-Source: AGHT+IH5X1tWbwVfSzgoQiElzq8A7YgG6+Emt7Zy25QkZGhpTzFDQ0unBglI3cwcFf8PVMJLLg4N X-Received: by 2002:a05:6808:159f:b0:3c9:5e56:b01e with SMTP id 5614622812f47-3d1e35c140amr11764330b6e.40.1717434108899; Mon, 03 Jun 2024 10:01:48 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717434108; cv=pass; d=google.com; s=arc-20160816; b=cmFpxjrugk5V4OtyheM3ZAr3UNChtGV3lw+xsCRqXv9PI0c10jJNnGMQl6A/+cn6nz rH6feSrf3qJSbIspIk6S3VkcvKrHAkyvlsd8cL9GIK95cvKk5osLbw4wYwVFhcUc9sEz UXw41S7Bm6NYYHyFeae2ahpg59+X2Cp53ZzC+hNdCMTM5+DCYXBt0p4UaS+kHP24pPql 7wn0y3q5mqgRkW/N1pXSrogMYUpNNPSFm0qwsxP3Cj6RyC+sJ6WptQ73mBO9g5g5w7gS 0V7eDSZ4MbBgW8a8ow4xXStmjXbxvLDknGidjgvx3L3PBm5xzJyHTPDR/S6ERGc9jKFV yQnQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=rDTYr+MFhpo5KNC+O8/PJeMg4wx4hxlcpkT6/y8CQQs=; fh=bt4wLi67bcY75i4nIwmKwrxcz4najzKUTJPm9gP+1qE=; b=qmlrle+SeFxs//zXVIOfKtTOj9OftWXYb/14+6qwPhHvKu7tFI8FONKyY8A0k7EbiE M/1mmHaEUsMzzqCyGZAYNw5vm9k/y9y33uHzVmirMt6fHp99xB++TZmkjUkAcwEZQHmM l/aMGyyE/OcROAAoziDYu+SSo5vH1hNSKkNWdgtL+KDtqZRRCu5TjBUyOXGVGvVfgHZr 5Ea5Aa2SMN2GIWxLqcfp5PaLGt8T2AdahHwyf2vRhRKrHf1Lxk0JIOquDQASXLATFwNC Mj+gJucSUHbxTMCLfSXZGUuwDqeOHjdz9j+3K8FuFVmcuOfgon2N46SJrOvT3C9QxFgJ CyTQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=kyo71aHP; arc=pass (i=1 dkim=pass dkdomain=infradead.org); spf=pass (google.com: domain of linux-kernel+bounces-199476-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-199476-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id 71dfb90a1353d-4eafee3ada9si1544065e0c.144.2024.06.03.10.01.48 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Jun 2024 10:01:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-199476-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=kyo71aHP; arc=pass (i=1 dkim=pass dkdomain=infradead.org); spf=pass (google.com: domain of linux-kernel+bounces-199476-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-199476-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 5C9141C21BF8 for ; Mon, 3 Jun 2024 17:01:46 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9E33213776F; Mon, 3 Jun 2024 17:01:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="kyo71aHP" Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) (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 43933136E2B for ; Mon, 3 Jun 2024 17:01:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=90.155.50.34 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717434084; cv=none; b=GvfzGmAEK2c3zYSQ0o0sukTaB3SDRnVjoovCBm1Tt/sxf9Iw//4gnozEsYh+ULwvWhJ9+AOw3m0pFg6JDFwwhth+M9fVJn8wdP0Yg23SEuyE/+rd630kV5kzV6hjFiTeMw1nq7kFkMWPA2fPSr3REChyUdSXaIxS746qDN8ETUc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717434084; c=relaxed/simple; bh=dtegb95Yoog4s+bRLFOy72NiUIfsUaciwClLxjmqRgM=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=dubTIrEZzXvEeUjndpHSOmMtEXZYCa1QOxo9+9sycj3CGDcrkqUesJMUZExBt+l7FrHk7sXwXR0YHYJ3ZWkYm1Aw4XuHsE49u2Hl099p3DhpAaT9V5mvNlGd3nGNcYXfU0jhyGN5ANngv/sDMRlLxabLLFb69MfmfO+PiFvNQeM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org; spf=none smtp.mailfrom=infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=kyo71aHP; arc=none smtp.client-ip=90.155.50.34 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=rDTYr+MFhpo5KNC+O8/PJeMg4wx4hxlcpkT6/y8CQQs=; b=kyo71aHPY610RKZP6dlylIxAYy jrp8EIUgFOmXADj0oF/je4gZUA4b8TganmG9mGr0KaGPP+E6jTig1vSXaqtm/iYHHqLpILrft7YqF zwbkXfdwGiHBvmMv7teqhb5rAhx3l8rNWdkJq4yLrD1zQbwg30VP9J2fK1nazgWWSLx24xECykJ4C k6JWCYjdOW8GPinarGRA9775xRpQmSH8jNIHpT7ZkMxZdIQMgrVuWPbZ0WzrMCWyuUi/bs/U0zUFh +O40txmnK2SISB89RL9PdeTD0oIfCk1Wne4LzrD45nhaE4O2CMVikk+VC5V7BNI4FbqvkRQJwJ/w2 nAJVHkBw==; Received: from willy by casper.infradead.org with local (Exim 4.97.1 #2 (Red Hat Linux)) id 1sEB3R-0000000EEkG-1cMp; Mon, 03 Jun 2024 17:01:05 +0000 Date: Mon, 3 Jun 2024 18:01:05 +0100 From: Matthew Wilcox To: Dave Hansen Cc: David Hildenbrand , Byungchul Park , Byungchul Park , linux-kernel@vger.kernel.org, linux-mm@kvack.org, kernel_team@skhynix.com, akpm@linux-foundation.org, ying.huang@intel.com, vernhao@tencent.com, mgorman@techsingularity.net, hughd@google.com, peterz@infradead.org, luto@kernel.org, tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, dave.hansen@linux.intel.com, rjgolo@gmail.com Subject: Re: [PATCH v11 09/12] mm: implement LUF(Lazy Unmap Flush) defering tlb flush when folios get unmapped Message-ID: References: <20240531092001.30428-1-byungchul@sk.com> <20240531092001.30428-10-byungchul@sk.com> <26dc4594-430b-483c-a26c-7e68bade74b0@redhat.com> <20240603093505.GA12549@system.software.com> <35866f91-7d96-462a-aa0a-ac8a6b8cbcf8@redhat.com> <196481bb-b86d-4959-b69b-21fda4daae77@intel.com> 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=us-ascii Content-Disposition: inline In-Reply-To: <196481bb-b86d-4959-b69b-21fda4daae77@intel.com> On Mon, Jun 03, 2024 at 09:37:46AM -0700, Dave Hansen wrote: > Yeah, we'd need some equivalent of a PTE marker, but for the page cache. > Presumably some xa_value() that means a reader has to go do a > luf_flush() before going any farther. I can allocate one for that. We've got something like 1000 currently unused values which can't be mistaken for anything else. > That would actually have a chance at fixing two issues: One where a new > page cache insertion is attempted. The other where someone goes to look > in the page cache and takes some action _because_ it is empty (I think > NFS is doing some of this for file locks). > > LUF is also pretty fundamentally built on the idea that files can't > change without LUF being aware. That model seems to work decently for > normal old filesystems on normal old local block devices. I'm worried > about NFS, and I don't know how seriously folks take FUSE, but it > obviously can't work well for FUSE. I'm more concerned with: - page goes back to buddy - page is allocated to slab - application reads through stale TLB entry and sees kernel memory Or did that scenario get resolved?