Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp2701624imm; Tue, 4 Sep 2018 08:39:39 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZWqdo8aY8RmknvyeHsFsE0qr5+19062ODVD0yoZ5n6im3ik4Wzsps1mLpMyJtppMEgEyDJ X-Received: by 2002:a63:fc54:: with SMTP id r20-v6mr31818942pgk.377.1536075579146; Tue, 04 Sep 2018 08:39:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536075579; cv=none; d=google.com; s=arc-20160816; b=sLGOZboagtcnpLigCxxRLffRgfMlHT5i0v/c/zz2x2YMtRB983Gc5sIhcj40+hyxXz xvgdVfBHLeTjc6Geuze3aCI1H3Xa/QH4n4M60JY9JxzpZrjpDGSOYxAZtYkB7dZUcYaX Y8QQQQjJ0nOaY0UDWvaFoIb/yIRBgtrsBkkPJAe0LtCpK8C8vFRrJ9T5XIm8IREMWqM8 rEcJiqZP/HJNkfJ7EW0S6lS7fRBm4YvfY3JazgK1ptoEOXY0jcwDE4n4PSHeJZNHnUWw g/PuouNG4hRBX9vr+BrYCizqbJJkQ5fLialgsevabqLOiwMbWSTwGmOCNnOzb0Th/9cS RUGg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:organization:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=ChaVHijDzTepjQg5FS4GdJSsaSoTOZYdYXMvvpbE+bM=; b=nkmnnToxCvfQ41mxHMz/NzEOi7Q2fkNKc1QY+j4q0wOiWRIKxU2dwwr5cjVPXx7XZw UO6Ii2xR3wRxzgLSiBaHsjKqjkiHpw71/borJwgP1liQ+uJ0gSvjvO4yB8QPXOdapkId yfKGv4ja6pUcpRorVK013nBAdHp4AUpDeQ1dSiwhKQWxxjEWVHMkJJyRhFbnKpfkMI4l 7kx2quGzXQ8+d6b6K+bwa2zDsPwAFg0ExknyyXypN5fjhrIXe2KDUFrGpFslG0oX6EgU pNnOzVoJWhze8DOtej/ECIqZhBabds5nAwqtLx2pyaLztxLuT+c7UweRnwzM1IKWTIa1 srOA== 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 29-v6si18550961pgz.215.2018.09.04.08.39.23; Tue, 04 Sep 2018 08:39:39 -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 S1727752AbeIDUD7 (ORCPT + 99 others); Tue, 4 Sep 2018 16:03:59 -0400 Received: from mga01.intel.com ([192.55.52.88]:17348 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727072AbeIDUD6 (ORCPT ); Tue, 4 Sep 2018 16:03:58 -0400 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 04 Sep 2018 08:38:15 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.53,329,1531810800"; d="scan'208";a="230119759" Received: from schoebin-mobl1.ger.corp.intel.com (HELO localhost) ([10.252.35.203]) by orsmga004.jf.intel.com with ESMTP; 04 Sep 2018 08:38:05 -0700 Date: Tue, 4 Sep 2018 18:38:03 +0300 From: Jarkko Sakkinen To: Andy Shevchenko Cc: "maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)" , Platform Driver , Dave Hansen , sean.j.christopherson@intel.com, nhorman@redhat.com, npmccallum@redhat.com, linux-sgx@vger.kernel.org, Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , suresh.b.siddha@intel.com, serge.ayoun@intel.com, Linux Kernel Mailing List Subject: Re: [PATCH v13 09/13] x86/sgx: Enclave Page Cache (EPC) memory manager Message-ID: <20180904153803.GC8344@linux.intel.com> References: <20180827185507.17087-1-jarkko.sakkinen@linux.intel.com> <20180827185507.17087-10-jarkko.sakkinen@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Sep 03, 2018 at 10:02:16PM +0300, Andy Shevchenko wrote: > On Mon, Aug 27, 2018 at 9:58 PM Jarkko Sakkinen > wrote: > > > > Add a Enclave Page Cache (EPC) memory manager that can be used to > > allocate and free EPC pages. The swapper thread ksgxswapd reclaims pages > > on the event when the number of free EPC pages goes below > > %SGX_NR_LOW_PAGES up until it reaches %SGX_NR_HIGH_PAGES. > > > > Pages are reclaimed in LRU fashion from a global list. The consumers > > take care of calling EBLOCK (block page from new accesses), ETRACK > > (restart counting the entering hardware threads) and EWB (write page to > > the regular memory) because executing these operations usually (if not > > always) requires to do some subsystem-internal locking operations. > > > + list_del(&page->list); > > Is this page will be completely gone? Otherwise it might be needed to > reinit list head here as well. The swapper cannot access the page once it has been removed from the list of active pages so it does not matter whether this is list_del() or list_del_init(). > > + WARN(ret < 0, "sgx: cannot free page, reclaim in-progress"); > > + WARN(ret > 0, "sgx: EREMOVE returned %d (0x%x)", ret, ret); > > I'm not sure (though it's easy to check) that you need sgx: prefix > here. WARN() might take pr_fmt() if defined. Sean, you took care of this one. Was it so that WARN() does not respect pr_fmt? /Jarkko