Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1106191imu; Tue, 11 Dec 2018 12:49:44 -0800 (PST) X-Google-Smtp-Source: AFSGD/V1jSy4u+1EfVwQvGK4sxRiKlJz4ulaXiUaFfdiukTzTJdLf1/g+Nb+ShvwR86wlCjG3E81 X-Received: by 2002:a17:902:7044:: with SMTP id h4mr17225801plt.35.1544561384135; Tue, 11 Dec 2018 12:49:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544561384; cv=none; d=google.com; s=arc-20160816; b=J5f9NuJV575mJYbQN4SZNlkIWTVgB4mN2ckAR2XPT5B1IbxxHEJH8kvdchvCZormt0 LXDof2nLOn7ckT6d1QTY3ES+o8nIgbzaWdADUQhDbCz/qxjaGOIO4GfdTs8PR1z/SXeP 3Pl9/C8pLZ6ZNXW03eIUJ7Z5eZT47Laja7dEFIMbvh7JPNbLqZSy4ctHzfgKiSfv2mwa jlZkOgHUQz9dpbR0w0g1OqMMTLIgawlHZn7Vkyn98vCl/QehZ/f2Q+ukTLosNyNWolhO AAPgJX3XFlVzLrcw11HEbYSPThlbhqvs07SO/IOfdzMPGpQyq78lI/voxVLkzOD+etJ/ 2L6g== 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=ZJdJTqPLmjScGdW4BJobN3mnLW3uNgQdE/iloGtMzdQ=; b=tETwBo3pZ66e9+h5BTf+u66kCobp67t/Dw4ic/bJOrNiro4yxoHYOFbI+kbKYsJ62G fJYfpDgY0X1W2sgNCHQarseOf/wYESckxFerjVhrGh9E+I+BiFL5frC1j+7bV/o4h2kO z4UrYFKf3tlP6OoZ1MRwBKxMpIE0Z9z+ssR0NZVf7V3QiOgszXBtcEUlNs921hXnPVIl zL6vmbehOYPA/WiuF7emYIEtCtfCZVtNb2s1NzVRQkLnGitzSFOHOPU/7kducnjXvoU8 DK+1NpLSo0CUfxI9+PdmiGyL/Y2H7icS/7XG0jtHnRbznr2nX1HrX0kE7ceuyBfmfNe8 +WlA== 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=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c32si13521885plj.38.2018.12.11.12.49.20; Tue, 11 Dec 2018 12:49:44 -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=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726327AbeLKUrW (ORCPT + 99 others); Tue, 11 Dec 2018 15:47:22 -0500 Received: from mga12.intel.com ([192.55.52.136]:36258 "EHLO mga12.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726136AbeLKUrW (ORCPT ); Tue, 11 Dec 2018 15:47:22 -0500 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 11 Dec 2018 12:47:22 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.56,343,1539673200"; d="scan'208";a="97976642" Received: from unknown (HELO localhost.localdomain) ([10.232.112.69]) by orsmga007.jf.intel.com with ESMTP; 11 Dec 2018 12:47:21 -0800 Date: Tue, 11 Dec 2018 13:44:51 -0700 From: Keith Busch To: Dan Williams Cc: Linux Kernel Mailing List , Linux ACPI , Linux MM , Greg KH , "Rafael J. Wysocki" , Dave Hansen Subject: Re: [PATCHv2 02/12] acpi/hmat: Parse and report heterogeneous memory Message-ID: <20181211204451.GD8101@localhost.localdomain> References: <20181211010310.8551-1-keith.busch@intel.com> <20181211010310.8551-3-keith.busch@intel.com> <20181211165518.GB8101@localhost.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.1 (2017-09-22) 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: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?