Received: by 2002:ab2:7903:0:b0:1fb:b500:807b with SMTP id a3csp1297473lqj; Mon, 3 Jun 2024 17:35:07 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCW5zV28vxAwEJcnbJbulKo695qsPXdtM9eeTPlSBIqXCBu4+/dOg1MYAxDdao24kw1i2XpGPpjSGhTX3rdyg3m+3NPGRcVDhHNi359VYg== X-Google-Smtp-Source: AGHT+IGc91eqPPB8GYy/RMNrFlildTB+fSaCXYHZvTl//h7p0EdqMLOF2yjRGHq7thLQ1nTxNr8p X-Received: by 2002:a81:ad56:0:b0:61b:3356:d16d with SMTP id 00721157ae682-62c796bfb3bmr103652807b3.19.1717461307685; Mon, 03 Jun 2024 17:35:07 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717461307; cv=pass; d=google.com; s=arc-20160816; b=ODMal6E8jMp9sSsEdK8B5Lmv2Lt6iAelEmV6ytghNKO8Bpc+cTBm8iGVaMBNqBISGs b6HzbMK0aGICnHmpsolhoQnFJL+UdQ4+OqRTZtdTZ/z96BgAK86MK6FnDjTPfSYF9EQJ ywhC7+fALDhP1uzt9okQAyDwbotqj0hyQjNFlGnwTo+kK0ZOVGIImKSCYeZW2/kxFzMI c8yCGC3AOQsX2mXMkAvZnMjZFaKnCShUkxnpitD2MVHFlKyGjRywh2FOpWPdE0NsBUh0 KXr92I6M+h2ru2Sw27YWmEjlfPNkhIkmfCRhgkgJXhvEWlv5yu2rxJ2ljYPr6tJ4l4x+ FP5A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=user-agent:in-reply-to:content-disposition:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:references :message-id:subject:cc:to:from:date; bh=+09OLEHpKXo0I8gpVukRW9jd4lot+G4PP99A3Na/HOM=; fh=LsxBNLk9ugbhvx6aMNy9W037+ghkAR5kOZYqMvvQXlE=; b=n5xLz6GP/qgZaYDTdpPfchIx7vSYa0sGtZLv+z424QjrpRszoXzrPQdysow7f4LqHN G78fKriO+99PrUYkc+o14FtAkNvlu8F8n9NEag2Zq9iagztcZ7aIM+UXqePy/K8jDse1 4C3rcLz1MOUmDXVX6rdz6nJs2Pc4fZRVJog6TpcZiyx3rnbtu7mDIrLZHx1dLnaydeyh b2z9bZWsqeQamEQyQC+JlJJsO7UZAKfVR6WJOQuISm/8jYARqDNI2u/dzuYieutGg/FP UOGfNldCqX6DR2CXqHHr5O+rpeiKad8IMyrjtGJlpraW8ogDS4P3s4J0GIHMvkpBbs51 aMeQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=sk.com); spf=pass (google.com: domain of linux-kernel+bounces-199873-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-199873-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 6a1803df08f44-6ae4b41507dsi86286626d6.388.2024.06.03.17.35.07 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Jun 2024 17:35:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-199873-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; arc=pass (i=1 spf=pass spfdomain=sk.com); spf=pass (google.com: domain of linux-kernel+bounces-199873-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-199873-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 6B1471C22347 for ; Tue, 4 Jun 2024 00:35:07 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 24CDA4C6E; Tue, 4 Jun 2024 00:35:01 +0000 (UTC) Received: from invmail4.hynix.com (exvmail4.skhynix.com [166.125.252.92]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5E76C7FD for ; Tue, 4 Jun 2024 00:34:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=166.125.252.92 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717461300; cv=none; b=ej4v85y2JPnPBdw0HaWJKnC7Nfaf2Hmnk8F+5NQkx/TR4zxVzc+RjlpNaP6+JiL9wLv9q9ucd8wQ/ddwGW5UEfa3tUhA0WnTxhD5QFgteoJDT6KmvC1JoCcASx7W6nLWkodIPHTFybYhAQ8v0i1C6VyLzQZPPEmAtSLvIdgVnjM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717461300; c=relaxed/simple; bh=9eESyfqJ/yGAFl06BInHcQIvHy8hfok4asczlxc7ycA=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=ZjOn7mh1UK1NA4uqTG4DnVCJkv2sXp/fPtftFhHY3Ggj0cv8iAlhqncAu5ZQYowUrc+uUp1aeM+ezuimAfgcP9H9aYzeWhsAb0Npg4D1S+MkDGhwTEc619Speype/vbYpFJabJoNDrQ2yKfasPYQUqmY7FUE9GOGr7fJ58v2Cb0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=sk.com; spf=pass smtp.mailfrom=sk.com; arc=none smtp.client-ip=166.125.252.92 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=sk.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=sk.com X-AuditID: a67dfc5b-d6dff70000001748-ca-665e612dbd5d Date: Tue, 4 Jun 2024 09:34:48 +0900 From: Byungchul Park To: Matthew Wilcox Cc: Dave Hansen , David Hildenbrand , 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: <20240604003448.GA26609@system.software.com> References: <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: User-Agent: Mutt/1.9.4 (2018-02-28) X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrGIsWRmVeSWpSXmKPExsXC9ZZnka5uYlyawZunShZz1q9hs/i84R+b xaeXDxgtXmxoZ7T4uv4Xs8XTT30sFpd3zWGzuLfmP6vF0c5NzBbnd61ltdixdB+TxaUDC5gs jvceYLKYf+8zm8XmTVOZLY5Pmcpo8fsHUMfJWZNZHIQ8vrf2sXjsnHWX3WPBplKPzSu0PBbv ecnksWlVJ5vHpk+T2D3enTvH7nFixm8Wj3knAz3e77vK5rH1l51H49RrbB6fN8kF8EVx2aSk 5mSWpRbp2yVwZZyb3c5c0Mhd8fDtJ6YGxoMcXYycHBICJhIf181ghrH7f+xnArFZBFQklq99 yAhiswmoS9y48ROohoNDREBD4s0WI5A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TPQuhewMi8ilEkM68sNzEzx1SvODujMi+zQi85P3cTIzDSltX+ mbiD8ctl90OMAhyMSjy8Fitj04RYE8uKK3MPMUpwMCuJ8PbVRacJ8aYkVlalFuXHF5XmpBYf YpTmYFES5/UKT00QEkhPLEnNTk0tSC2CyTJxcEo1MO6dpnV7YmW8o/KaM+tWvvZWPBQY5zJF UXTdr4Rrd8+xzw021AhcYnWv6F2t2DXTQFfla0veMZpeVbDVcb4xOX2v3tcTwh65tas/JB+R FKuqyxVxErddYlLc2vVxwuLC2TMSYv/J2vrp2YRnCax5J6rRa/K84b2eWdDtaX8+v4iK/rbj b8TDViWW4oxEQy3mouJEABoY+eiwAgAA X-CFilter-Loop: Reflected On Mon, Jun 03, 2024 at 06:01:05PM +0100, Matthew Wilcox wrote: > 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 At this point, tlb flush needed will be performed in prep_new_page(). > - application reads through stale TLB entry and sees kernel memory No worry for this case. Byungchul > > Or did that scenario get resolved?