Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp2871226imm; Thu, 24 May 2018 17:58:44 -0700 (PDT) X-Google-Smtp-Source: AB8JxZq0eMOvfcGHBZLOJHvxK5/K5uYZE/aRgqdnqHRNwLSBw2/XEIzi6JGBg7lyA+xK645AezEP X-Received: by 2002:a17:902:7896:: with SMTP id q22-v6mr287150pll.243.1527209924028; Thu, 24 May 2018 17:58:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527209924; cv=none; d=google.com; s=arc-20160816; b=HaAlqH138dPHIcxOTiXKtmu2aZBfHiYgmzoD8vLSPpy5+Gu/7apsnPwKgUAYBrK97t 7WgrGM9zCQWfsOX68VKs9yufOWuhlqcsMLBzmC5QhPn6QJFa5nmBDl14P62Wnt28J/Ev JoNJJSLa0bA+dE3FTRUMH/ggOI/5RTf0s/OvCCNfHnkuwvPlYYWd/PUusZevcfUQIUb0 5BKbFyxsmfhedcgmdeiWL72D8lPVuQRXbOxml71x1eGp088GFl5LhD+Vfr8zXJFb5GJj f+haxOxZD3s1nhR6ZU7keCi7uVcKCH1GZYISdm6F6nu2SKFnjclxX4tsRdwjmg0yTPWl 1V2w== 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:arc-authentication-results; bh=KA5swCYyrbJ1ptxHS1O3ESWvcR3j/sDyXRcwu6vlNsA=; b=P52b625qZYJLg7x37pImVzfBLSCQdyQTiAX9fH7i9JHHRhS0EWHmHNIMtA2vKEpmrf QfowaR5tWuWb0vavcshsL+HI1eyPjtgGDlzGQdbWba2T514/4UX/JyeenYe8NJiZ0o7v YY+6SyCX0OMFUDoeQEI1LenLsMInNiQukbOqlY3KpkMtW5uNMqkAdEzEhZ67RBtuwrVj PxlzhrrkZGnmtcuoHnSCj5HYRCkZdcVGxI4MFvM39MfsK8ABeezS1eWOrCGTwk1/o7oh 25Exg7RedZWoevHjo0YywoSuvkFS7qi1UbU4FkGMOKdLklEUeSI2VtWunVdcToX/VsZd rC0g== 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 e98-v6si22317707plb.279.2018.05.24.17.58.29; Thu, 24 May 2018 17:58:43 -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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1033253AbeEXOWu (ORCPT + 99 others); Thu, 24 May 2018 10:22:50 -0400 Received: from mx2.suse.de ([195.135.220.15]:38815 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1030742AbeEXOWs (ORCPT ); Thu, 24 May 2018 10:22:48 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (charybdis-ext-too.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id BAC5EAB9D; Thu, 24 May 2018 14:22:45 +0000 (UTC) Date: Thu, 24 May 2018 16:22:42 +0200 From: Michal Hocko To: David Hildenbrand Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, Alexander Potapenko , Andrew Morton , Andrey Ryabinin , Balbir Singh , Baoquan He , Benjamin Herrenschmidt , Boris Ostrovsky , Dan Williams , Dave Young , Dmitry Vyukov , Greg Kroah-Hartman , Hari Bathini , Huang Ying , Hugh Dickins , Ingo Molnar , Jaewon Kim , Jan Kara , =?iso-8859-1?B?Suly9G1l?= Glisse , Joonsoo Kim , Juergen Gross , Kate Stewart , "Kirill A. Shutemov" , Matthew Wilcox , Mel Gorman , Michael Ellerman , Miles Chen , Oscar Salvador , Paul Mackerras , Pavel Tatashin , Philippe Ombredanne , Rashmica Gupta , Reza Arbab , Souptick Joarder , Tetsuo Handa , Thomas Gleixner , Vlastimil Babka Subject: Re: [PATCH v1 00/10] mm: online/offline 4MB chunks controlled by device driver Message-ID: <20180524142241.GJ20441@dhcp22.suse.cz> References: <20180523151151.6730-1-david@redhat.com> <20180524075327.GU20441@dhcp22.suse.cz> <14d79dad-ad47-f090-2ec0-c5daf87ac529@redhat.com> <20180524093121.GZ20441@dhcp22.suse.cz> <20180524120341.GF20441@dhcp22.suse.cz> <1a03ac4e-9185-ce8e-a672-c747c3e40ff2@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1a03ac4e-9185-ce8e-a672-c747c3e40ff2@redhat.com> User-Agent: Mutt/1.9.5 (2018-04-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org I will go over the rest of the email later I just wanted to make this point clear because I suspect we are talking past each other. On Thu 24-05-18 16:04:38, David Hildenbrand wrote: [...] > The point I was making is: I cannot allocate 8MB/128MB using the buddy > allocator. All I want to do is manage the memory a virtio-mem device > provides as flexible as possible. I didn't mean to use the page allocator to isolate pages from it. We do have other means. Have a look at the page isolation framework and have a look how the current memory hotplug (ab)uses it. In short you mark the desired physical memory range as isolated (nobody can allocate from it) and then simply remove it from the page allocator. And you are done with it. Your particular range is gone, nobody will ever use it. If you mark those struct pages reserved then pfn walkers should already ignore them. If you keep those pages with ref count 0 then even hotplug should work seemlessly (I would have to double check). So all I am arguing is that whatever your driver wants to do can be handled without touching the hotplug code much. You would still need to add new ranges in the mem section units and manage on top of that. You need to do that anyway to keep track of what parts are in use or offlined anyway right? Now the mem sections. You have to do that anyway for memmaps. Our sparse memory model simply works in those units. Even if you make a part of that range unavailable then the section will still be there. Do I make at least some sense or I am completely missing your point? -- Michal Hocko SUSE Labs