From mboxrd@z Thu Jan 1 00:00:00 1970 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 744084878D for ; Wed, 20 Dec 2023 19:59:51 +0000 (UTC) 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="nGclzkJI" 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=MOQBkuV64qGkpkL02M2q/zJVUfocblbpJ8/Q7Pg5Jnc=; b=nGclzkJI27pB0hdUSS5ouVV0ns O+02D269IBZ8f7WlDkCx6o7vRlP+AcWviiCSxE9Xn4rqSC7fubqVL0J6J8yG5tGrmbJ3/Entj/RgB xusZ7QrgCc32vwQkLV6HTKigjopb1NrrsKiTqUWMEj6Nf+C4zN67FkXhaIRiSK5jvbuAM8rgKUs3o +n1Ci83at1FkOal+kmoinH8t2A8APDD2M8TWwT6abZIKSIqNnwBdUseorZuM09PWH+CT/QsUsb5Zv 7rFdrklOtINI2fyQJ4jHkCXqYs5hWiSrk8gGFKfOyIpg2nCa3rPwY+O2goOf39CGNWUvDcaVEGbSd pYNwbF1w==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1rG2io-004Imu-0V; Wed, 20 Dec 2023 19:59:14 +0000 Date: Wed, 20 Dec 2023 19:59:13 +0000 From: Matthew Wilcox To: Ira Weiny Cc: "Fabio M. De Francesco" , Andrew Morton , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] mm/memory: Replace kmap() with kmap_local_page() Message-ID: References: <20231215084417.2002370-1-fabio.maria.de.francesco@linux.intel.com> <657fbdb5db945_126a129483@iweiny-mobl.notmuch> <4255260.irdbgypaU6@fdefranc-mobl3> <6583463e8de5c_30a94294fb@iweiny-mobl.notmuch> 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: <6583463e8de5c_30a94294fb@iweiny-mobl.notmuch> On Wed, Dec 20, 2023 at 11:53:34AM -0800, Ira Weiny wrote: > > My understanding of the current implementation is that unmap_and_put_page() > > calls folio_release_kmap(), taking as arguments the folio which the page > > belongs to and the kernel virtual address returned by kmap_local_page(). > > > > folio_release_kmap() calls kunmap_local() and then folio_put(). The last is > > called on the folio obtained by the unmap_and_put_page() wrapper and, if I'm > > not wrong, it releases refcounts on folios like put_page() does on pages. > > This is where my consternation came from. I saw the folio_put() and did > not realize that get_page() now calls folio_get(). That's not new. See 86d234cb0499 which changed get_page() to call folio_get(), but notice that it's doing the _exact same thing_ that get_page() used to do. And it's behaved this way since ddc58f27f9ee in 2016.