Received: by 10.223.185.116 with SMTP id b49csp3909834wrg; Tue, 6 Mar 2018 07:01:02 -0800 (PST) X-Google-Smtp-Source: AG47ELvKGXCZVBaGusiufn2YTUGo0FogCHbCXh3CWCGcMKdHnSCtVdleYqwM3jJuhoc1/bf8NGEC X-Received: by 10.167.131.135 with SMTP id u7mr12649824pfm.50.1520348462837; Tue, 06 Mar 2018 07:01:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520348462; cv=none; d=google.com; s=arc-20160816; b=EnkRz0hSkR9wJWzTt+vn0ynrNTiVjTAiAoK9VMOCouloJSR/S6zuZne906z6PiZiy9 pcvNjva2N+CyNqeV27Ugl19W0kG3QfAWRrxlohJWSBSyjJMC8QaMqpTyVoCBOHTlgFOz Gg4RphSxxVr89AZgSWEdPd9FnQD2M8xtdUbsqW/jC/vFYqkZgefJidUWEuP2RJrKDDPu VCWPYDZmAYJpwFAv0JFVbYM7J2X+sEd9XNzE64gH8FRpAsq4q6l/AGTpvbUKSENG0lwt LkXD0RFEeqvECf+419ZeOR911NgB0bTP4iGfGSX5yVOPKRJl8NwVPpkUDZ7xbdONfE6f XuhQ== 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=6XzruB4P3Rz7P3tIVJFI72vDn9o2w5RsZfZzmWyS540=; b=r2UafpEBXUxHwuViTuwXSSoLR5WltRoXajwYFdasC9/rk6v6DZYFar54trz+tkUXPK 6ZQzk+MWXQv8qgBa+0/okq+7hlfTD9llBlZ3S8bUQP3hTedRssoES+l2bqKZDzgdKToV mu0XDEaFav6Tdx9jP83LPBrcLSq2rnmnqtzBIJ4LWYywApIPQAM9IB8gdM2VhVdm+w5g Q95jdCZZXStq0zf1ld87+/q+cA8TLCgpdMHIPulNtzYsERLsipvMV1jxYJV3sNKvUlgv nqmlO2m0V0oRJD482ekjY9caCM40pVgLOy2IFLyEpcdeoqPz6hUjh4cM8Umo/+g1O2pz cNwA== 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 y67si12156665pfd.195.2018.03.06.07.00.46; Tue, 06 Mar 2018 07:01:02 -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 S932804AbeCFO7H (ORCPT + 99 others); Tue, 6 Mar 2018 09:59:07 -0500 Received: from mga01.intel.com ([192.55.52.88]:57351 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932659AbeCFO7G (ORCPT ); Tue, 6 Mar 2018 09:59:06 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 06 Mar 2018 06:59:05 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.47,431,1515484800"; d="scan'208";a="23368702" Received: from unknown (HELO [10.7.201.16]) ([10.7.201.16]) by orsmga006.jf.intel.com with ESMTP; 06 Mar 2018 06:59:05 -0800 Subject: Re: [RFC, PATCH 13/22] mm, rmap: Free encrypted pages once mapcount drops to zero To: "Kirill A. Shutemov" References: <20180305162610.37510-1-kirill.shutemov@linux.intel.com> <20180305162610.37510-14-kirill.shutemov@linux.intel.com> <20180306082743.2epdfxv4ds7hz7py@node.shutemov.name> Cc: "Kirill A. Shutemov" , Ingo Molnar , x86@kernel.org, Thomas Gleixner , "H. Peter Anvin" , Tom Lendacky , Kai Huang , linux-kernel@vger.kernel.org, linux-mm@kvack.org From: Dave Hansen Message-ID: Date: Tue, 6 Mar 2018 06:59:04 -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: <20180306082743.2epdfxv4ds7hz7py@node.shutemov.name> 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/06/2018 12:27 AM, Kirill A. Shutemov wrote: > + 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)); > + } > } So, just double-checking: free_encrypt_page() neither "frees and encrypts the page"" nor "free an encrypted page"? That seems a bit suboptimal. :)