Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp1125943ybh; Sat, 14 Mar 2020 18:45:42 -0700 (PDT) X-Google-Smtp-Source: ADFU+vv+3+Mb/A8Uw3ZcIJ/U/RMuE1Tzc+zwYLkuxuPq1Ai4+a8gfgLsOgY64BS7Ez1VuXL/psce X-Received: by 2002:aca:a94a:: with SMTP id s71mr12096039oie.152.1584236742146; Sat, 14 Mar 2020 18:45:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584236742; cv=none; d=google.com; s=arc-20160816; b=X13tcux0VeNSbxsIfKFwqON4WQ23CPcOmenXvWVWGqAys9k97eqSnkj0Ch9WPpa2hJ nxpRhgpaCRjlLEK/yVkSWbssUWG2tqiBzIqYdPeWr34nkEgRQ/YEWXiWEYmSruM3yqOt sKbm7ZrH8h0215j+ls0SSjL7l91yhnLrV6Nsb0qY76lsWyHuq8z+GUXJ5P+yGPNI2PzQ TLU/kPZdMG9NA4WJ42iYZ0VP0tDtwBaIXCs9wqHLgmOtBZwn7WAvo8AJFqu701I86gVS ZKUl8y1nZlSw8b9pbwW/yTEHQzEZyXx6Y+Pzekvn99LN8S99rY5P+Jt/AWZUm38G3LMR Moig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:organization:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:ironport-sdr:ironport-sdr; bh=rRWe1aNREtqe4NNM/C35xDA8BLSMQZAqRbGR+NLxt2k=; b=x5rI/HUwb2mDX2PkXF/lQhpG/OS+jmLxR6MIqgihXF7SQnoROkXB3EtlLcRQ93qwyB v4zugzjWaD1moibKcOgeqpnPPU6on+AtutmWnQxxG/L1Y03yNQicYNvT6qH9Xw4royxJ QcyobtzfdeBpfspdQwX4RYmbjO0gvb8DSYijKjoVgn89iPzT14taFUG/acmsZPsZe85J Km7iXtDEmb4J9huLzUI7ipuK2KiVu4ftZs43ptfSShp0uE8IaHPD7mVT3r+ac4gFqohF Src2yNqsvqrcZ27C2oG275NPPYq0ERpgb8E6AYS13IvTYmdudpvrXg6Gj7u/mXV9QjGV sEKg== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f23si7433282oti.283.2020.03.14.18.45.29; Sat, 14 Mar 2020 18:45:42 -0700 (PDT) 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726846AbgCOBpG (ORCPT + 99 others); Sat, 14 Mar 2020 21:45:06 -0400 Received: from mga11.intel.com ([192.55.52.93]:57711 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726125AbgCOBpF (ORCPT ); Sat, 14 Mar 2020 21:45:05 -0400 IronPort-SDR: T8YLneuB+tgoUYdmfCsK4H9zfs4txjjDT2dDvSRynNfrtZeSxaPW6jE5mo2BYfGn6F5ZyvGGVy eLpCKbdseBCg== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Mar 2020 18:17:29 -0700 IronPort-SDR: 6RZRYafgPr/dTqPERjsHs00TLV2/oN1wh7Y98ZQe0lQURHbYBWQTKE2DfWxEh7+0TXgADhre3K 6vvOprMCAkGw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,554,1574150400"; d="scan'208";a="323143854" Received: from mbenhamu-mobl2.ger.corp.intel.com (HELO localhost) ([10.251.177.145]) by orsmga001.jf.intel.com with ESMTP; 14 Mar 2020 18:17:15 -0700 Date: Sun, 15 Mar 2020 03:17:13 +0200 From: Jarkko Sakkinen To: Sean Christopherson Cc: linux-kernel@vger.kernel.org, x86@kernel.org, linux-sgx@vger.kernel.org, akpm@linux-foundation.org, dave.hansen@intel.com, nhorman@redhat.com, npmccallum@redhat.com, haitao.huang@intel.com, andriy.shevchenko@linux.intel.com, tglx@linutronix.de, kai.svahn@intel.com, bp@alien8.de, josh@joshtriplett.org, luto@kernel.org, kai.huang@intel.com, rientjes@google.com, cedric.xing@intel.com, puiterwijk@redhat.com, linux-mm@kvack.org, Ismo Puustinen , Mark Shanahan , Mikko Ylinen , Derek Bombien Subject: Re: [PATCH v28 16/22] x86/sgx: Add a page reclaimer Message-ID: <20200315011713.GB208715@linux.intel.com> References: <20200303233609.713348-1-jarkko.sakkinen@linux.intel.com> <20200303233609.713348-17-jarkko.sakkinen@linux.intel.com> <20200305190354.GK11500@linux.intel.com> <20200306184702.GD7472@linux.intel.com> <20200312183824.GB26453@linux.intel.com> <20200315002732.GA208715@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200315002732.GA208715@linux.intel.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Mar 15, 2020 at 02:27:46AM +0200, Jarkko Sakkinen wrote: > On Thu, Mar 12, 2020 at 11:38:24AM -0700, Sean Christopherson wrote: > > On Fri, Mar 06, 2020 at 08:47:02PM +0200, Jarkko Sakkinen wrote: > > > On Thu, Mar 05, 2020 at 11:03:54AM -0800, Sean Christopherson wrote: > > > > We've also discussed taking a file descriptor to hold the backing, but > > > > unless I'm misreading the pagecache code, that doesn't solve the incorrect > > > > accounting problem because the current task, i.e. evicting task, would be > > > > charged. In other words, whether the backing is kernel or user controlled > > > > is purely an ABI question. > > > > > > Even if the file is owned by a different process the account happens > > > to "current"? > > > > Yes. Which makes sense as files do not have a 1:1 association with tasks. > > Yeah, that makes sense. Looking at mm/memory.c. > > Looking at finish_fault/alloc_set_pte/inc_mm_counter_fast code path that > is also what happens. Ugh, I meant __set_page_dirty/account_page_dirtied/task_io_account_write path :-/ Anyway. /Jarkko