Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp826557pxk; Thu, 17 Sep 2020 18:07:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzottSyEipzm3yN/7c0fa9p4xIQdu05u+WnsjQzkg+nYSPdQ30GUIToQ6FN7NvE4Y9lAy8a X-Received: by 2002:a05:6402:12d1:: with SMTP id k17mr35129405edx.323.1600391262468; Thu, 17 Sep 2020 18:07:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600391262; cv=none; d=google.com; s=arc-20160816; b=cSWLh0tqMMdMYeolyGgLhVX/IrPQAjmH7KV7Zw4/53ZM1dPQA9zdZV7Xs2LuHFmA48 e1YuTwtxIkbooCL/pFwiQY7nk1ZvK6qcVxcBSu7yWhXKhMV0n4usFT2pZaQ/PvVGGK1u gNg0k5zmIRUAtaP4xLAUE8igUartkj3LbJ7f7kZLGw5YDvAZMWG0XGj1CHlMblF6sZY0 vVOYZuQEcQQXN6KAXta0LUhgfam6NIolBgBgsUtJepygzCxrY1OpKrhsiTQti+KsumvV BEq5a/vTHGqI55Z5cpxtN0MlU2IMXFraxBsWLQdWQ8skuMJgzpTOq9yGZmaStE+/1SiX 538A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=v6mUxr+o/bBCyV21PhBy9xwq4Kx+o7EoQqU8t/ozEuU=; b=d4wuvwFA1yy8sGR0EWFGsf63woE0iGNRvSHLhPucPvT5nELL5lVZgvjyxUP0f5XtjO eccVeGfbH7xOrKSvrzLHXX/4wHrV5iYUV7XKxYjx6yrjtuqorP/e5viQxzuWOOOFiO+J ktVlX35dVD93EAImN61Ca3hJXMATGp9YIPlHzuYmJs/0VC5+10+G92uxC2kXn+W7+diO g7tJeheiwYNlNcZJzXEkbM190exnpoHDvIXWBnU8iYI/y5Y/F0UIqHvc290M42iDIa7E zR8lXa5ZCSkJH0hgOvfsD+YH/xoSe+2LYL6MnGTROQS7tnH15Kxp/nNQHjk9+3yJiMhE gY7g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=LAR1j2h0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h1si945601edt.106.2020.09.17.18.07.19; Thu, 17 Sep 2020 18:07:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=LAR1j2h0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726189AbgIRBFh (ORCPT + 99 others); Thu, 17 Sep 2020 21:05:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44546 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726040AbgIRBFh (ORCPT ); Thu, 17 Sep 2020 21:05:37 -0400 Received: from mail-lf1-x142.google.com (mail-lf1-x142.google.com [IPv6:2a00:1450:4864:20::142]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4732BC06174A for ; Thu, 17 Sep 2020 18:05:37 -0700 (PDT) Received: by mail-lf1-x142.google.com with SMTP id b22so4217753lfs.13 for ; Thu, 17 Sep 2020 18:05:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=v6mUxr+o/bBCyV21PhBy9xwq4Kx+o7EoQqU8t/ozEuU=; b=LAR1j2h0gElCIkPlU8F1qMcYFmqxHfKZcMuQJTE5hBIWM/sdoqNYy6WEWnMKSyhFii DaG10gEB6IHCkFTxf7XhMBA9O1m0l7KAbS+rPt4YmT1yohTQC8dXk0Q+8tQIN+DCc3Y6 xJ3dHBzw7ljYGfemeNOEI4CHfeZdRDdNd1s2A= 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=v6mUxr+o/bBCyV21PhBy9xwq4Kx+o7EoQqU8t/ozEuU=; b=BcdKMhbvXlNDLhRS/uCU/iB/prHu2L+UPjtvcdckoVBbEDNRlbXPyUrcQYmAzQsffn ux0ZSew1/6dGXVlC5wRnpltFQ5/RBT6ffiZUa/ahVMmioSmgPSF34MC+Ne91d57b140R No3ZdmmodylgfKZ/KsdbxwV8Pd4QWpumCCTVttm/JHBm/iTztJlCCetZdVWQKY9O8Ewu Ug2h7h4Xq1VZ4zZLama0GSX6WoM8XA++uzE4uI0Mzo6cZ3wmn0pKWSNlBorMdjrTXCgC tyBSEvqclKBfEiwVoVslyk3+bWsHkdyBlVtr4WfrI1Y3YY18qNEMBPo1L/SMZ0GGPAPI XgYQ== X-Gm-Message-State: AOAM533u8LWBVLcml5hWjqOhT7mJ+bQZhvPXU4swb3IjE8zRHs56ZZ3K P++kGLl5tYQ/CZkD6J2eocqeqk0U3F4tiQ== X-Received: by 2002:a19:4083:: with SMTP id n125mr9682406lfa.270.1600391135178; Thu, 17 Sep 2020 18:05:35 -0700 (PDT) Received: from mail-lf1-f43.google.com (mail-lf1-f43.google.com. [209.85.167.43]) by smtp.gmail.com with ESMTPSA id w4sm240282lff.231.2020.09.17.18.05.29 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 17 Sep 2020 18:05:30 -0700 (PDT) Received: by mail-lf1-f43.google.com with SMTP id b12so4233112lfp.9 for ; Thu, 17 Sep 2020 18:05:29 -0700 (PDT) X-Received: by 2002:ac2:5594:: with SMTP id v20mr10817292lfg.344.1600391129661; Thu, 17 Sep 2020 18:05:29 -0700 (PDT) MIME-Version: 1.0 References: <20200917204514.GA2880159@google.com> In-Reply-To: <20200917204514.GA2880159@google.com> From: Linus Torvalds Date: Thu, 17 Sep 2020 18:05:13 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [GIT PULL] percpu fix for v5.9-rc6 To: Dennis Zhou , "Gustavo A. R. Silva" Cc: Tejun Heo , Christoph Lameter , Linux-MM , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Sep 17, 2020 at 1:45 PM Dennis Zhou wrote: > > > diff --git a/mm/percpu.c b/mm/percpu.c > index f4709629e6de..1ed1a349eab8 100644 > --- a/mm/percpu.c > +++ b/mm/percpu.c > @@ -1316,7 +1316,7 @@ static struct pcpu_chunk * __init pcpu_alloc_first_chunk(unsigned long tmp_addr, > > /* allocate chunk */ > alloc_size = sizeof(struct pcpu_chunk) + > - BITS_TO_LONGS(region_size >> PAGE_SHIFT); > + BITS_TO_LONGS(region_size >> PAGE_SHIFT) * sizeof(unsigned long); Hmm. Wouldn't this be cleaner as alloc_size =struct_size(chunk, populated, BITS_TO_LONGS(region_size >> PAGE_SHIFT) ); and looking at this, I realize that I thought we enabled warnings for 'sizeof()' of flexible array structures to avoid these kinds of mistakes, but that must clearly have happened only in a dream of mine. Anyway, pulled. Linus