Received: by 10.223.185.116 with SMTP id b49csp3915350wrg; Tue, 6 Mar 2018 07:04:20 -0800 (PST) X-Google-Smtp-Source: AG47ELtoiHvwpg0Bt579nZXxSFCvqz7mKCNHrbS8IKIWxnP1uj7deNkOUk36HcpMl/IouDC0fn/v X-Received: by 10.101.86.73 with SMTP id m9mr15584024pgs.70.1520348660119; Tue, 06 Mar 2018 07:04:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520348660; cv=none; d=google.com; s=arc-20160816; b=JDngp4w4/lEGiqxVSMyy1pi6xmFjQG92kcQ6sYFLyWoJeifPlBKYQk/G6rnHRmJTyh 99kqP3qSANjSFsxUtGHVHDXObSHuX/DzcI2StBhIlPCOIiwRhqRt2ujpIHbCAusUOVkH rgH1dcIl59jQPCtcUIv1Jp0cx8wvKBhtAMZ4GwDtuJrFY9Eha2KsB9Mb062w6WKQLgBG v6hoYoJYeDCoM5gSgm/43STuQMTmTwFMt43rnVyA4bZwXd/Lm5FKW39CkeaXvD+0AuEG RyHcF8oucXyTFhxL9z02JNWvzCTi6Z3MTyQrNvDu17axrmFZWeaBGfOl5hoUmYlpMu0I UdKg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=beuxa/E2ZipONA3P6dEUTVqViPUfuw3Sdcmm8QtMdLg=; b=ktifh6/GVrfMkfZcAzo948PyXehqoUdb2HKjXztdoK+n/74PNGHxyes1oUqW27BL0w Y+jrPhrv5dpTW4zAk4UA6sILSTAygDWTwMw5eSOT8a3Pe5Yumx8uRUoK3tR2skBPOh2J 6EBknm1Golde6WmQ1qhWBccOwqa8HNXFgFa3F2T/VQ9wessZh82oz05UmD3YyrC+Gcjs cK/3CPgGYETam/qdhb2DCjbx/IkCDwV7rbCFu/vMMG7g555y6ZgV3KsNAbtrh3TptCIe KC3a2P45OaJG+7hvpgFWU37+ErQYUA4pYtaIx+5FO60bx9AmH8tk5Kok+hCaYmZJkoLJ 2LNw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@shutemov-name.20150623.gappssmtp.com header.s=20150623 header.b=DEN2J/J8; 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 w1si3599485pgq.135.2018.03.06.07.03.51; Tue, 06 Mar 2018 07:04:20 -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; dkim=pass header.i=@shutemov-name.20150623.gappssmtp.com header.s=20150623 header.b=DEN2J/J8; 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 S933107AbeCFPBS (ORCPT + 99 others); Tue, 6 Mar 2018 10:01:18 -0500 Received: from mail-wm0-f66.google.com ([74.125.82.66]:51672 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932313AbeCFPBQ (ORCPT ); Tue, 6 Mar 2018 10:01:16 -0500 Received: by mail-wm0-f66.google.com with SMTP id h21so23350526wmd.1 for ; Tue, 06 Mar 2018 07:01:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=shutemov-name.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=beuxa/E2ZipONA3P6dEUTVqViPUfuw3Sdcmm8QtMdLg=; b=DEN2J/J8dyX5rEmM0W5FaIsWcMtvuY7Yp+REtYvUdnaqjclk5Uev6DXCx3Br+X541d +MQNZHWm08VAw2GiYxUMImjMKWLlpaEUnei3/39RcoSdM3QJ3u08r9r2kCSXG/1dBNTp JE8CCQJLgVugFOCLI7sZXWnHfUbizpwJHx3N+Q6eko7auv3nfzbY7wfE9YmewYX8H3t+ NHUKmJjaM1B+8JXyUJaGn/E+8OOwbFzm+S7GtzLOY62DMfiKKXcD91xVbxvuAmSl7eY0 tiE5eruIG+9pNfr9EoaG7j1+igYceYkbNzlPk+wdwqEvyFOGCPezclqOjTFqgungOrr2 5DfA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=beuxa/E2ZipONA3P6dEUTVqViPUfuw3Sdcmm8QtMdLg=; b=lmJ8Nq7IbBLvut0kzPmYh/mDk5Hfppw9FE38RAqy8LQA/pHyCKcdm0Y+MytixzbyNS PCEH0SorehGQ8qm8CHP1R8roLMO4Aqn9xhl/9K8mAAmHFHCcby0PhWj0WhqYrUnoXsah 7f7oLDE5hH74GeFGFdf+vNyMk7SfV5OYlZVXXJh0suliZi5XtTYsx+bOWBurjBszyBqx pYsVWVxU/cMsXOstghLUbHSZHskfSeZzsL5Zj9wHDhpHWDdMD9bdGj3Qwl2w1zrJGnwc ZlzM9eTOfoxXIf/Jr2Uch1zgFXws7Y1CYXRoFg68DNRcBrIOMlZ2SsPrY+oLynzxvDCu x66g== X-Gm-Message-State: APf1xPCej0ty7fclRimpFud5oI2sZhxHdihxE7UqX3QOrL5iAXHoqLaE XPBqKXA8Qlujsl3tNQHfNLu1bA== X-Received: by 10.80.135.11 with SMTP id i11mr23650259edb.233.1520348475651; Tue, 06 Mar 2018 07:01:15 -0800 (PST) Received: from node.shutemov.name ([86.57.210.234]) by smtp.gmail.com with ESMTPSA id w1sm3319268edl.47.2018.03.06.07.01.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 06 Mar 2018 07:01:14 -0800 (PST) Received: by node.shutemov.name (Postfix, from userid 1000) id C6894648D520; Tue, 6 Mar 2018 18:00:59 +0300 (+03) Date: Tue, 6 Mar 2018 18:00:59 +0300 From: "Kirill A. Shutemov" To: Dave Hansen 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 Subject: Re: [RFC, PATCH 13/22] mm, rmap: Free encrypted pages once mapcount drops to zero Message-ID: <20180306150059.fclktp7qdhy37vyz@node.shutemov.name> References: <20180305162610.37510-1-kirill.shutemov@linux.intel.com> <20180305162610.37510-14-kirill.shutemov@linux.intel.com> <20180306082743.2epdfxv4ds7hz7py@node.shutemov.name> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20180223 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Mar 06, 2018 at 06:59:04AM -0800, Dave Hansen wrote: > 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. :) Yes, I'm bad with words :) -- Kirill A. Shutemov