Received: by 2002:a05:7412:d024:b0:f9:90c9:de9f with SMTP id bd36csp278282rdb; Wed, 20 Dec 2023 12:00:00 -0800 (PST) X-Google-Smtp-Source: AGHT+IGrdp9xjwe3zT7mW+TBE92A2i8A34PYDT8WXLzXhqf6ozNDALzZynp07qyOW3bxmUIoovxp X-Received: by 2002:a05:6808:3192:b0:3ba:a70:cc with SMTP id cd18-20020a056808319200b003ba0a7000ccmr25927036oib.31.1703102400369; Wed, 20 Dec 2023 12:00:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703102400; cv=none; d=google.com; s=arc-20160816; b=ytgEPDYY/unITzeggplIgQbHLnTPzdNOo4VCFSzAE4XudUUj9tLM2yKrC0zNQxpSlR 6XYy8KT397V0tZwBsMBheHYVaFlWpNomfBN7oD1Ep3tVE/B20VVw8MClad7zU1D+BGaG yftUlnBwmNIoUFTgoiauLNGP6M8T2gsH1hrGMCNmShgUwRJolBUA9mR/9JFeEAav+Exu 3onlOm1NKln3eI/gib8nAjfeAt/RqnldNU/+qCwNPBMF4CBdRNhFsv2iaXic84LrHN03 vwmOCCi0jNHJMwHKL1Fv0HyYZjgpfV83U20Sop88uT0jkqp389LnIy9eOfYjYEJFCdm3 5tJw== ARC-Message-Signature: i=1; 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=MOQBkuV64qGkpkL02M2q/zJVUfocblbpJ8/Q7Pg5Jnc=; fh=rHzx+ANkker+beO67QA1vXxKgPqAx8BYspOpPJrAfTo=; b=cyrNu6fD2MFq6v0HjZMhHsYGZLHjFVFX/gP4RcfDdbZy2cfdevrLtRsPTmacu4Q6g/ knwWB4lZfsSctvE1VlUTk3DkrNPJvbtFVWGUcEuxHMxbGfUJ3ovzG/nh4mjxUIpf3sYq k35a//upp3Ov/iyHWq2MgL/Smgg1NkwjHm2IkwrqyErCx000aeVzd9gLlBgfPm7JG/9B EQcFeYyfI4rghI2Ae9EPUecEkw+OV1Le+muVhP3s5ycDG9pkC1TPcf7FIOaL7/BW2JR+ BIC84x1W84U3dXT+PZvZuzD2MgIEu1jw+ZtRFielkOQCXq7xklSxyK22GwMXrU/HeiyJ 5Qqg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=nGclzkJI; spf=pass (google.com: domain of linux-kernel+bounces-7404-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-7404-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 r10-20020a0ccc0a000000b0067f1a7134desi441219qvk.184.2023.12.20.12.00.00 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Dec 2023 12:00:00 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-7404-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=nGclzkJI; spf=pass (google.com: domain of linux-kernel+bounces-7404-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-7404-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 047791C22F23 for ; Wed, 20 Dec 2023 20:00:00 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0CC0648795; Wed, 20 Dec 2023 19:59:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="nGclzkJI" X-Original-To: linux-kernel@vger.kernel.org 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 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.