Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3226634imu; Sat, 24 Nov 2018 00:33:10 -0800 (PST) X-Google-Smtp-Source: AFSGD/USlpIHDqqDmas7/YkPzalIQMT0pb24tRLBjOU8JQpeU7x1m1lI5gOb/SdbTQjeeKZ+RYHO X-Received: by 2002:a17:902:2c83:: with SMTP id n3mr19303928plb.104.1543048389996; Sat, 24 Nov 2018 00:33:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543048389; cv=none; d=google.com; s=arc-20160816; b=ND5cjdqCaRStDOghp/nQ7co4OF3xDcgbq+C89+f24hgNo6aLN+k3dDPO/yV52DtMdK y08Q1ivqqnt1i8xCLvka2cq0NRKPjrYlZ7xCjt1H0og7Hx6KYW6JZ6lzTLiopgf+lPEP FA5QVHslYqI1z5d4a3T7Zm5OQ/TKaasQTUbIqAK0QIF0VLuljePhiH4T/nMSwzyr6/XN ePZutdLDOkxeFGpblcUahSTzOHrjuaWAln12pFFo+hjwjESP8ocjXLOnoVfGie4bFXJD MQrHPFsaGjqZhNl3LwjFcBqOvgdtTtp6cOjE7r5gZDtXGn5iv4qChfOqjz8snoqCiudq vQEA== 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; bh=GzCsZ87ZJVSHYqwSpGYTRhV9jhT1AuOE9gg8xxsScXE=; b=m+FI1WFBKGJcqT6NINi4705m212YvAlE08h7qh6cDRV3hOQi0HhoAVSF5tTA6Zln1z 0RgDtgR+OrT0n0EY1H2PpkbMiCeklQx96J1NfM5nrmROx6qk9clc85gMhTKmoMCGPv7q 0eaMr0cbU84fA6W3PBS1sktiH6ChN+sqMiHObVgYPB8EbC6bkBZF+ekqz+yQQQd6TILS M0tEmkm8fIH2xN25qT8huvpPSgY75J22ltUwC0KvLn4XtqB2Mw0HkqR2rWwEakr9wox0 6507R4eME5a09tr/Cgj0A5wSwTAtDjBsrvSTBc6HDS3vr4X8wD+oayAC5FR7LaJxhzEB Xa5Q== 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j10si55829749pgt.155.2018.11.24.00.32.55; Sat, 24 Nov 2018 00:33:09 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2394533AbeKWX0e (ORCPT + 99 others); Fri, 23 Nov 2018 18:26:34 -0500 Received: from mx2.suse.de ([195.135.220.15]:37900 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2388147AbeKWX0e (ORCPT ); Fri, 23 Nov 2018 18:26:34 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id B6362AD6B; Fri, 23 Nov 2018 12:42:29 +0000 (UTC) Date: Fri, 23 Nov 2018 13:42:28 +0100 From: Michal Hocko To: Oscar Salvador Cc: David Hildenbrand , Oscar Salvador , linux-mm@kvack.org, rppt@linux.vnet.ibm.com, akpm@linux-foundation.org, arunks@codeaurora.org, bhe@redhat.com, dan.j.williams@intel.com, Pavel.Tatashin@microsoft.com, Jonathan.Cameron@huawei.com, jglisse@redhat.com, linux-kernel@vger.kernel.org Subject: Re: [RFC PATCH 0/4] mm, memory_hotplug: allocate memmap from hotadded memory Message-ID: <20181123124228.GI8625@dhcp22.suse.cz> References: <20181116101222.16581-1-osalvador@suse.com> <2571308d-0460-e8b9-ad40-75d6b13b2d09@redhat.com> <20181123115519.2dnzscmmgv63fdub@d104.suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181123115519.2dnzscmmgv63fdub@d104.suse.de> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri 23-11-18 12:55:41, Oscar Salvador wrote: > On Thu, Nov 22, 2018 at 10:21:24AM +0100, David Hildenbrand wrote: > > 1. How are we going to present such memory to the system statistics? > > > > In my opinion, this vmemmap memory should > > a) still account to total memory > > b) show up as allocated > > > > So just like before. > > No, it does not show up under total memory and neither as allocated memory. > This memory is not for use for anything but for creating the pagetables > for the memmap array for the section/s. I haven't read through your patches yet but wanted to clarfify few points here. This should essentially follow the bootmem allocated memory pattern. So it is present and accounted to spanned pages but it is not managed. > It is not memory that the system can use. same as bootmem ;) > I also guess that if there is a strong opinion on this, we could create > a counter, something like NR_VMEMMAP_PAGES, and show it under /proc/meminfo. Do we really have to? Isn't the number quite obvious from the size of the hotpluged memory? > > > 2. Is this optional, in other words, can a device driver decide to not > > to it like that? > > Right now, is a per arch setup. > For example, x86_64/powerpc/arm64 will do it inconditionally. > > If we want to restrict this a per device-driver thing, I guess that we could > allow to pass a flag to add_memory()->add_memory_resource(), and there > unset MHP_MEMMAP_FROM_RANGE in case that flag is enabled. I believe we will need to make this opt-in. There are some usecases which hotplug an expensive (per size) memory via hotplug and it would be too wasteful to use it for struct pages. I haven't bothered to address that with my previous patches because I just wanted to make the damn thing work first. -- Michal Hocko SUSE Labs