Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp5519737ybi; Tue, 30 Jul 2019 22:38:17 -0700 (PDT) X-Google-Smtp-Source: APXvYqzefkek/UO0Qrl7IuMbiFQTA6VjLVI9/3KvIzzUcAfH47onkqh0EREskfgKJ2R9zks15jwZ X-Received: by 2002:a17:902:ab83:: with SMTP id f3mr118556157plr.122.1564551497772; Tue, 30 Jul 2019 22:38:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564551497; cv=none; d=google.com; s=arc-20160816; b=KdFQpOIQngKAO2sV6QjIWV6fJOW+LcZfepdT5hBIv6ROUwhq50Z1DpWmTWHKfW5/vl VCUVlAtous4JjRdRqj8BC6y2gNsfypOmTbxTi5ivVe932ji72JGRRb9dK93RXy4X8HKe rJ5XQ/oRN+8yk9vfjUPCz8F/TynsKJxeuhR5C1Lzf1oAyLJgrErL8KQctRDMVLb6Xzpb GqvfibEkr9YRKlk95stZ7Q2x5r7ES+KYKe2PFfhqH9EzsHKzf2bTBdDprpU0oSF5YyD1 4Eti/aH2ZttKbZ80kH8wjgdB5oDXsIT+fswf6oXSNON3CEjtaT97xDFAEjcM6GtuN7gD N1OQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:date:cc:to:from:subject :message-id:dkim-signature; bh=wfO9r2YHzfXnuX5Kr+rPkjXbDXK210fTn6hrztawxZ0=; b=u4IX5lw/ZOR2T6nj/qrUlPwo6yyMwhbRUJyPbRM6++E3Pgjf8KFoYDWIrfcE8yfvlC 5k/Ojjv4X/39E3nagV2cWOJbALmCB6U5mmnl+7sz7UzO819up37le2lE8GFSeRLypXND XYx2gXX4e8kRb7hWdSdKI/awXjuZi0ivK1ThTjXC++SfKyBelenTOXAFt6MBBnFBMqaf jFsl+Zzaz8tp8lnoI3Vh8HG3gPTMlT1ZGrm2vNYhXhZn9YFI9Qv8FRUzhNkAE/oojCOb LwWy0PYRmpUMGOmmKqLOMjQl3pRya8egUYH9STJWQWrqShhyIMbFkKf0hO7BFth2BLPz pLyg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Z0cwZYY6; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l36si5240517pgb.292.2019.07.30.22.38.02; Tue, 30 Jul 2019 22:38:17 -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=pass header.i=@gmail.com header.s=20161025 header.b=Z0cwZYY6; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728189AbfGaCVY (ORCPT + 99 others); Tue, 30 Jul 2019 22:21:24 -0400 Received: from mail-pf1-f195.google.com ([209.85.210.195]:34691 "EHLO mail-pf1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725913AbfGaCVX (ORCPT ); Tue, 30 Jul 2019 22:21:23 -0400 Received: by mail-pf1-f195.google.com with SMTP id b13so30910532pfo.1 for ; Tue, 30 Jul 2019 19:21:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=message-id:subject:from:to:cc:date:in-reply-to:references :user-agent:mime-version:content-transfer-encoding; bh=wfO9r2YHzfXnuX5Kr+rPkjXbDXK210fTn6hrztawxZ0=; b=Z0cwZYY6NB9z3AeRFZ5F9ivrbekqwqA754MYg0lxZjoYmmBYsJ/Bl5wHSjCKN2LKBb RiVb5ZqBigEi4yXwuIOEc+nJm9XYTqh9pkF3ES4VOLOnLst2nENuMZ5bG6Gbp4kPWl+X o4vpIC701znWr7RpZaoEqbr+/iYRHbkWllXL4o2GCx4fis/KCQhsrL0vYoZ88J5Amasj iNC5H8rZr6XTCcyOtcWZGOYJ5RxHa4DpWz9b98qFzLk7iUJODCPdexNE2tz+I6fQfbhv ZQ7hTkO3HvNNx1onQLjN+IFoG63qcYI0uegXN2aKkbVSDUnES9G0m5qhEHNx+/x5H/1A Rntw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:subject:from:to:cc:date:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=wfO9r2YHzfXnuX5Kr+rPkjXbDXK210fTn6hrztawxZ0=; b=HqpF6FlAzMdD7p5txEvNaEk/R5REOLLd4RfhqbbUKjc1WoFKO9VR9astgxIYu5tIbT JjZkCMM/5KZk5ixrw9Yk01fu8GiU86L/WZ3Yv45BHjYPbeiowomveu4gyPpVUEWpbjYC gAkyAibTxEv2cosjSTNew5gwjFPKlkJlHv5C2khjpieEMzHr3869Z3SICmX8Au9syEZo sXdXU+wnogN8N57ulF0/jqbS+ugPwWIeh24BZ8B8d7vmparf3IF5f7eC6wDCgyylIP+6 1DwaiLdshohrvRwAOIk2k/bFwmUOVDnACIUgdbm5WRRzblGJGcbt7e2AkaQ0iSLKie/c XRuw== X-Gm-Message-State: APjAAAXZDk7ETevefH1dHS28MOoNiT0UBWil1SN3Fuscqx2b0FkZAg+o qUgXCqA6lQWq74X7UyMTtEI= X-Received: by 2002:a62:14c4:: with SMTP id 187mr43672529pfu.241.1564539683105; Tue, 30 Jul 2019 19:21:23 -0700 (PDT) Received: from rashmica.ozlabs.ibm.com ([122.99.82.10]) by smtp.googlemail.com with ESMTPSA id e11sm79504488pfm.35.2019.07.30.19.21.19 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Tue, 30 Jul 2019 19:21:22 -0700 (PDT) Message-ID: <7c49e493510ce04371d8d6cd6c436c347b1f8469.camel@gmail.com> Subject: Re: [PATCH v2 0/5] Allocate memmap from hotadded memory From: Rashmica Gupta To: David Hildenbrand , Oscar Salvador Cc: akpm@linux-foundation.org, mhocko@suse.com, dan.j.williams@intel.com, pasha.tatashin@soleen.com, Jonathan.Cameron@huawei.com, anshuman.khandual@arm.com, vbabka@suse.cz, linux-mm@kvack.org, linux-kernel@vger.kernel.org Date: Wed, 31 Jul 2019 12:21:16 +1000 In-Reply-To: References: <20190625075227.15193-1-osalvador@suse.de> <2ebfbd36-11bd-9576-e373-2964c458185b@redhat.com> <20190626080249.GA30863@linux> <2750c11a-524d-b248-060c-49e6b3eb8975@redhat.com> <20190626081516.GC30863@linux> <887b902e-063d-a857-d472-f6f69d954378@redhat.com> <9143f64391d11aa0f1988e78be9de7ff56e4b30b.camel@gmail.com> <0cd2c142-66ba-5b6d-bc9d-fe68c1c65c77@redhat.com> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.30.5 (3.30.5-1.fc29) MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 2019-07-29 at 10:06 +0200, David Hildenbrand wrote: > > > Of course, other interfaces might make sense. > > > > > > You can then start using these memory blocks and hinder them from > > > getting onlined (as a safety net) via memory notifiers. > > > > > > That would at least avoid you having to call > > > add_memory/remove_memory/offline_pages/device_online/modifying > > > memblock > > > states manually. > > > > I see what you're saying and that definitely sounds safer. > > > > We would still need to call remove_memory and add_memory from > > memtrace > > as > > just offlining memory doesn't remove it from the linear page tables > > (if > > it's still in the page tables then hardware can prefetch it and if > > hardware tracing is using it then the box checkstops). > > That prefetching part is interesting (and nasty as well). If we could > at > least get rid of the manual onlining/offlining, I would be able to > sleep > better at night ;) One step at a time. > What are your thoughts on adding remove to state_store in drivers/base/memory.c? And an accompanying add? So then userspace could do "echo remove > memory34/state"? Then most of the memtrace code could be moved to a userspace tool. The only bit that we would need to keep in the kernel is setting up debugfs files in memtrace_init_debugfs.