Received: by 10.223.185.116 with SMTP id b49csp2947986wrg; Mon, 5 Mar 2018 11:16:03 -0800 (PST) X-Google-Smtp-Source: AG47ELt7tudtCUXkbRhUjwtHPdyA2iaQIsbyEFrigD2okMH7nLInGM65XZyVixPQ4dNQV7t/vLK+ X-Received: by 2002:a17:902:7717:: with SMTP id n23-v6mr13852229pll.388.1520277363057; Mon, 05 Mar 2018 11:16:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520277363; cv=none; d=google.com; s=arc-20160816; b=QRTE4IZ6a92eWrkw7x1p1G3uoZRagdNMO8SLcTgL5Akndp7staw4hRoDFeFBjJ6l5I +wUvyIeD8tcVHmoaE5ANv7jgkLYf+aIXeD3rwsnxWAZ8I/TYK7PbJkdBjHKoqzwC0wQa F77A9ZV/50DAj4y6ru7PtjoHgWRsGeWualGm7N53ywc4iyFTpLT8oCvQiWLE/1k7ISyU BRbc8MprsFO0VbsFYIpZ0A9ZoJG9I0XuiY+6d5mluhIzIogHeVErSMwhzriqFhylt5wP +/hQSm33CVduoWuuQWd/RtmGZ6IuMCR9SnbNrV3VI6vbBS4X7PfA3G56zQ30Ds/MWrAf OV9Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:cc:references:to:subject:arc-authentication-results; bh=cV354QR/u76JO2CSEh3VbcMYBdjMPaeIk2C/T60jOhE=; b=oCHGQiKytFYRJbh+lL5vhaXqvAdrFmvM6gHMYHS+Rvt4DVqDf9IDELez93/bXMnOWf DH1GIYYKxFra8ivF92O2IyMT40Tu+PxlRrQ+kE7j6aLVAneyE1zH1FABO0GJuhkc70vl hARsZ3i3Uv9htbp57j/g/bxLAzM+Nve0K10uFdzpI+axZZKjiikJ73t1RRsqRr8dHM4J q9kCZite4rEkl4NGUzpI0/SBG+bq15/xng74hEAIc8I9/3PmKFjH39AZyMR+aSLUPOcF Mnez83oeQ+FAs23lVR2KUPkH20Hb8x7vBUi7Lqx0YDIg5exZrMGi93eWtGSrOHWd8ec5 0HXg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c7si10503393pfi.323.2018.03.05.11.15.48; Mon, 05 Mar 2018 11:16:03 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932530AbeCETNj (ORCPT + 99 others); Mon, 5 Mar 2018 14:13:39 -0500 Received: from mga11.intel.com ([192.55.52.93]:15760 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932505AbeCETNh (ORCPT ); Mon, 5 Mar 2018 14:13:37 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 05 Mar 2018 11:13:37 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.47,428,1515484800"; d="scan'208";a="32576800" Received: from ray.jf.intel.com (HELO [10.7.201.16]) ([10.7.201.16]) by orsmga003.jf.intel.com with ESMTP; 05 Mar 2018 11:13:36 -0800 Subject: Re: [RFC, PATCH 13/22] mm, rmap: Free encrypted pages once mapcount drops to zero To: "Kirill A. Shutemov" , Ingo Molnar , x86@kernel.org, Thomas Gleixner , "H. Peter Anvin" , Tom Lendacky References: <20180305162610.37510-1-kirill.shutemov@linux.intel.com> <20180305162610.37510-14-kirill.shutemov@linux.intel.com> Cc: Kai Huang , linux-kernel@vger.kernel.org, linux-mm@kvack.org From: Dave Hansen Message-ID: Date: Mon, 5 Mar 2018 11:13:36 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <20180305162610.37510-14-kirill.shutemov@linux.intel.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 03/05/2018 08:26 AM, Kirill A. Shutemov wrote: > @@ -1292,6 +1308,12 @@ static void page_remove_anon_compound_rmap(struct page *page) > __mod_node_page_state(page_pgdat(page), NR_ANON_MAPPED, -nr); > deferred_split_huge_page(page); > } > + > + anon_vma = page_anon_vma(page); > + if (anon_vma_encrypted(anon_vma)) { > + int keyid = anon_vma_keyid(anon_vma); > + free_encrypt_page(page, keyid, compound_order(page)); > + } > } It's not covered in the description and I'm to lazy to dig into it, so: Without this code, where do they get freed? Why does it not cause any problems to free them here?