Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1207667imu; Tue, 11 Dec 2018 14:51:49 -0800 (PST) X-Google-Smtp-Source: AFSGD/XLROHYoTcV53iQBMbCOORR/C9adxWQbkQcS+L2/wYfwI1kpPaFJ58DOIz39e+9RsOpZ5G3 X-Received: by 2002:a17:902:b494:: with SMTP id y20mr18106884plr.178.1544568709689; Tue, 11 Dec 2018 14:51:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544568709; cv=none; d=google.com; s=arc-20160816; b=JUBueyyMDTGYBZi/xTc/FJjeZjxunhxP/7sJ71KGP+Rr2sx25h06ApZIFeQo96ICT6 fPydtGIhZLVBowOo+hix6/vnLalUUAuFYy9JkSDgkIu6S96ZL4pnALCP3sBhRHlUrwzz Z/FUSiAAh/FnQhUr39sd+gGHbjzM8R5CTvREc9KdCoO6dmUUj0IIrPuza247orQcKEKu zn3VWScuAc6QKCwQcl07MDNBpXZ7mfWVTMV6CazliA/W9MgXbm7J8ULTTPlmq/6zq5up UCcgipYe0CPkiN4HHlATBpFrF70rBXqddM2rpwW5f6lXuYEjwISSVY8oZ13khKr4f694 +iJw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=SyTStl/gv6OZlnF/T4Jla+zEiy1qVtn8wNdP2wBRhC0=; b=iV8nxA1l+KJRgV4SwZvMft+KQWO8oU9eliHETI3rUc4vfLntueMapdKuJtqN6duGRx SzdsjBxblCEYUg29HmHxDsnsfaTBe6hsDFXitercQ5m+zvxtaxPW3E0QtJhWXPM0Bp6H EYtA1by2dWPRp7YkgBi8CwnsRUGDmLKoSVBKj3OlXY/DWaFWcSqw3C4qceTEs2b8RcYK 8f6i+TU4pS1KEizeJU7ltAENatv5Pf8RrhGibxWRXgK09hvVz7GQZrWDFvS+ktbh0e8V IxS6IDZcsmFBLDOV6//BxpUMIHasLuBxmWoKR9lbo8uCv6TFjadbYu1eid2ZhILGdGIB SZXA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel-com.20150623.gappssmtp.com header.s=20150623 header.b=Ul4Cs0yB; 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=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 12si13953509pfx.102.2018.12.11.14.51.20; Tue, 11 Dec 2018 14:51:49 -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; dkim=pass header.i=@intel-com.20150623.gappssmtp.com header.s=20150623 header.b=Ul4Cs0yB; 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=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726281AbeLKWua (ORCPT + 99 others); Tue, 11 Dec 2018 17:50:30 -0500 Received: from mail-ot1-f45.google.com ([209.85.210.45]:34096 "EHLO mail-ot1-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726202AbeLKWua (ORCPT ); Tue, 11 Dec 2018 17:50:30 -0500 Received: by mail-ot1-f45.google.com with SMTP id t5so15820674otk.1 for ; Tue, 11 Dec 2018 14:50:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=SyTStl/gv6OZlnF/T4Jla+zEiy1qVtn8wNdP2wBRhC0=; b=Ul4Cs0yBH9puEHDVWDPnJ5NFZo7HNYXkVgvzOTGGteanMoYuOILETh8HG8X/YG6mt7 0DnWYDwGNCj6SnUZ6V8CY3VyW+2LczlfI/jpFc8vMWJVLiCnbbG7xGS4WE6rD3kBXJgl jGZVnu50F1uIHAoZMR9pdu0EM0oRbhIptv3goUSa2AmAzT/p30IRRo0BtNqQffayHM3T YVc3QcGKLcSDYW8HJi9wfPghv71fMOHXMmKaoMo1IUCdOIHc84f6I5jmtDW0KZKk5vvj pr/gz7i0vL7W5VO/PGKB0x9Ln69QnAQxbNbEA7RuaSI5K7TqxP1+hMnvfCb5stkbAmq8 FGMQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=SyTStl/gv6OZlnF/T4Jla+zEiy1qVtn8wNdP2wBRhC0=; b=pUv4bMms/BQEF1Jrw0cVBhEYNn2+pXKaqyMte91D/KFEpO55B2+67DYStz8Z+ele6U h5U2phMMccixlpKQyqOdpgxhAjoxQEJFEWUJgMNJpqU/pJNQ2BrhOExxvQGpxFl1CBwP EFTLoZGUaWgnPUicQjvd/IVxBSE0xu2PI4NgiVWD+ZHzwZ2ZetYXhq9bT+POZufJtVgD tF+qBch2o77II9kDlekWMJzbEujuJlBZ2QLtPS3SnOOW9NBWzlVY/I3gLTJOFnGLZWJT Cnq3JtTx/qUbK3OjNaFC88F3rK/KAxCNw2IWDpv1cwOpi2OHzAa8OSDWn48lFLoPYzpq LGJw== X-Gm-Message-State: AA+aEWZB1O90yvP4Hdpmk8T7cAMNCS62r+yRuzPumPpQlYvUADIoMm6O 1ROy0Zf4PmFNPyhs2cGxHIaj80f6koG5XewNtKp+hw== X-Received: by 2002:a9d:6ac2:: with SMTP id m2mr12207666otq.353.1544568629316; Tue, 11 Dec 2018 14:50:29 -0800 (PST) MIME-Version: 1.0 References: <20181211010310.8551-1-keith.busch@intel.com> <20181211010310.8551-3-keith.busch@intel.com> <20181211165518.GB8101@localhost.localdomain> <20181211204451.GD8101@localhost.localdomain> In-Reply-To: <20181211204451.GD8101@localhost.localdomain> From: Dan Williams Date: Tue, 11 Dec 2018 14:50:17 -0800 Message-ID: Subject: Re: [PATCHv2 02/12] acpi/hmat: Parse and report heterogeneous memory To: Keith Busch Cc: Linux Kernel Mailing List , Linux ACPI , Linux MM , Greg KH , "Rafael J. Wysocki" , Dave Hansen Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Dec 11, 2018 at 12:47 PM Keith Busch wrote: > > On Tue, Dec 11, 2018 at 12:29:45PM -0800, Dan Williams wrote: > > On Tue, Dec 11, 2018 at 8:58 AM Keith Busch wrote: > > > +static int __init > > > +acpi_parse_cache(union acpi_subtable_headers *header, const unsigned long end) > > > +{ > > > + struct acpi_hmat_cache *cache = (void *)header; > > > + u32 attrs; > > > + > > > + attrs = cache->cache_attributes; > > > + if (((attrs & ACPI_HMAT_CACHE_ASSOCIATIVITY) >> 8) == > > > + ACPI_HMAT_CA_DIRECT_MAPPED) > > > + set_bit(cache->memory_PD, node_side_cached); > > > > I'm not sure I see a use case for 'node_side_cached'. Instead I need > > to know if a cache intercepts a "System RAM" resource, because a cache > > in front of a reserved address range would not be impacted by page > > allocator randomization. Or, are you saying have memblock generically > > describes this capability and move the responsibility of acting on > > that data to a higher level? > > The "node_side_cached" array isn't intended to be used directly. It's > just holding the PXM's that HMAT says have a side cache so we know which > PXM's have that attribute before parsing SRAT's memory affinity. > > The intention was that this is just another attribute of a memory range > similiar to hotpluggable. Whoever needs to use it may query it from > the memblock, if that makes sense. > > > The other detail to consider is the cache ratio size, but that would > > be a follow on feature. The use case is to automatically determine the > > ratio to pass to numa_emulation: > > > > cc9aec03e58f x86/numa_emulation: Introduce uniform split capability > > Will look into that. > > > > diff --git a/include/linux/memblock.h b/include/linux/memblock.h > > > index aee299a6aa76..a24c918a4496 100644 > > > --- a/include/linux/memblock.h > > > +++ b/include/linux/memblock.h > > > @@ -44,6 +44,7 @@ enum memblock_flags { > > > MEMBLOCK_HOTPLUG = 0x1, /* hotpluggable region */ > > > MEMBLOCK_MIRROR = 0x2, /* mirrored region */ > > > MEMBLOCK_NOMAP = 0x4, /* don't add to kernel direct mapping */ > > > + MEMBLOCK_SIDECACHED = 0x8, /* System side caches memory access */ > > > > I'm concerned that we may be stretching memblock past its intended use > > case especially for just this randomization case. For example, I think > > memblock_find_in_range() gets confused in the presence of > > MEMBLOCK_SIDECACHED memblocks. > > Ok, I see. Is there a better structure or interface that you may recommend > for your use case to identify which memory ranges contain this attribute? Well, no I don't think there is one. We just need to either audit existing memblock users to make sure they are prepared for this new type, or move the cache information somewhere else. I'd be inclined to just move it to new fields, or a sub-struct in struct memblock_region. Then we can put the cache set-way info and near memory size information in there as well. Likely need a new CONFIG_HAVE_MEMBLOCK_CACHE_INFO gated by the presence of HMAT support.