Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3227048imu; Sat, 24 Nov 2018 00:33:40 -0800 (PST) X-Google-Smtp-Source: AFSGD/XHgLXDiw0l2Fa7yN5WFHhf/8RW2E3PVIMYrUbbE7EQoCjPQiex0toRgKW+UtWTLK7qU7pI X-Received: by 2002:a63:2586:: with SMTP id l128mr17335951pgl.104.1543048420431; Sat, 24 Nov 2018 00:33:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543048420; cv=none; d=google.com; s=arc-20160816; b=h/k1zYgVAmrWjyDl6ShqRk+bKHX2VVpPLM6TQOAKOQDiGQKcnDC+Y297zC2nJu4DVU iKrPGBB8F5ZxVZVruxqVxrY3+0FeIVY1hOEDbtLeUsHSN0YnMsezpgt2u0z6axmbCG9e rhZ1BoHNSKk0e2l/kIYp6bh3IpACztrjxH6Gwo6rYLd09Mu2/7/UCFj0iSE8JeuabZTY Wnty6Oy0YI7gw4xbEKC7yriHYd3Y49n8p9ddcWNikg4ttRBtfvk23cGe8EK+MgHjhAmD akV0DwiEEbkFsbES7Q7c1ZYI2/gfKqNuMtfKGG22ePxHkOJXCtgjkWK9qfu2Vpt4J5vZ BKKw== 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=gMBsG/mSQIe+zMZ+o1m9qdrmSlB1Wk2yx5S0cvZV9TM=; b=GNUwWWLzhGtES99P5LqEadEljqCKSu2o1hj2LvNeFnEYahFCE8shBKgfo4/5wk5DXx q9XVJMFJcoxGdwKcLiExNDsz2XRdxdY1mvNYR4/zMB2pFcHTVzfreo/owSfjCq+12P36 2vn483VYOZlMh56P3r/iSw+i6Fou8G3FpC2N2vFwga1z1PyWR4DVuVPGEsdNoBwN53gr yMcpo8B8ztsVhqpPxbAukmM4OBCzoDH9vhqq5dHe9RBPCm+ehNJ9dKPEi7dh/rVS4VQU RvGdENTuSjxkEaVt+ZdGJ+T30lHmqiV0tOI/EpISOUeJkaNysaGB3J3zm5QFf/gN9tUh aGDQ== 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 u22si53506518pgk.335.2018.11.24.00.33.26; Sat, 24 Nov 2018 00:33:40 -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 S2394852AbeKWXow (ORCPT + 99 others); Fri, 23 Nov 2018 18:44:52 -0500 Received: from mx2.suse.de ([195.135.220.15]:40150 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1731971AbeKWXov (ORCPT ); Fri, 23 Nov 2018 18:44:51 -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 8F35BAECE; Fri, 23 Nov 2018 13:00:44 +0000 (UTC) Date: Fri, 23 Nov 2018 14:00:43 +0100 From: Michal Hocko To: Oscar Salvador Cc: linux-mm@kvack.org, david@redhat.com, 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, Oscar Salvador , Alexander Duyck Subject: Re: [RFC PATCH 2/4] mm, memory_hotplug: provide a more generic restrictions for memory hotplug Message-ID: <20181123130043.GM8625@dhcp22.suse.cz> References: <20181116101222.16581-1-osalvador@suse.com> <20181116101222.16581-3-osalvador@suse.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181116101222.16581-3-osalvador@suse.com> 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 [Cc Alexander - email thread starts http://lkml.kernel.org/r/20181116101222.16581-1-osalvador@suse.com] On Fri 16-11-18 11:12:20, Oscar Salvador wrote: > From: Michal Hocko > > arch_add_memory, __add_pages take a want_memblock which controls whether > the newly added memory should get the sysfs memblock user API (e.g. > ZONE_DEVICE users do not want/need this interface). Some callers even > want to control where do we allocate the memmap from by configuring > altmap. This is currently done quite ugly by searching for altmap down > in memory hotplug (to_vmem_altmap). It should be the caller to provide > the altmap down the call chain. > > Add a more generic hotplug context for arch_add_memory and __add_pages. > struct mhp_restrictions contains flags which contains additional > features to be enabled by the memory hotplug (MHP_MEMBLOCK_API > currently) and altmap for alternative memmap allocator. One note here as well. In the retrospect the API I have come up with here is quite hackish. Considering the recent discussion about special needs ZONE_DEVICE has for both initialization and struct page allocations with Alexander Duyck I believe we wanted a more abstracted API with allocator and constructor callbacks. This would allow different usecases to fine tune their needs without specialcasing deep in the core hotplug code paths. -- Michal Hocko SUSE Labs