Received: by 2002:ac0:98c7:0:0:0:0:0 with SMTP id g7-v6csp5250014imd; Tue, 30 Oct 2018 14:27:26 -0700 (PDT) X-Google-Smtp-Source: AJdET5dY39GQDT24lfdmZ72I1DtcS1/CubG1lrGwnSAVyoYIWiOckZ7kS2BMG6c5TN2Ov1ZRKOeD X-Received: by 2002:a63:1d10:: with SMTP id d16-v6mr375694pgd.228.1540934846015; Tue, 30 Oct 2018 14:27:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540934845; cv=none; d=google.com; s=arc-20160816; b=KSNHmHT2nImeBt+dhM9K4Ket157fiNY7Ssx6bkzp8SI7d90Rcs/P6TwT+SHyRnZcQU z6Fn538yJ/ka8sxE0vB0dGNex6HeaWmc4frluHZtlrjCpjrQwGfx/Lsgy84pf2FPP/no ofVxLIMrgjZAav7U8KM2jMk/SnQluYQ6LLDQHIL+eC7cPflEu7bAa1cQ4gc4fLMoCqIq 5GXFv/azg/XUQcceLJWg4NL2/OY5+4hr63ZkcgXrn8oMUpCFwyErw0F9vhgZbTyddjZ5 xCmqC2GgbNZKIn/zc3entGxElgrnO2ceFbbRdLWYuPOBrHND1cV5ZNolnjJ2G+3oM+U0 gy9w== 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-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=Q8w/sHoucG3GmKpRw8+C/5yNw6xEMIv7YocwV/fFoKI=; b=PJLHGcMY/8bDpL5bPDneBmP2SIKGwDRdihU0yTU0ErJrtmv88ryfLOuHnqGQDlP85i uKIaT+eEogjvAuU+8rYXMLDQEroU0YCHgFcNemws8uOpNt7lIzqoouazxj17FQDPKkoI izpG9iZswHLDqRYqX/rdBPIYdfq/ONW4mQyP8EgoJ3KfmMrFQrhkdjp4A1FEx5sT9ae6 qfbHlWrix9NXlRJIgO/HjP9RRUkT/gLTNXzSungPRMnuYn+mf8YRW3/j73xgQk/mIEFv bczRuoIReV0CnW96MTmRGjqRFcRyl39vYPH6Hr2Ral/gylE0lG8Ppq6ZjCw83Q+K7dxJ pqXA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=RdfaVRLc; 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 h4-v6si25011402pgn.36.2018.10.30.14.27.10; Tue, 30 Oct 2018 14:27:25 -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; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=RdfaVRLc; 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 S1727650AbeJaGVG (ORCPT + 99 others); Wed, 31 Oct 2018 02:21:06 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:32844 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725743AbeJaGVG (ORCPT ); Wed, 31 Oct 2018 02:21:06 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Transfer-Encoding :Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date: Sender:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=Q8w/sHoucG3GmKpRw8+C/5yNw6xEMIv7YocwV/fFoKI=; b=RdfaVRLcsYI1IQiMSBBDcyBiLT 7X8Lh03D9wTpHp0iQthLGjZyRF3Mb4TYwIWiWYNpqx06nlaJ9JAEkssaXPRfJ8T3jhJq+DxNutqxP PqtxzMEDPqZxgyfPFe5KgQS8zF7jK/JC6tgz8cKp6b/EsVKE/CuVf5HMZQn5q0IxDW76q2M4qDOPd rFyN7Lxla7U/MdQxv2xSxGsIkVtlKwlR7IZfxbqMMgayaJ8NlqiFL2K8x1B4KeIZ6D3anPUdKTEKG xCZB7Z+/GKe5r2j+pzroo7jZlBNYpojN4z5QL5l9Pr//Q61CDRjiZul61sN6rl2AuwtktwKwbC5N2 BK8vQk2g==; Received: from willy by bombadil.infradead.org with local (Exim 4.90_1 #2 (Red Hat Linux)) id 1gHbWJ-0001ft-En; Tue, 30 Oct 2018 21:25:51 +0000 Date: Tue, 30 Oct 2018 14:25:51 -0700 From: Matthew Wilcox To: Andy Lutomirski Cc: nadav.amit@gmail.com, Kees Cook , Peter Zijlstra , Igor Stoppa , Mimi Zohar , Dave Chinner , James Morris , Michal Hocko , Kernel Hardening , linux-integrity , linux-security-module , Igor Stoppa , Dave Hansen , Jonathan Corbet , Laura Abbott , Randy Dunlap , Mike Rapoport , "open list:DOCUMENTATION" , LKML , Thomas Gleixner Subject: Re: [PATCH 10/17] prmem: documentation Message-ID: <20181030212551.GD10491@bombadil.infradead.org> References: <20181023213504.28905-11-igor.stoppa@huawei.com> <20181026092609.GB3159@worktop.c.hoisthospitality.com> <20181028183126.GB744@hirez.programming.kicks-ass.net> <40cd77ce-f234-3213-f3cb-0c3137c5e201@gmail.com> <20181030152641.GE8177@hirez.programming.kicks-ass.net> <0A7AFB50-9ADE-4E12-B541-EC7839223B65@amacapital.net> <20181030175814.GB10491@bombadil.infradead.org> <28C8CD2A-BDC0-49A5-854E-1E18968528B8@amacapital.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <28C8CD2A-BDC0-49A5-854E-1E18968528B8@amacapital.net> User-Agent: Mutt/1.9.2 (2017-12-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Oct 30, 2018 at 11:51:17AM -0700, Andy Lutomirski wrote: > Finally, one issue: rare_alloc() is going to utterly suck > performance-wise due to the global IPI when the region gets zapped out > of the direct map or otherwise made RO. This is the same issue that > makes all existing XPO efforts so painful. We need to either optimize > the crap out of it somehow or we need to make sure it’s not called > except during rare events like device enumeration. Batching operations is kind of the whole point of the VM ;-) Either this rare memory gets used a lot, in which case we'll want to create slab caches for it, make it a MM zone and the whole nine yeards, or it's not used very much in which case it doesn't matter that performance sucks. For now, I'd suggest allocating 2MB chunks as needed, and having a shrinker to hand back any unused pieces.