lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Fri, 10 Aug 2018 21:32:37 +0200
From:   Oscar Salvador <osalvador@...hadventures.net>
To:     Rashmica Gupta <rashmica.g@...il.com>
Cc:     Michal Hocko <mhocko@...nel.org>,
        Andrew Morton <akpm@...ux-foundation.org>, toshi.kani@....com,
        tglx@...utronix.de, bp@...e.de, brijesh.singh@....com,
        thomas.lendacky@....com, jglisse@...hat.com,
        gregkh@...uxfoundation.org, baiyaowei@...s.chinamobile.com,
        dan.j.williams@...el.com, iamjoonsoo.kim@....com,
        Vlastimil Babka <vbabka@...e.cz>, malat@...ian.org,
        Bjorn Helgaas <bhelgaas@...gle.com>, yasu.isimatu@...il.com,
        linux-kernel@...r.kernel.org, linux-mm@...ck.org,
        Mike Rapoport <rppt@...ux.vnet.ibm.com>
Subject: Re: [PATCH v3] resource: Merge resources on a node when hot-adding
 memory

On Sat, Aug 11, 2018 at 12:25:39AM +1000, Rashmica Gupta wrote:
> On Fri, Aug 10, 2018 at 11:00 PM, Michal Hocko <mhocko@...nel.org> wrote:
> > On Fri 10-08-18 16:55:40, Rashmica Gupta wrote:
> > [...]
> >> Most memory hotplug/hotremove seems to be block or section based, and
> >> always adds and removes memory at the same place.
> >
> > Yes and that is hard wired to the memory hotplug code. It is not easy to
> > make it work outside of section units restriction. So whatever your
> > memtrace is doing and if it relies on subsection hotplug it cannot
> > possibly work with the current code.
> >
> > I didn't get to review your patch but if it is only needed for an
> > unmerged code I would rather incline to not merge it unless it is a
> > clear win to the resource subsystem. A report from Oscar shows that this
> > is not the case though.
> >
> 
> Yup, makes sense. I'll work on it and see if I can not break things.

In __case__ we really need this patch, I think that one way to fix this is
to only call merge_node_resources() in case the node is already online.
Something like this (completely untested):

+struct resource *request_resource_and_merge(struct resource *parent,
+                                           struct resource *new, int nid)
+{
+       struct resource *conflict;
+
+       conflict = request_resource_conflict(parent, new);
+
+       if (conflict)
+               return conflict;
+
+#ifdef CONFIG_MEMORY_HOTREMOVE
+       /* We do not need to merge any resources on a node that is being
+        * hot-added together with its memory.
+	 * The node will be allocated later.
+	 */
+       if (node_online(nid))
+       	merge_node_resources(nid, parent);
+#endif /* CONFIG_MEMORY_HOTREMOVE */

Although as Michal said, all memory-hotplug code is section-oriented, so
whatever it is that interacts with it should expect that.
Otherwise it can fail soon or later.

-- 
Oscar Salvador
SUSE L3

Powered by blists - more mailing lists