Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp1969336imm; Sat, 4 Aug 2018 15:29:59 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdCUNe79mtZxBNoFmr4jEf++pNUbMAG0oWFZ8/B6xUz1aDaOnSzUSQZ7oBSwf8jbFIQrR6Q X-Received: by 2002:a63:9f0a:: with SMTP id g10-v6mr9015300pge.324.1533421799501; Sat, 04 Aug 2018 15:29:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533421799; cv=none; d=google.com; s=arc-20160816; b=iFu0KBOT/kqPWuc5MarB4hBaQk7BD0HvPYgT2gntpOPmoWMEcPyBiwU8MU4UfOXJAB vqsmSvSNxxX77SwRQ3fB+cltg2881sWY3dQa3VkPzB2TRbg4EZh6S2Tae0VBrOsPKs4I +4PQDEUFllZh3tfB26aOR0cf2XQaMUw0kvjyj2kpJlPn93MGRCMra5k9kKvXdMOJt+rw t4CDeJADxiIDilLaE38OYds0/fxlh+RQjfRKYSlFj5Kad0XfmX5zHntu/EsnurR6KhdJ PNkzSaXhw5CWyabrF5PjtHUR/M1QjmtoP/dAG5Bq8DZq9jjKZDy2yPhhyX5M/0y1Uwo1 MfIg== 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:dkim-signature:arc-authentication-results; bh=szJdlIA4K2JhXIT1uFendEgVsZjjT5okEg94tAFG6+8=; b=dO+3oUoG/KmWl28S+sHfZeVo5BsIjH3MyzDHwzA7qzkS/6B7rVamKczcr+gsz+DxU7 QurvdfUaXzKR4ZGjg1GVC2KUGF75+dErUC4lrm/KyDpoFUZgpSabcc8MV2o2U762kwn9 YU+WIFBnxDyk1PecOm6Ems19UcuPRBOoeWMuom3MoUkqa3lpkCOrt8c3axU1Ls9ar6Ik BWYSHnqLa55ofyp2sTYHFi7qhvYfr9zL/sQ8lj0M46mrblNhkkndbhc7t6/R90irrInp ohXsFE/vRXUwaaxM1tHRO559tHLwTDS9LEPrK8jL0gLqgiwPfbIsBKD4NRo4hbMP4mKB aoEw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=kxtL2tAS; 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 w1-v6si9401198pfl.215.2018.08.04.15.29.34; Sat, 04 Aug 2018 15:29:59 -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=kxtL2tAS; 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 S1729693AbeHEAaX (ORCPT + 99 others); Sat, 4 Aug 2018 20:30:23 -0400 Received: from mail-pg1-f193.google.com ([209.85.215.193]:32970 "EHLO mail-pg1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728889AbeHEAaX (ORCPT ); Sat, 4 Aug 2018 20:30:23 -0400 Received: by mail-pg1-f193.google.com with SMTP id r5-v6so4499782pgv.0 for ; Sat, 04 Aug 2018 15:28:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=szJdlIA4K2JhXIT1uFendEgVsZjjT5okEg94tAFG6+8=; b=kxtL2tASejAEzEgizI6BBYgEoCLwgFVCh8hzbp0cIK/1hnpV6dQxuR9ywpgh4lA8W6 fEFSgGPVei0HcWypWOir918zM9jasyAvMwGuEBLcK5ERWek3m22QY2VFzGRiUtvYqInt tBq9Gj2+EPv0C1YVghKvcJ+n1jQyioI4kRrWFeiiLFstjOp/Hh2CMJ886yoq1CHS9dMG 0DbADNl/RH2lhMv2jpMaTUDCQ0fNwKy6T6PiJPCePG90x0aQpBiC7+t3lUR7Re9Hr0fx jW2GfT0qM1dkGyRsTp6ZO0jOgfrO6u/hm4ZHdlm1iuw8U42NmIs0SEiwllcuM4cL7ifd PJDQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=szJdlIA4K2JhXIT1uFendEgVsZjjT5okEg94tAFG6+8=; b=dEL7sb8O08OAauXlzZWS8awQdEV1ck9JuEIJM5aG8A/zSzCC8ObL3s5n+B6kE08hC7 Ly/vpjwSIi5iC9tiQ6syaCnXVg1TO7APTkzJbbc8noOG0uRe+EtncRGaQ80k05BGwqvC Abp1C4vIaotfM5k9zk/6ERFP97GjRUhlixX6iJ56AURbCaJ8ukoVGp8UKxSkXFltKQf6 zDWXw3QFmg+aNWDgwWEmzGxrGlaYr5nZ609d6gEFHq4/A7+Oq6ExSv/UV6x6AokGsH6G UXnrS9bfM28za2u0I5UdpZaDApGjong0X9s8wJ7xiDvv9kwQLVQPoOOj0lvwNMdudHma r6Zw== X-Gm-Message-State: AOUpUlHuc1TX3CTRGriA8bjNHTSW4m/qpoxU6fvIsUusVp0UxkzBOkJk eR4uv+GBkfngqBjaHcuViK8= X-Received: by 2002:a63:614d:: with SMTP id v74-v6mr8882194pgb.328.1533421691217; Sat, 04 Aug 2018 15:28:11 -0700 (PDT) Received: from localhost (108-223-40-66.lightspeed.sntcca.sbcglobal.net. [108.223.40.66]) by smtp.gmail.com with ESMTPSA id g7-v6sm11063598pfi.175.2018.08.04.15.28.09 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 04 Aug 2018 15:28:09 -0700 (PDT) Date: Sat, 4 Aug 2018 15:28:08 -0700 From: Guenter Roeck To: Rik van Riel Cc: linux-kernel@vger.kernel.org, x86@kernel.org, luto@kernel.org, efault@gmx.de, kernel-team@fb.com, mingo@kernel.org, dave.hansen@intel.com, Guan Xuetao Subject: Re: [PATCH 1/7] mm: allocate mm_cpumask dynamically based on nr_cpu_ids Message-ID: <20180804222808.GA8011@roeck-us.net> References: <20180716190337.26133-1-riel@surriel.com> <20180716190337.26133-2-riel@surriel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180716190337.26133-2-riel@surriel.com> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jul 16, 2018 at 03:03:31PM -0400, Rik van Riel wrote: > The mm_struct always contains a cpumask bitmap, regardless of > CONFIG_CPUMASK_OFFSTACK. That means the first step can be to > simplify things, and simply have one bitmask at the end of the > mm_struct for the mm_cpumask. > > This does necessitate moving everything else in mm_struct into > an anonymous sub-structure, which can be randomized when struct > randomization is enabled. > > The second step is to determine the correct size for the > mm_struct slab object from the size of the mm_struct > (excluding the cpu bitmap) and the size the cpumask. > > For init_mm we can simply allocate the maximum size this > kernel is compiled for, since we only have one init_mm > in the system, anyway. > > Pointer magic by Mike Galbraith, to evade -Wstringop-overflow > getting confused by the dynamically sized array. > > Signed-off-by: Rik van Riel > Signed-off-by: Mike Galbraith > Signed-off-by: Rik van Riel > Acked-by: Dave Hansen > Tested-by: Song Liu Hi, this patch causes unicore32 build failures. In file included from include/linux/mm.h:17, from arch/unicore32/kernel/asm-offsets.c:17: include/linux/mm_types.h:497: error: flexible array member in otherwise empty struct Build reference: next-20180803 gcc version: unicore32-linux-gcc (UC4_1.0.5_20100917) 4.4.2 I understand this is an old compiler, but it is the only available version as far as I know. Guenter