Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp5940047imm; Mon, 23 Jul 2018 08:36:52 -0700 (PDT) X-Google-Smtp-Source: AAOMgpeoUGY9FmiikpY7+pfm7/lp3BHHCl1nQPy7tq2OZu6HnZpennOUfLXumRu7KnvzL5DIEJTm X-Received: by 2002:a63:3f05:: with SMTP id m5-v6mr12593231pga.51.1532360212234; Mon, 23 Jul 2018 08:36:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532360212; cv=none; d=google.com; s=arc-20160816; b=qheTnyS9LopRDMHJ8xHM2hoyoX4LZiEUlutpIpK5XKv/UPI9wkhaPkdZeSlAP9rn0x 6p5LHBKcHeTAZUz34p7pFS15MTff1J04gGjhvlxOLbXOzAyOLjn05bWgrFDl1ongxwY0 7NmXBvYAUqhxS38G9cxDRLeoCWq7WKPN3HYow1iquRx1awfFUEQBRbxcfvpdcE0gzjsW E7yWVBKFrHPNGsKyRzxJ5vn1HHhpHHfnQpP45/jupKOde49ucgC89IL7A1nLn71e0Zyy fkTM9UdCkxI0Fq/agq+XicQj+aotJJMwDO5BHYIO3AkfYx0hoo0TxiJZ7zF1U9dluzf+ 31mQ== 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 :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=jOXEUEwojPSzHZIAs2rWvCfXbQ5Gp38MYhPZNpsoJKk=; b=kZDaFK2axcQx+jC0rRA8I0bpCMHtTgqw6ek+ADvWqQlEhp1yOPlghfd2CQqCUno/ki 3AwCjcrHYSgq7ye3F4kLgC9wpmt1zNCMYcybhBSB8eRRJwksxZn3yNnyOqO8AxhjvD4W y3ENpRegD910dln604tAVLCzbEL0IOdFXI6mqELqwS0z/Zt9p1bi7fgMGcKwoeJm1PmR 6/EJvcSd4aCI/aBTgu4RpRF2SLRyxXR3ohdSjKDP4/We0UtJTZJwSK3UntGRtAjmU1ep JBEpPny2NhdClfdvEB+d3B+6MKllJk0x1JdENKCjGO8DYZZ81SzJS1/2bl9/U7/3j+gM dFTw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=E7ahjsC4; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q8-v6si8725460pfh.353.2018.07.23.08.36.36; Mon, 23 Jul 2018 08:36:52 -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=fail header.i=@gmail.com header.s=20161025 header.b=E7ahjsC4; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388521AbeGWQhY (ORCPT + 99 others); Mon, 23 Jul 2018 12:37:24 -0400 Received: from mail-qt0-f195.google.com ([209.85.216.195]:39141 "EHLO mail-qt0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387995AbeGWQhX (ORCPT ); Mon, 23 Jul 2018 12:37:23 -0400 Received: by mail-qt0-f195.google.com with SMTP id q12-v6so1035603qtp.6; Mon, 23 Jul 2018 08:35:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=jOXEUEwojPSzHZIAs2rWvCfXbQ5Gp38MYhPZNpsoJKk=; b=E7ahjsC4oB1RgvOCKCDGsvgZOzzE3v836tRhPyESNbXSQ5SjmToZHNyOtFXJ5iz2lL yESOr/t/eF0ErNvhtYteGkSl8AmvXBCegyGeM58J97CxWJ9BfPKNn2pQo09xTfYvsoLQ 033p3HydsU0OAjhOe0rJrnGu+cFbRqo21ccSK5fMYjYxXcuDNm/XJ2X/Kyh4ak6y4uQu kL2JY4u9KhmYjj43laWPiZ2dY5H8jTjvSrDd8L3mcMt+Jehb4hMhSsoa6SC8N+Qq1gMd vgd7N/nIat264gj88ifitkR9fqkvlRMr1Y2vzX1q5lo1gDporGKkZBH2qHqBI/i+S1v7 3UpA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=jOXEUEwojPSzHZIAs2rWvCfXbQ5Gp38MYhPZNpsoJKk=; b=Ok4Tg4Fqor598M6FEwB7W0FI0i3iETmQOtDmKeWEZ9x84WafCYoUwqGVuwhjzh7e0q d+umg2I5Z7T0gdt4zMOC4pfSoZ0DYL/SHD2YokeurR9N0cy2hEPMNQXl2YdmQ9hisbsT lUqd9d40vsRMS+PlpL9Vbzx2j5faxekcjAIUCe2MBLaqkQDc5DchgKJ7eMf9v9UBST3D RO+SgNm5wGm6qs29UtmgIKRYqZaQg9yrpysE9vWKP6u5RTbfWHprEMT8NxGlWpg23i8Q C8w68eT+BhK9qAPxrOwBqWJxTCd3kGDNhl4675q92L0cXeuPu8mk0S3f9p8e2k/jtVZh FY+w== X-Gm-Message-State: AOUpUlGceGdFIKT73I8bywSgTyZusRJ/k+5FxcuA4SLG/IT27d2xYJNn 1N/vd7BMCCkCtVYr3HATyz1499JImsWpObwUM6y+CGW2 X-Received: by 2002:a0c:93b3:: with SMTP id f48-v6mr11565970qvf.151.1532360136182; Mon, 23 Jul 2018 08:35:36 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a0c:967d:0:0:0:0:0 with HTTP; Mon, 23 Jul 2018 08:35:35 -0700 (PDT) In-Reply-To: <20180723152323.GA3699@cmpxchg.org> References: <20180712172942.10094-1-hannes@cmpxchg.org> <20180712172942.10094-3-hannes@cmpxchg.org> <20180723152323.GA3699@cmpxchg.org> From: Arnd Bergmann Date: Mon, 23 Jul 2018 17:35:35 +0200 X-Google-Sender-Auth: K95sfbcux0lEyNv44XcMpv7ZYwk Message-ID: Subject: Re: [PATCH 02/10] mm: workingset: tell cache transitions from workingset thrashing To: Johannes Weiner Cc: Peter Zijlstra , Suren Baghdasaryan , Mike Galbraith , Will Deacon , Linux Kernel Mailing List , kernel-team@fb.com, Linux-MM , Vinayak Menon , Ingo Molnar , Shakeel Butt , Catalin Marinas , Tejun Heo , cgroups@vger.kernel.org, Andrew Morton , Linus Torvalds , Christopher Lameter , Linux ARM 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 Mon, Jul 23, 2018 at 5:23 PM, Johannes Weiner wrote: > On Mon, Jul 23, 2018 at 03:36:09PM +0200, Arnd Bergmann wrote: >> On Thu, Jul 12, 2018 at 7:29 PM, Johannes Weiner wrote: >> In file included from /git/arm-soc/include/linux/kernel.h:10, >> from /git/arm-soc/arch/arm64/mm/init.c:20: >> /git/arm-soc/arch/arm64/mm/init.c: In function 'mem_init': >> /git/arm-soc/include/linux/compiler.h:357:38: error: call to >> '__compiletime_assert_618' declared with attribute error: BUILD_BUG_ON >> failed: sizeof(struct page) > (1 << STRUCT_PAGE_MAX_SHIFT) > > This BUILD_BUG_ON() is to make sure we're sizing the VMEMMAP struct > page array properly (address space divided by struct page size). > > From the code: > > /* > * Log2 of the upper bound of the size of a struct page. Used for sizing > * the vmemmap region only, does not affect actual memory footprint. > * We don't use sizeof(struct page) directly since taking its size here > * requires its definition to be available at this point in the inclusion > * chain, and it may not be a power of 2 in the first place. > */ > #define STRUCT_PAGE_MAX_SHIFT 6 > ... > However, the check isn't conditional on that config option. And when > VMEMMAP is disabled, we need 22 additional bits to identify the sparse > memory sections in page->flags as well: > >> CONFIG_NODES_SHIFT=2 >> # CONFIG_ARCH_USES_PG_UNCACHED is not set >> CONFIG_MEMORY_FAILURE=y >> CONFIG_IDLE_PAGE_TRACKING=y >> >> #define MAX_NR_ZONES 3 >> #define ZONES_SHIFT 2 >> #define MAX_PHYSMEM_BITS 52 >> #define SECTION_SIZE_BITS 30 >> #define SECTIONS_WIDTH 22 > > ^^^ Those we get back with VMEMMAP enabled. > > So for configs for which the check is intended, it passes. We just > need to make it conditional to those. Ok, thanks for the analysis, I had missed that and was about to send a different patch to increase STRUCT_PAGE_MAX_SHIFT in some configurations, which is not as good. > From 1d24635a6c7cd395bad5c29a3b9e5d2e98d9ab84 Mon Sep 17 00:00:00 2001 > From: Johannes Weiner > Date: Mon, 23 Jul 2018 10:18:23 -0400 > Subject: [PATCH] arm64: fix vmemmap BUILD_BUG_ON() triggering on !vmemmap > setups > > Arnd reports the following arm64 randconfig build error with the PSI > patches that add another page flag: > You could add further text here that I had just added to my patch description (not sent): Further experiments show that the build error already existed before, but was only triggered with larger values of CONFIG_NR_CPU and/or CONFIG_NODES_SHIFT that might be used in actual configurations but not in randconfig builds. With longer CPU and node masks, I could recreate the problem with kernels as old as linux-4.7 when arm64 NUMA support got added. Cc: stable@vger.kernel.org Fixes: 1a2db300348b ("arm64, numa: Add NUMA support for arm64 platforms.") Fixes: 3e1907d5bf5a ("arm64: mm: move vmemmap region right below the linear region") > arch/arm64/mm/init.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/arch/arm64/mm/init.c b/arch/arm64/mm/init.c > index 1b18b4722420..72c9b6778b0a 100644 > --- a/arch/arm64/mm/init.c > +++ b/arch/arm64/mm/init.c > @@ -611,11 +611,13 @@ void __init mem_init(void) > BUILD_BUG_ON(TASK_SIZE_32 > TASK_SIZE_64); > #endif > > +#ifndef CONFIG_SPARSEMEM_VMEMMAP > /* I tested it on two broken configurations, and found that you have a typo here, it should be 'ifdef', not 'ifndef'. With that change, it seems to build fine. Tested-by: Arnd Bergmann Arnd